/**
 * 老仙配镜 - 一体化管理系统原型
 * 共享样式库
 * 
 * 色彩规范：
 * - 主色调：#1142BE (CMYK C:93 M:74 Y:0 K:0)
 * - 辅助蓝：#2D5FD9, #4F7EE8, #7DB4F5
 * - 深色背景：#0a1628, #1a2d4a
 * - 成功色：#10B981
 * - 警告色：#F59E0B
 * - 错误色：#EF4444
 */

/* ==================== CSS Variables ==================== */
:root {
    /* 品牌色 - 老仙蓝 */
    --lx-primary: #1142BE;
    --lx-primary-light: #2D5FD9;
    --lx-primary-lighter: #4F7EE8;
    --lx-primary-lightest: #7DB4F5;
    --lx-primary-dark: #0D3399;
    
    /* 功能色 */
    --lx-success: #10B981;
    --lx-success-light: #34D399;
    --lx-warning: #F59E0B;
    --lx-warning-light: #FBBF24;
    --lx-error: #EF4444;
    --lx-error-light: #F87171;
    --lx-info: #3B82F6;
    
    /* 中性色 - 深色模式 */
    --lx-bg-dark: #0a1628;
    --lx-bg-dark-secondary: #1a2d4a;
    --lx-bg-dark-tertiary: #0f2035;
    
    /* 中性色 - 浅色模式 */
    --lx-bg-light: #F8FAFC;
    --lx-bg-white: #FFFFFF;
    --lx-bg-gray: #F1F5F9;
    
    /* 文字色 */
    --lx-text-primary: #1E293B;
    --lx-text-secondary: #64748B;
    --lx-text-tertiary: #94A3B8;
    --lx-text-white: #FFFFFF;
    --lx-text-white-secondary: rgba(255, 255, 255, 0.7);
    --lx-text-white-tertiary: rgba(255, 255, 255, 0.5);
    
    /* 边框色 */
    --lx-border: #E2E8F0;
    --lx-border-light: #F1F5F9;
    --lx-border-dark: rgba(255, 255, 255, 0.1);
    
    /* 阴影 */
    --lx-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --lx-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --lx-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --lx-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --lx-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --lx-shadow-primary: 0 10px 30px rgba(17, 66, 190, 0.3);
    
    /* 玻璃效果 */
    --lx-glass-bg: rgba(255, 255, 255, 0.7);
    --lx-glass-bg-dark: rgba(255, 255, 255, 0.05);
    --lx-glass-border: rgba(255, 255, 255, 0.2);
    --lx-glass-blur: blur(20px);
    
    /* 圆角 */
    --lx-radius-sm: 6px;
    --lx-radius: 8px;
    --lx-radius-md: 12px;
    --lx-radius-lg: 16px;
    --lx-radius-xl: 20px;
    --lx-radius-2xl: 24px;
    --lx-radius-full: 9999px;
    
    /* 字体 */
    --lx-font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --lx-font-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    
    /* 字号 */
    --lx-text-xs: 11px;
    --lx-text-sm: 13px;
    --lx-text-base: 14px;
    --lx-text-md: 15px;
    --lx-text-lg: 16px;
    --lx-text-xl: 18px;
    --lx-text-2xl: 20px;
    --lx-text-3xl: 24px;
    --lx-text-4xl: 30px;
    --lx-text-5xl: 36px;
    
    /* 行高 */
    --lx-leading-tight: 1.25;
    --lx-leading-normal: 1.5;
    --lx-leading-relaxed: 1.625;
    
    /* 过渡 */
    --lx-transition-fast: 0.15s ease;
    --lx-transition: 0.3s ease;
    --lx-transition-slow: 0.5s ease;
    --lx-transition-spring: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 间距 */
    --lx-space-1: 4px;
    --lx-space-2: 8px;
    --lx-space-3: 12px;
    --lx-space-4: 16px;
    --lx-space-5: 20px;
    --lx-space-6: 24px;
    --lx-space-8: 32px;
    --lx-space-10: 40px;
    --lx-space-12: 48px;
    
    /* Z-index */
    --lx-z-dropdown: 1000;
    --lx-z-sticky: 1020;
    --lx-z-fixed: 1030;
    --lx-z-modal-backdrop: 1040;
    --lx-z-modal: 1050;
    --lx-z-popover: 1060;
    --lx-z-tooltip: 1070;
}

/* ==================== Reset ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--lx-font-family);
    line-height: var(--lx-leading-normal);
    color: var(--lx-text-primary);
    background: var(--lx-bg-light);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* ==================== Utilities ==================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--lx-space-1); }
.gap-2 { gap: var(--lx-space-2); }
.gap-3 { gap: var(--lx-space-3); }
.gap-4 { gap: var(--lx-space-4); }
.gap-6 { gap: var(--lx-space-6); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-xs { font-size: var(--lx-text-xs); }
.text-sm { font-size: var(--lx-text-sm); }
.text-base { font-size: var(--lx-text-base); }
.text-lg { font-size: var(--lx-text-lg); }
.text-xl { font-size: var(--lx-text-xl); }
.text-2xl { font-size: var(--lx-text-2xl); }
.text-3xl { font-size: var(--lx-text-3xl); }

.text-primary { color: var(--lx-primary); }
.text-success { color: var(--lx-success); }
.text-warning { color: var(--lx-warning); }
.text-error { color: var(--lx-error); }
.text-secondary { color: var(--lx-text-secondary); }
.text-tertiary { color: var(--lx-text-tertiary); }

.bg-primary { background-color: var(--lx-primary); }
.bg-white { background-color: var(--lx-bg-white); }
.bg-gray { background-color: var(--lx-bg-gray); }

.rounded { border-radius: var(--lx-radius); }
.rounded-md { border-radius: var(--lx-radius-md); }
.rounded-lg { border-radius: var(--lx-radius-lg); }
.rounded-xl { border-radius: var(--lx-radius-xl); }
.rounded-full { border-radius: var(--lx-radius-full); }

.shadow { box-shadow: var(--lx-shadow); }
.shadow-md { box-shadow: var(--lx-shadow-md); }
.shadow-lg { box-shadow: var(--lx-shadow-lg); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== Components ==================== */

/* Button */
.lx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--lx-space-2);
    padding: 10px 20px;
    font-size: var(--lx-text-base);
    font-weight: 500;
    border-radius: var(--lx-radius);
    transition: all var(--lx-transition);
    cursor: pointer;
    border: none;
    outline: none;
}

.lx-btn-primary {
    background: linear-gradient(135deg, var(--lx-primary) 0%, var(--lx-primary-light) 100%);
    color: var(--lx-text-white);
    box-shadow: var(--lx-shadow-primary);
}

.lx-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(17, 66, 190, 0.4);
}

.lx-btn-secondary {
    background: var(--lx-bg-white);
    color: var(--lx-text-primary);
    border: 1px solid var(--lx-border);
}

.lx-btn-secondary:hover {
    background: var(--lx-bg-gray);
    border-color: var(--lx-border);
}

.lx-btn-ghost {
    background: transparent;
    color: var(--lx-primary);
}

.lx-btn-ghost:hover {
    background: rgba(17, 66, 190, 0.08);
}

.lx-btn-sm {
    padding: 6px 12px;
    font-size: var(--lx-text-sm);
}

.lx-btn-lg {
    padding: 14px 28px;
    font-size: var(--lx-text-lg);
}

.lx-btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--lx-radius);
}

.lx-btn-icon.lx-btn-sm {
    width: 32px;
    height: 32px;
}

/* Input */
.lx-input-wrapper {
    position: relative;
}

.lx-input {
    width: 100%;
    padding: 10px 14px;
    font-size: var(--lx-text-base);
    border: 1px solid var(--lx-border);
    border-radius: var(--lx-radius);
    background: var(--lx-bg-white);
    transition: all var(--lx-transition-fast);
    outline: none;
}

.lx-input:focus {
    border-color: var(--lx-primary);
    box-shadow: 0 0 0 3px rgba(17, 66, 190, 0.1);
}

.lx-input::placeholder {
    color: var(--lx-text-tertiary);
}

.lx-input-with-icon {
    padding-left: 40px;
}

.lx-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lx-text-tertiary);
}

/* Card */
.lx-card {
    background: var(--lx-bg-white);
    border-radius: var(--lx-radius-lg);
    box-shadow: var(--lx-shadow);
    overflow: hidden;
}

.lx-card-header {
    padding: var(--lx-space-4) var(--lx-space-5);
    border-bottom: 1px solid var(--lx-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lx-card-title {
    font-size: var(--lx-text-lg);
    font-weight: 600;
    color: var(--lx-text-primary);
}

.lx-card-body {
    padding: var(--lx-space-5);
}

.lx-card-footer {
    padding: var(--lx-space-4) var(--lx-space-5);
    border-top: 1px solid var(--lx-border-light);
    background: var(--lx-bg-gray);
}

/* Glass Card */
.lx-glass-card {
    background: var(--lx-glass-bg);
    backdrop-filter: var(--lx-glass-blur);
    -webkit-backdrop-filter: var(--lx-glass-blur);
    border: 1px solid var(--lx-glass-border);
    border-radius: var(--lx-radius-lg);
}

.lx-glass-card-dark {
    background: var(--lx-glass-bg-dark);
    border-color: var(--lx-border-dark);
}

/* Badge */
.lx-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: var(--lx-text-xs);
    font-weight: 500;
    border-radius: var(--lx-radius-full);
    background: var(--lx-bg-gray);
    color: var(--lx-text-secondary);
}

.lx-badge-primary {
    background: rgba(17, 66, 190, 0.1);
    color: var(--lx-primary);
}

.lx-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--lx-success);
}

.lx-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--lx-warning);
}

.lx-badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--lx-error);
}

/* Avatar */
.lx-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--lx-radius-full);
    background: linear-gradient(135deg, var(--lx-primary) 0%, var(--lx-primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lx-text-white);
    font-weight: 600;
    font-size: var(--lx-text-base);
}

.lx-avatar-sm { width: 32px; height: 32px; font-size: var(--lx-text-sm); }
.lx-avatar-lg { width: 48px; height: 48px; font-size: var(--lx-text-lg); }
.lx-avatar-xl { width: 64px; height: 64px; font-size: var(--lx-text-2xl); }

/* Tag */
.lx-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: var(--lx-text-xs);
    border-radius: var(--lx-radius-sm);
    background: var(--lx-bg-gray);
    color: var(--lx-text-secondary);
}

/* Progress */
.lx-progress {
    height: 6px;
    background: var(--lx-bg-gray);
    border-radius: var(--lx-radius-full);
    overflow: hidden;
}

.lx-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--lx-primary) 0%, var(--lx-primary-light) 100%);
    border-radius: var(--lx-radius-full);
    transition: width var(--lx-transition);
}

/* Divider */
.lx-divider {
    height: 1px;
    background: var(--lx-border);
    margin: var(--lx-space-4) 0;
}

/* ==================== AI Indicator ==================== */
.lx-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(17, 66, 190, 0.15) 0%, rgba(79, 126, 232, 0.15) 100%);
    border: 1px solid rgba(17, 66, 190, 0.3);
    border-radius: var(--lx-radius-full);
    font-size: var(--lx-text-xs);
    font-weight: 500;
    color: var(--lx-primary);
}

.lx-ai-dot {
    width: 6px;
    height: 6px;
    background: var(--lx-success);
    border-radius: 50%;
    animation: lx-pulse 2s infinite;
}

@keyframes lx-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.lx-ai-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--lx-primary) 0%, var(--lx-primary-light) 100%);
    border-radius: var(--lx-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lx-text-white);
    box-shadow: var(--lx-shadow-primary);
    cursor: pointer;
    transition: all var(--lx-transition);
    z-index: var(--lx-z-fixed);
}

.lx-ai-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 14px 40px rgba(17, 66, 190, 0.5);
}

.lx-ai-fab svg {
    width: 24px;
    height: 24px;
}

/* ==================== Mobile Specific ==================== */
/* iPhone 16 Pro Max: 440 x 956 (logical pixels) */
.mobile-frame {
    width: 393px;
    height: 852px;
    background: #000;
    border-radius: 50px;
    padding: 12px;
    box-shadow: 
        0 0 0 4px #1a1a1a,
        0 0 0 6px #333,
        0 30px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.mobile-screen {
    width: 100%;
    height: 100%;
    background: var(--lx-bg-white);
    border-radius: 40px;
    overflow: hidden;
    position: relative;
}

.mobile-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 126px;
    height: 34px;
    background: #000;
    border-radius: 0 0 20px 20px;
    z-index: 100;
}

.mobile-status-bar {
    height: 54px;
    padding: 14px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 14px;
    font-weight: 600;
}

.mobile-home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: #000;
    border-radius: 3px;
}

/* ==================== Web Layout ==================== */
.web-layout {
    display: flex;
    min-height: 100vh;
}

.web-sidebar {
    width: 240px;
    background: var(--lx-bg-white);
    border-right: 1px solid var(--lx-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: var(--lx-z-sticky);
}

.web-main {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
}

.web-header {
    height: 64px;
    background: var(--lx-bg-white);
    border-bottom: 1px solid var(--lx-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: var(--lx-z-sticky);
}

.web-content {
    flex: 1;
    padding: 24px;
    background: var(--lx-bg-light);
}

/* Sidebar Menu */
.sidebar-logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--lx-border-light);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--lx-primary) 0%, var(--lx-primary-light) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--lx-text-white);
}

.sidebar-logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--lx-text-primary);
}

.sidebar-menu {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.menu-group {
    margin-bottom: 8px;
}

.menu-group-title {
    padding: 8px 12px;
    font-size: var(--lx-text-xs);
    font-weight: 500;
    color: var(--lx-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--lx-radius);
    color: var(--lx-text-secondary);
    transition: all var(--lx-transition-fast);
    cursor: pointer;
    margin-bottom: 2px;
}

.menu-item:hover {
    background: var(--lx-bg-gray);
    color: var(--lx-text-primary);
}

.menu-item.active {
    background: rgba(17, 66, 190, 0.08);
    color: var(--lx-primary);
}

.menu-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item-text {
    flex: 1;
    font-size: var(--lx-text-base);
}

.menu-item-badge {
    padding: 2px 8px;
    background: var(--lx-error);
    color: var(--lx-text-white);
    border-radius: var(--lx-radius-full);
    font-size: var(--lx-text-xs);
    font-weight: 500;
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.95);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.4s ease; }
.animate-slideDown { animation: slideDown 0.4s ease; }
.animate-scaleIn { animation: scaleIn 0.3s ease; }

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    animation: slideUp 0.4s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }

