
        :root {
            --primary: #2563EB;
            --primary-dark: #1d4ed8;
            --secondary: #3B82F6;
            --cta: #F97316;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --dark: #1E293B;
            --dark-light: #334155;
            --bg: #F8FAFC;
            --bg-card: #FFFFFF;
            --text: #1E293B;
            --text-muted: #64748B;
            --border: #E2E8F0;
            --shadow: none; /* Flat Design */
            --shadow-lg: none; /* Flat Design */
            --radius: 12px;
            --radius-sm: 8px;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            background: var(--bg);
            font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            color: var(--text);
            line-height: 1.6;
            min-height: 100vh;
        }
        
        /* 登录页面 */
        .login-container {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
            background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
        }
        .login-box {
            background: var(--bg-card);
            padding: 40px;
            border-radius: var(--radius);
            
            width: 100%;
            max-width: 420px;
        }
        .login-box h2 {
            margin: 0 0 8px;
            color: var(--dark);
            text-align: center;
            font-size: 24px;
            font-weight: 700;
        }
        .login-box .subtitle {
            text-align: center;
            color: var(--text-muted);
            font-size: 14px;
            margin-bottom: 30px;
        }
        .login-tabs {
            display: flex;
            margin-bottom: 25px;
            background: var(--bg);
            border-radius: var(--radius-sm);
            padding: 4px;
        }
        .login-tabs span {
            flex: 1;
            padding: 12px;
            text-align: center;
            cursor: pointer;
            color: var(--text-muted);
            border-radius: 6px;
            font-weight: 500;
            transition: all 0.2s ease;
        }
        .login-tabs span:hover { color: var(--text); }
        .login-tabs span.active {
            background: var(--bg-card);
            color: var(--primary);
            
        }
        .login-form input {
            width: 100%;
            padding: 14px 16px;
            margin: 8px 0;
            border: 2px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 15px;
            transition: all 0.2s ease;
            background: var(--bg-card);
        }
        .login-form input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }
        .login-form button {
            width: 100%;
            padding: 14px;
            background: var(--primary);
            color: #fff;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 15px;
            transition: all 0.2s ease;
        }
        .login-form button:hover { background: var(--primary-dark); transform: translateY(-1px); }
        .login-form button:active { transform: translateY(0); }
        .error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; }
        .success { color: var(--success); font-size: 13px; margin-top: 10px; text-align: center; }
        
        /* 主应用布局 */
        .app-container { display: flex; min-height: 100vh; }
        
        /* 侧边栏 */
        .sidebar {
            width: 240px;
            background: var(--dark);
            color: #fff;
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            z-index: 100;
            transition: transform 0.3s ease;
        }
        .sidebar-header {
            padding: 24px 20px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .sidebar-header h2 {
            font-size: 18px;
            font-weight: 700;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .sidebar-header h2 svg { width: 24px; height: 24px; }
        .sidebar .user-info {
            padding: 20px;
            background: rgba(255,255,255,0.05);
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .sidebar .user-info b { color: var(--success); font-size: 15px; }
        .status { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
        .status.ok { color: var(--success); }
        .status.expired { color: var(--warning); }
        .status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
        
        .menu-item {
            padding: 14px 20px;
            cursor: pointer;
            color: rgba(255,255,255,0.65);
            font-size: 14px;
            font-weight: 500;
            border-left: 3px solid transparent;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: all 0.2s ease;
        }
        .menu-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
        .menu-item.active { background: rgba(37, 99, 235, 0.2); color: #fff; border-left-color: var(--primary); }
        .menu-item.logout { margin-top: auto; color: #f87171; border-top: 1px solid rgba(255,255,255,0.1); }
        .menu-item.logout:hover { background: rgba(248, 113, 113, 0.1); color: #fca5a5; }
        
        /* 主内容区 */
        .main {
            flex: 1;
            padding: 30px;
            margin-left: 240px;
            min-height: 100vh;
        }
        
        .tab-content { display: none; animation: fadeIn 0.3s ease; }
        .tab-content.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        
        /* 卡片 */

        /* 教程横幅 */
        .tutorial-banner { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; color: #fff; }
        .tutorial-banner-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
        .tutorial-icon { font-size: 48px; line-height: 1; }
        .tutorial-banner h3 { font-size: 18px; margin: 0 0 6px 0; color: #fff; }
        .tutorial-banner p { font-size: 14px; margin: 0; opacity: 0.9; }
        .tutorial-banner-btn { display: block; width: 100%; text-align: center; background: #fff; color: #667eea; padding: 12px 24px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; font-size: 15px; transition: opacity 0.2s; }
        .tutorial-banner-btn:hover { opacity: 0.9; }
        .tutorial-banner-btn:active { transform: scale(0.98); }
        .card {
            background: var(--bg-card);
            padding: 24px;
            border-radius: var(--radius);
            
            margin-bottom: 24px;
            transition: box-shadow 0.2s ease;
        }
        .card:hover {  }
        h3 {
            margin: 0 0 20px;
            color: var(--dark);
            font-size: 18px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        h3::before {
            content: '';
            width: 4px;
            height: 20px;
            background: var(--primary);
            border-radius: 2px;
        }
        
        /* 表单元素 */
        input, textarea, select {
            width: 100%;
            padding: 12px 14px;
            margin: 6px 0;
            border: 2px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-family: inherit;
            transition: all 0.2s ease;
            background: var(--bg-card);
        }
        input:focus, textarea:focus, select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }
        textarea { min-height: 100px; resize: vertical; }
        
        label { display: block; font-weight: 500; color: var(--text); margin-bottom: 4px; font-size: 14px; }
        
        /* 按钮 */
        .btn {
            background: var(--primary);
            color: #fff;
            border: none;
            padding: 12px 24px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-weight: 600;
            font-size: 14px;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s ease;
        }
        .btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
        .btn:active { transform: translateY(0); }
        .btn-danger { background: var(--danger); }
        .btn-danger:hover { background: #dc2626; }
        .btn-orange { background: var(--cta); }
        .btn-orange:hover { background: #ea580c; }
        .btn-green { background: var(--success); }
        .btn-green:hover { background: #059669; }
        .btn-small { padding: 8px 14px; font-size: 12px; }
        .btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
        .btn-outline:hover { background: var(--primary); color: #fff; }
        
        /* 表格 */
        table { width: 100%; border-collapse: collapse; }
        th, td { text-align: left; padding: 14px 12px; font-size: 13px; }
        th { background: var(--bg); font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
        tr { border-bottom: 1px solid var(--border); transition: background 0.2s ease; }
        tbody tr:hover { background: var(--bg); }
        
        /* 统计卡片 */
        .stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 24px; }
        .stat-card {
            background: var(--bg-card);
            padding: 20px;
            border-radius: var(--radius);
            
            text-align: center;
            transition: all 0.2s ease;
        }
        .stat-card:hover { transform: translateY(-2px);  }
        .stat-card small { color: var(--text-muted); display: block; margin-bottom: 8px; font-size: 12px; }
        .stat-card b { font-size: 32px; font-weight: 700; color: var(--primary); }
        .stat-card.query-stat { text-align: left; }
        .stat-card.query-stat small { text-align: center; font-size: 14px; font-weight: 600; color: var(--text); }
        .stat-source { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; color: var(--text-muted); }
        .stat-source strong { color: var(--text); font-size: 15px; }
        .stat-source.total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--text); font-weight: 600; }
        .stat-source.total strong { color: var(--primary); font-size: 18px; }
        
        /* 提示 */
        .alert { padding: 16px 20px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; }
        .alert-warning { background: #FEF3C7; color: #92400E; border-left: 4px solid var(--warning); }
        .alert-info { background: #DBEAFE; color: #1E40AF; border-left: 4px solid var(--primary); }
        .alert-success { background: #D1FAE5; color: #065F46; border-left: 4px solid var(--success); }
        
        .code-box {
            background: var(--dark);
            color: #e2e8f0;
            padding: 16px;
            border-radius: var(--radius-sm);
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 13px;
            word-break: break-all;
            margin: 12px 0;
            line-height: 1.8;
        }
        
        /* 锁定状态 */
        .locked { opacity: 0.5; pointer-events: none; position: relative; }
        .locked::after {
            content: '请先激活账号';
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            background: var(--dark);
            color: #fff;
            padding: 16px 28px;
            border-radius: var(--radius-sm);
            font-size: 15px;
            font-weight: 500;
            white-space: nowrap;
        }
        
        .activate-btn { background: var(--cta); }
        .activate-btn:hover { background: #ea580c; }
        
        /* 移动端适配 */
        .mobile-header {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: var(--dark);
            color: #fff;
            padding: 16px 20px;
            z-index: 99;
            align-items: center;
            justify-content: space-between;
        }
        .mobile-header h2 { font-size: 16px; margin: 0; }
        .menu-toggle {
            background: none;
            border: none;
            color: #fff;
            cursor: pointer;
            padding: 8px;
        }
        .sidebar-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 99;
        }
        
        @media (max-width: 768px) {
            html, body { width:100%; overflow-x:hidden; }
            .app-container { display:block; width:100%; min-height:100vh; }
            .sidebar { transform:translateX(-100%); width:min(82vw,300px); z-index:110; box-shadow:8px 0 24px rgba(15,23,42,.22); }
            .sidebar.open { transform:translateX(0); }
            .sidebar-overlay.open { display:block; z-index:105; }
            .mobile-header { display:flex; height:56px; padding:8px 14px; z-index:100; box-shadow:0 2px 8px rgba(15,23,42,.18); }
            .menu-toggle { width:40px; height:40px; margin:0; display:flex; align-items:center; justify-content:center; }
            .main { margin-left:0; width:100%; min-width:0; min-height:100vh; padding:70px 12px 20px; overflow-x:hidden; }
            .card { padding:14px; margin-bottom:14px; border-radius:10px; overflow:hidden; }
            h3 { font-size:16px; margin-bottom:14px; }
            input, textarea, select { font-size:16px; padding:10px 12px; }
            textarea { min-height:90px; }
            .btn { min-height:40px; padding:9px 12px; font-size:13px; justify-content:center; }
            .btn-small { min-height:34px; padding:7px 9px; font-size:11px; }
            .stat-row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
            .stat-card { padding:12px 8px; }
            .stat-card b { font-size:24px; }
            .tutorial-banner { padding:16px; }
            .tutorial-banner-header { gap:10px; }
            .tutorial-icon { font-size:34px; }
            .tutorial-card-content { flex-direction:column !important; align-items:flex-start !important; }
            .tutorial-card-btn { width:100% !important; text-align:center !important; margin-top:4px !important; white-space:normal !important; }

            /* 回复规则专属：四个子页签可横向滑动，不挤压文字 */
            .reply-rules-page .sub-tabs { overflow-x:auto; flex-wrap:nowrap; padding:0 0 10px !important; margin-bottom:12px !important; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
            .reply-rules-page .sub-tabs::-webkit-scrollbar { display:none; }
            .reply-rules-page .sub-tabs .btn { flex:0 0 auto; min-height:36px; padding:7px 12px; font-size:12px; white-space:nowrap; }
            .reply-rules-page > div[style*="margin-bottom:20px"] { margin-bottom:14px !important; padding:10px 12px !important; line-height:1.55; }
            .reply-rules-page > div[style*="margin-bottom:20px"] a { display:inline-block; margin:4px 0 0 !important; }

            /* 回复列表使用横向表格容器，保持操作按钮可点且不撑破整页 */
            .reply-rules-page .card > table { display:block; width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; margin-bottom:12px !important; }
            .reply-rules-page .card > table tbody { display:table; min-width:620px; width:100%; }
            .reply-rules-page .card > table tr { display:table-row; }
            .reply-rules-page .card > table th, .reply-rules-page .card > table td { padding:9px 7px; font-size:12px; }
            .reply-rules-page .card > table td:last-child { min-width:155px; white-space:normal !important; }
            .reply-rules-page .card > table td:last-child .btn { margin:2px 2px 2px 0; }
            .reply-rules-page .card > table td[style*="max-width:200px"] { max-width:150px !important; }

            /* 关键词新增页的关键词和匹配方式改为上下排列 */
            .reply-rules-page form > div[style*="display:flex"][style*="gap:10px"] { display:block !important; }
            .reply-rules-page form > div[style*="display:flex"][style*="gap:10px"] > div { width:100%; margin-bottom:10px; }
            .reply-rules-page form > div[style*="display:flex"][style*="gap:10px"] > div[style*="flex"] { flex:none !important; }

            /* 模板变量与开关区在窄屏中防止代码溢出 */
            .reply-rules-page code { white-space:normal; overflow-wrap:anywhere; }
            .reply-rules-page textarea[rows="10"] { min-height:260px; font-size:13px !important; line-height:1.5; }
            .reply-rules-page label[style*="display:flex"] { align-items:flex-start !important; }
            .reply-rules-page label[style*="display:flex"] input[type="checkbox"] { margin-top:3px !important; }
        }
        @media (max-width:390px) {
            .main { padding-left:9px; padding-right:9px; }
            .card { padding:12px 10px; }
            .reply-rules-page .sub-tabs .btn { padding-left:10px; padding-right:10px; }
        }
