/* ============================================================
   Lingxi API Platform — Main Stylesheet
   Fonts: Inter (Latin) + Noto Sans SC (Chinese) + Noto Sans Devanagari (Hindi)
   ============================================================ */

   @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Sans+Devanagari:wght@300;400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

   /* ── Variables ──────────────────────────────────────────── */
   :root {
     /* Colors */
     --bg-base:       #07070f;
     --bg-surface:    #0f0f1e;
     --bg-card:       rgba(255, 255, 255, 0.02);
     --bg-card-hover: rgba(176, 138, 42, 0.05); /* slightly golden on hover */
     --bg-input:      rgba(0, 0, 0, 0.3);
     --border:        rgba(176, 138, 42, 0.18);
     --border-light:  rgba(176, 138, 42, 0.3);
   
     --accent:        #c41230; /* vermilion */
     --accent-hover:  #a50e27;
     --accent-muted:  rgba(196, 18, 48, 0.12);
     --accent-dim:    rgba(196, 18, 48, 0.06);
   
     --success:       #34c97d;
     --success-muted: rgba(52, 201, 125, 0.12);
     --warning:       #b08a2a; /* gold */
     --warning-muted: rgba(176, 138, 42, 0.12);
     --danger:        #f05252;
     --danger-muted:  rgba(240, 82, 82, 0.12);
     --info:          #d4aa44; /* light gold */
     --info-muted:    rgba(212, 170, 68, 0.12);
   
     --text-primary:  #f0ece4;
     --text-secondary:rgba(240, 236, 228, 0.65);
     --text-muted:    #7a7a8a;
     --text-inverse:  #07070f;
   
     /* Spacing */
     --r-xs:  4px;
     --r-sm:  6px;
     --r-md:  10px;
     --r-lg:  14px;
     --r-xl:  18px;
     --r-2xl: 24px;
   
     /* Shadows */
     --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
     --shadow-md:  0 4px 16px rgba(0,0,0,.5);
     --shadow-lg:  0 8px 32px rgba(0,0,0,.6);
     --shadow-accent: 0 4px 20px rgba(79,126,247,.25);
   
     /* Sidebar */
     --sidebar-w: 240px;
     --topbar-h:  60px;
   
     /* Transitions */
     --t: .18s ease;
   }
   
   /* ── Reset ──────────────────────────────────────────────── */
   *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
   
   html { font-size: 15px; scroll-behavior: smooth; }
   
   body {
     font-family: 'EB Garamond', 'Noto Serif SC', 'Noto Serif', serif;
     background: var(--bg-base);
     color: var(--text-primary);
     line-height: 1.6;
     -webkit-font-smoothing: antialiased;
     min-height: 100vh;
   }
   
   a { color: var(--accent); text-decoration: none; transition: color var(--t); }
   a:hover { color: var(--accent-hover); }
   
   img { max-width: 100%; display: block; }
   button, input, select, textarea { font-family: inherit; }
   ul, ol { list-style: none; }
   
   /* ── Scrollbar ──────────────────────────────────────────── */
   ::-webkit-scrollbar { width: 5px; height: 5px; }
   ::-webkit-scrollbar-track { background: var(--bg-surface); }
   ::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
   ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
   
   /* ── Typography ─────────────────────────────────────────── */
   h1,h2,h3,h4,h5,h6 { font-weight: 600; color: var(--text-primary); line-height: 1.3; }
   h1 { font-size: 1.75rem; }
   h2 { font-size: 1.35rem; }
   h3 { font-size: 1.1rem; }
   h4 { font-size: .95rem; }
   p  { color: var(--text-secondary); }
   
   .mono { font-family: 'JetBrains Mono', monospace; }
   
   /* ── Layout ─────────────────────────────────────────────── */
   .app-shell {
     display: flex;
     min-height: 100vh;
   }
   
   /* Sidebar */
   .sidebar {
     width: var(--sidebar-w);
     background: var(--bg-surface);
     border-right: 1px solid var(--border);
     display: flex;
     flex-direction: column;
     position: fixed;
     top: 0; left: 0;
     height: 100vh;
     z-index: 100;
     transition: transform var(--t);
     overflow-y: auto;
     overflow-x: hidden;
   }
   
   .sidebar-logo {
     padding: 20px 22px 16px;
     display: flex;
     align-items: center;
     gap: 10px;
     border-bottom: 1px solid var(--border);
   }
   
   .sidebar-logo .logo-icon {
     width: 32px; height: 32px;
     background: transparent;
     border-radius: var(--r-sm);
     display: flex; align-items: center; justify-content: center;
     flex-shrink: 0;
     overflow: hidden;
   }
   
   .sidebar-logo .logo-icon img {
     width: 100%;
     height: 100%;
     object-fit: contain;
     display: block;
   }
   
   .sidebar-logo .logo-text {
     font-size: 1rem;
     font-weight: 700;
     color: var(--text-primary);
     letter-spacing: -.3px;
   }
   
   .sidebar-logo .logo-badge {
     font-size: .62rem;
     background: var(--accent-muted);
     color: var(--accent);
     padding: 1px 6px;
     border-radius: 20px;
     font-weight: 600;
     margin-left: auto;
   }
   
   /* Nav */
   .sidebar-nav {
     flex: 1;
     padding: 14px 10px;
   }
   
   .nav-section-label {
     font-size: .65rem;
     font-weight: 600;
     text-transform: uppercase;
     letter-spacing: .08em;
     color: var(--text-muted);
     padding: 8px 12px 4px;
   }
   
   .nav-item {
     display: flex;
     align-items: center;
     gap: 10px;
     padding: 9px 12px;
     border-radius: var(--r-md);
     color: var(--text-secondary);
     font-size: .875rem;
     font-weight: 500;
     transition: all var(--t);
     cursor: pointer;
     position: relative;
     margin-bottom: 1px;
   }
   
   .nav-item svg {
     width: 16px; height: 16px;
     flex-shrink: 0;
     stroke: currentColor;
     fill: none;
     stroke-width: 1.75;
     stroke-linecap: round;
     stroke-linejoin: round;
   }
   
   .nav-item:hover {
     background: var(--bg-card);
     color: var(--text-primary);
   }
   
   .nav-item.active {
     background: var(--accent-muted);
     color: var(--accent);
   }
   
   .nav-item.active svg { stroke: var(--accent); }
   
   .nav-badge {
     margin-left: auto;
     font-size: .65rem;
     background: var(--accent);
     color: white;
     padding: 1px 6px;
     border-radius: 20px;
     font-weight: 600;
   }
   
   /* Sidebar Balance */
   .sidebar-balance {
     margin: 0 10px 10px;
     background: var(--accent-dim);
     border: 1px solid rgba(79,126,247,.15);
     border-radius: var(--r-lg);
     padding: 14px;
   }
   
   .sidebar-balance .sb-label {
     font-size: .7rem;
     color: var(--text-muted);
     text-transform: uppercase;
     letter-spacing: .06em;
     font-weight: 600;
   }
   
   .sidebar-balance .sb-amount {
     font-size: 1.35rem;
     font-weight: 700;
     color: var(--text-primary);
     font-family: 'JetBrains Mono', monospace;
     margin: 4px 0 8px;
   }
   
   .sidebar-balance .sb-topup {
     display: flex;
     align-items: center;
     gap: 6px;
     font-size: .75rem;
     font-weight: 600;
     color: var(--accent);
     text-decoration: none;
   }
   
   .sidebar-balance .sb-topup:hover { color: var(--accent-hover); }
   
   /* Sidebar User */
   .sidebar-user {
     padding: 12px 14px;
     border-top: 1px solid var(--border);
     display: flex;
     align-items: center;
     gap: 10px;
   }
   
   .sidebar-user .avatar {
     width: 32px; height: 32px;
     border-radius: 50%;
     background: var(--bg-card);
     border: 2px solid var(--border);
     object-fit: cover;
     flex-shrink: 0;
     display: flex; align-items: center; justify-content: center;
     font-size: .75rem;
     font-weight: 700;
     color: var(--accent);
   }
   
   .sidebar-user .user-info { flex: 1; min-width: 0; }
   .sidebar-user .user-name {
     font-size: .8rem;
     font-weight: 600;
     color: var(--text-primary);
     white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
   }
   .sidebar-user .user-sub {
     font-size: .7rem;
     color: var(--text-muted);
   }
   
   .sidebar-user .logout-btn {
     color: var(--text-muted);
     transition: color var(--t);
     display: flex;
     background: none;
     border: none;
     cursor: pointer;
     padding: 4px;
   }
   .sidebar-user .logout-btn:hover { color: var(--danger); }
   .sidebar-user .logout-btn svg {
     width: 15px; height: 15px;
     stroke: currentColor; fill: none;
     stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
   }
   
   /* Main content area */
   .main-area {
     margin-left: var(--sidebar-w);
     flex: 1;
     display: flex;
     flex-direction: column;
     min-width: 0;
   }
   
   /* Topbar */
   .topbar {
     height: var(--topbar-h);
     background: var(--bg-surface);
     border-bottom: 1px solid var(--border);
     padding: 0 24px;
     display: flex;
     align-items: center;
     gap: 16px;
     position: sticky;
     top: 0; z-index: 50;
   }
   
   .topbar-hamburger {
     display: none;
     background: none;
     border: none;
     cursor: pointer;
     color: var(--text-secondary);
     padding: 6px;
     border-radius: var(--r-sm);
     transition: all var(--t);
   }
   .topbar-hamburger:hover { background: var(--bg-card); color: var(--text-primary); }
   .topbar-hamburger svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; }
   
   .topbar-title {
     font-size: .9rem;
     font-weight: 600;
     color: var(--text-primary);
     flex: 1;
   }
   
   .topbar-actions {
     display: flex;
     align-items: center;
     gap: 10px;
   }
   
   /* Lang switcher */
   .lang-switcher {
     display: flex;
     align-items: center;
     background: var(--bg-card);
     border: 1px solid var(--border);
     border-radius: var(--r-md);
     overflow: hidden;
     height: 32px;
   }
   
   .lang-switcher a {
     padding: 0 10px;
     font-size: .72rem;
     font-weight: 600;
     color: var(--text-muted);
     transition: all var(--t);
     display: flex; align-items: center;
     height: 100%;
     text-decoration: none;
   }
   .lang-switcher a:hover { color: var(--text-primary); background: var(--bg-card-hover); }
   .lang-switcher a.active { color: var(--accent); background: var(--accent-muted); }
   
   /* ── Page Content ────────────────────────────────────────── */
   .page-content {
     padding: 28px 28px 48px;
     flex: 1;
     overflow-x: hidden;
   }
   
   .page-header {
     margin-bottom: 28px;
   }
   
   .page-header h1 { font-size: 1.4rem; margin-bottom: 4px; }
   .page-header p { font-size: .85rem; color: var(--text-muted); }
   
   /* ── Cards ──────────────────────────────────────────────── */
   .card {
     background: var(--bg-card);
     border: 1px solid var(--border);
     border-radius: var(--r-xl);
     overflow: hidden;
   }
   
   .card-header {
     padding: 16px 20px;
     border-bottom: 1px solid var(--border);
     display: flex;
     align-items: center;
     gap: 10px;
   }
   
   .card-header h3 {
     font-size: .9rem;
     font-weight: 600;
     flex: 1;
   }
   
   .card-header-icon {
     width: 32px; height: 32px;
     background: var(--accent-muted);
     border-radius: var(--r-sm);
     display: flex; align-items: center; justify-content: center;
     flex-shrink: 0;
   }
   
   .card-header-icon svg {
     width: 15px; height: 15px;
     stroke: var(--accent); fill: none;
     stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
   }
   
   .card-header-icon img {
     width: 18px;
     height: 18px;
     object-fit: contain;
     display: block;
   }
   
   .card-header-icon--logo {
     background: var(--accent-muted);
   }
   
   .card-body { padding: 20px; }
   .card-body-sm { padding: 14px 20px; }
   .card-footer { padding: 14px 20px; border-top: 1px solid var(--border); }
   
   /* ── Stat Cards ─────────────────────────────────────────── */
   .stat-grid {
     display: grid;
     grid-template-columns: repeat(4, 1fr);
     gap: 16px;
     margin-bottom: 24px;
   }
   
   @media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
   @media (max-width: 540px)  { .stat-grid { grid-template-columns: 1fr; } }
   
   .stat-card {
     background: var(--bg-card);
     border: 1px solid var(--border);
     border-radius: var(--r-xl);
     padding: 20px;
     display: flex;
     flex-direction: column;
     gap: 12px;
     transition: border-color var(--t), box-shadow var(--t);
   }
   
   .stat-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }
   
   .stat-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
   }
   
   .stat-icon {
     width: 36px; height: 36px;
     border-radius: var(--r-md);
     display: flex; align-items: center; justify-content: center;
   }
   
   .stat-icon svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
   .stat-icon.blue   { background: var(--accent-muted);   color: var(--accent);   }
   .stat-icon.green  { background: var(--success-muted);  color: var(--success);  }
   .stat-icon.yellow { background: var(--warning-muted);  color: var(--warning);  }
   .stat-icon.red    { background: var(--danger-muted);   color: var(--danger);   }
   .stat-icon.cyan   { background: var(--info-muted);     color: var(--info);     }
   
   .stat-trend {
     font-size: .72rem;
     font-weight: 600;
     padding: 3px 8px;
     border-radius: 20px;
     display: flex; align-items: center; gap: 3px;
   }
   .stat-trend.up   { background: var(--success-muted); color: var(--success); }
   .stat-trend.down { background: var(--danger-muted);  color: var(--danger);  }
   .stat-trend.flat { background: var(--bg-input);      color: var(--text-muted); }
   
   .stat-value {
     font-size: 1.65rem;
     font-weight: 700;
     font-family: 'JetBrains Mono', monospace;
     color: var(--text-primary);
     line-height: 1.2;
   }
   
   .stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
   
   /* ── Grid Helpers ────────────────────────────────────────── */
   .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
   .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
   @media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
   
   /* ── Tables ─────────────────────────────────────────────── */
   .table-wrap { overflow-x: auto; }
   
   table {
     width: 100%;
     border-collapse: collapse;
     font-size: .85rem;
   }
   
   thead th {
     padding: 10px 16px;
     text-align: left;
     font-size: .72rem;
     font-weight: 600;
     text-transform: uppercase;
     letter-spacing: .06em;
     color: var(--text-muted);
     border-bottom: 1px solid var(--border);
     white-space: nowrap;
   }
   
   tbody td {
     padding: 12px 16px;
     color: var(--text-secondary);
     border-bottom: 1px solid var(--border);
     vertical-align: middle;
   }
   
   tbody tr:last-child td { border-bottom: none; }
   
   tbody tr {
     transition: background var(--t);
   }
   
   tbody tr:hover { background: var(--bg-card-hover); }
   
   /* ── Badges ─────────────────────────────────────────────── */
   .badge {
     display: inline-flex; align-items: center; gap: 4px;
     font-size: .7rem; font-weight: 600;
     padding: 3px 8px;
     border-radius: 20px;
     white-space: nowrap;
   }
   
   .badge-dot {
     width: 5px; height: 5px;
     border-radius: 50%;
     display: inline-block;
     flex-shrink: 0;
   }
   
   .badge-green   { background: var(--success-muted); color: var(--success); }
   .badge-green .badge-dot { background: var(--success); }
   .badge-red     { background: var(--danger-muted);  color: var(--danger);  }
   .badge-red .badge-dot { background: var(--danger); }
   .badge-yellow  { background: var(--warning-muted); color: var(--warning); }
   .badge-yellow .badge-dot { background: var(--warning); }
   .badge-blue    { background: var(--accent-muted);  color: var(--accent);  }
   .badge-blue .badge-dot { background: var(--accent); }
   .badge-gray    { background: var(--bg-input);      color: var(--text-muted); }
   
   /* ── Buttons ─────────────────────────────────────────────── */
   .btn {
     display: inline-flex; align-items: center; justify-content: center;
     gap: 7px;
     padding: 9px 18px;
     font-size: .85rem;
     font-weight: 600;
     border-radius: var(--r-md);
     border: none;
     cursor: pointer;
     transition: all var(--t);
     text-decoration: none;
     white-space: nowrap;
     line-height: 1;
   }
   
   .btn svg {
     width: 15px; height: 15px;
     stroke: currentColor; fill: none;
     stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
     flex-shrink: 0;
   }
   
   .btn-primary {
     background: var(--accent);
     color: white;
     box-shadow: 0 2px 8px rgba(79,126,247,.3);
   }
   .btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-accent); transform: translateY(-1px); }
   .btn:disabled,
   .btn[disabled] {
     opacity: 0.45;
     cursor: not-allowed;
     transform: none;
     box-shadow: none;
     pointer-events: none;
   }
   
   .btn-secondary {
     background: var(--bg-card-hover);
     color: var(--text-secondary);
     border: 1px solid var(--border);
   }
   .btn-secondary:hover { background: var(--bg-input); color: var(--text-primary); }
   
   .btn-danger {
     background: var(--danger-muted);
     color: var(--danger);
     border: 1px solid rgba(240,82,82,.2);
   }
   .btn-danger:hover { background: var(--danger); color: white; }
   
   .btn-ghost {
     background: transparent;
     color: var(--text-muted);
   }
   .btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }
   
   .btn-sm { padding: 6px 12px; font-size: .78rem; }
   .btn-lg { padding: 13px 28px; font-size: .95rem; }
   .btn-icon { padding: 8px; border-radius: var(--r-sm); }
   .btn-icon svg { width: 16px; height: 16px; }
   
   /* ── Forms ──────────────────────────────────────────────── */
   .form-group { margin-bottom: 18px; }
   
   .form-label {
     display: block;
     font-size: .8rem;
     font-weight: 600;
     color: var(--text-secondary);
     margin-bottom: 7px;
   }
   
   .form-control {
     width: 100%;
     background: var(--bg-input);
     border: 1px solid var(--border);
     border-radius: var(--r-md);
     padding: 10px 14px;
     color: var(--text-primary);
     font-size: .875rem;
     transition: border-color var(--t), box-shadow var(--t);
     outline: none;
   }
   
   .form-control:focus {
     border-color: var(--accent);
     box-shadow: 0 0 0 3px rgba(79,126,247,.15);
   }
   
   .form-control::placeholder { color: var(--text-muted); }
   
   select.form-control { cursor: pointer; }
   textarea.form-control { resize: vertical; min-height: 100px; }
   
   .form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 5px; }
   
   .input-group {
     display: flex;
     align-items: stretch;
     border: 1px solid var(--border);
     border-radius: var(--r-md);
     overflow: hidden;
     background: var(--bg-input);
     transition: border-color var(--t), box-shadow var(--t);
   }
   .input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,126,247,.15); }
   .input-group .form-control { border: none; background: transparent; box-shadow: none; flex: 1; }
   .input-group .form-control:focus { box-shadow: none; }
   .input-group-addon {
     display: flex; align-items: center; justify-content: center;
     padding: 0 12px;
     color: var(--text-muted);
     font-size: .85rem;
     border-left: 1px solid var(--border);
     cursor: pointer;
     transition: all var(--t);
     background: var(--bg-card);
   }
   .input-group-addon:hover { background: var(--bg-card-hover); color: var(--text-primary); }
   .input-group-addon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
   
   /* ── Alert Boxes ─────────────────────────────────────────── */
   .alert {
     display: flex;
     align-items: flex-start;
     gap: 12px;
     padding: 14px 16px;
     border-radius: var(--r-lg);
     font-size: .85rem;
     border-left: 3px solid;
   }
   .alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
   .alert-info    { background: var(--info-muted);    color: var(--info);    border-color: var(--info);    }
   .alert-warning { background: var(--warning-muted); color: var(--warning); border-color: var(--warning); }
   .alert-success { background: var(--success-muted); color: var(--success); border-color: var(--success); }
   .alert-danger  { background: var(--danger-muted);  color: var(--danger);  border-color: var(--danger);  }
   
   /* ── Empty State ─────────────────────────────────────────── */
   .empty-state {
     text-align: center;
     padding: 48px 24px;
     color: var(--text-muted);
   }
   .empty-state-icon {
     width: 56px; height: 56px;
     margin: 0 auto 16px;
     background: var(--bg-input);
     border-radius: var(--r-xl);
     display: flex; align-items: center; justify-content: center;
   }
   .empty-state-icon svg { width: 24px; height: 24px; stroke: var(--text-muted); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
   .empty-state h4 { color: var(--text-secondary); margin-bottom: 6px; }
   .empty-state p  { font-size: .85rem; margin-bottom: 20px; }
   
   /* ── Code Block ─────────────────────────────────────────── */
   .code-block {
     background: var(--bg-base);
     border: 1px solid var(--border);
     border-radius: var(--r-lg);
     padding: 16px 20px;
     font-family: 'JetBrains Mono', monospace;
     font-size: .825rem;
     color: var(--text-secondary);
     overflow-x: auto;
     white-space: pre;
     line-height: 1.7;
   }
   
   .code-block .token-keyword { color: var(--accent); }
   .code-block .token-string  { color: var(--success); }
   .code-block .token-comment { color: var(--text-muted); }
   
   /* ── Modal ──────────────────────────────────────────────── */
   .modal-overlay {
     display: none;
     position: fixed; inset: 0;
     background: rgba(0,0,0,.7);
     backdrop-filter: blur(4px);
     z-index: 200;
     align-items: center;
     justify-content: center;
     padding: 20px;
   }
   .modal-overlay.open { display: flex; }
   
   .modal {
     background: var(--bg-card);
     border: 1px solid var(--border);
     border-radius: var(--r-2xl);
     width: 100%;
     max-width: 480px;
     max-height: 90vh;
     overflow-y: auto;
     box-shadow: var(--shadow-lg);
     animation: modalIn .18s ease;
   }
   
   @keyframes modalIn {
     from { opacity: 0; transform: scale(.96) translateY(10px); }
     to   { opacity: 1; transform: none; }
   }
   
   .modal-header {
     padding: 20px 22px 0;
     display: flex;
     align-items: center;
     justify-content: space-between;
     margin-bottom: 16px;
   }
   
   .modal-header h3 { font-size: 1rem; }
   
   .modal-close {
     background: none; border: none;
     color: var(--text-muted); cursor: pointer;
     padding: 4px; border-radius: var(--r-sm);
     transition: all var(--t);
     display: flex;
   }
   .modal-close:hover { background: var(--bg-input); color: var(--text-primary); }
   .modal-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
   
   .modal-body { padding: 0 22px 20px; }
   .modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
   
   /* ── Address Box ─────────────────────────────────────────── */
   .address-box {
     background: var(--bg-base);
     border: 1px solid var(--border);
     border-radius: var(--r-lg);
     padding: 16px;
     display: flex;
     align-items: center;
     gap: 12px;
   }
   .address-box .address-text {
     flex: 1;
     font-family: 'JetBrains Mono', monospace;
     font-size: .8rem;
     color: var(--text-secondary);
     word-break: break-all;
     line-height: 1.5;
   }
   .address-copy {
     background: var(--bg-card);
     border: 1px solid var(--border);
     border-radius: var(--r-sm);
     padding: 8px;
     cursor: pointer;
     color: var(--text-muted);
     transition: all var(--t);
     display: flex;
     flex-shrink: 0;
   }
   .address-copy:hover { background: var(--accent-muted); color: var(--accent); }
   .address-copy svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
   
   /* QR Code placeholder */
   .qr-placeholder {
     width: 130px; height: 130px;
     background: white;
     border-radius: var(--r-lg);
     flex-shrink: 0;
     display: flex; align-items: center; justify-content: center;
     padding: 8px;
   }
   .qr-placeholder img { width: 100%; height: 100%; }
   
   /* ── Network Selector ────────────────────────────────────── */
   .network-cards {
     display: grid;
     grid-template-columns: repeat(3, 1fr);
     gap: 10px;
     margin-bottom: 20px;
   }
   
   .network-card {
     background: var(--bg-input);
     border: 2px solid var(--border);
     border-radius: var(--r-lg);
     padding: 14px 12px;
     cursor: pointer;
     text-align: center;
     transition: all var(--t);
   }
   .network-card:hover { border-color: var(--border-light); background: var(--bg-card-hover); }
   .network-card.selected { border-color: var(--accent); background: var(--accent-dim); }
   .network-card .net-name { font-size: .8rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
   .network-card .net-sub  { font-size: .68rem; color: var(--text-muted); }
   
   /* ── Top-up payment method tabs ──────────────────────────── */
   .pay-method-wrap {
     display: flex;
     flex-direction: column;
     gap: 10px;
   }
   .pay-method-tabs {
     display: grid;
     grid-template-columns: repeat(4, minmax(0, 1fr));
     gap: 10px;
   }
   @media (max-width: 720px) {
     .pay-method-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
   }
   .pay-method-cn-footnote {
     margin: 0;
     font-size: 0.75rem;
     line-height: 1.45;
     color: var(--text-muted);
     padding: 0 2px;
   }
   .pay-method-tab {
     box-sizing: border-box;
     margin: 0;
     min-height: 46px;
     padding: 10px 12px;
     border-radius: var(--r-lg);
     border: 2px solid var(--border);
     background: var(--bg-input);
     color: var(--text-secondary);
     font-family: inherit;
     font-size: 0.78rem;
     font-weight: 600;
     line-height: 1.25;
     cursor: pointer;
     transition: border-color var(--t), background var(--t), color var(--t);
     text-align: center;
     appearance: none;
     -webkit-appearance: none;
     display: flex;
     align-items: center;
     justify-content: center;
   }
   .pay-method-tab:hover {
     border-color: var(--border-light);
     background: var(--bg-card-hover);
     color: var(--text-primary);
   }
   .pay-method-tab.active {
     border-color: var(--accent);
     background: var(--accent-dim);
     color: var(--accent);
   }
   .pay-method-tab--locked:not(.active) {
     opacity: 0.88;
   }
   .pay-method-tab--locked.active {
     opacity: 1;
     border-color: rgba(136, 146, 164, 0.45);
     background: var(--bg-card);
     color: var(--text-secondary);
   }
   .pay-method-tab-inner {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     gap: 6px;
     max-width: 100%;
   }
   .pay-method-lock {
     width: 13px;
     height: 13px;
     flex-shrink: 0;
     stroke: currentColor;
     fill: none;
     stroke-width: 2;
     stroke-linecap: round;
     stroke-linejoin: round;
     opacity: 0.75;
   }
   
   .cn-region-card {
     border: 1px solid var(--border);
     background: var(--bg-card);
     box-shadow: none;
   }
   .cn-region-body {
     padding: 18px 20px 20px;
   }
   .cn-region-head {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 12px;
     margin-bottom: 12px;
   }
   .cn-region-pill {
     font-size: 0.62rem;
     font-weight: 700;
     letter-spacing: 0.05em;
     text-transform: uppercase;
     padding: 4px 10px;
     border-radius: 999px;
     border: 1px solid var(--border);
     color: var(--text-muted);
     background: var(--bg-input);
   }
   .cn-region-lock-ico {
     width: 22px;
     height: 22px;
     flex-shrink: 0;
     stroke: var(--text-muted);
     fill: none;
     stroke-width: 2;
     stroke-linecap: round;
     stroke-linejoin: round;
     opacity: 0.65;
   }
   .cn-region-method {
     margin: 0 0 10px;
     font-size: 1rem;
     font-weight: 700;
     color: var(--text-primary);
     letter-spacing: -0.01em;
   }
   .cn-region-detail {
     margin: 0;
     font-size: 0.82rem;
     line-height: 1.55;
     color: var(--text-muted);
   }
   
   .pay-method-panel { display: block; }
   .pay-method-panel.is-hidden { display: none !important; }
   .is-hidden { display: none !important; }
   
   /* ── Model Cards ─────────────────────────────────────────── */
   .model-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
     gap: 16px;
   }
   
   .model-card {
     background: var(--bg-card);
     border: 1px solid var(--border);
     border-radius: var(--r-xl);
     padding: 20px;
     transition: all var(--t);
   }
   .model-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
   
   .model-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
   
   .model-name { font-size: .9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
   .model-provider { font-size: .7rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
   
   .provider-dot {
     width: 6px; height: 6px; border-radius: 50%; display: inline-block;
   }
   .provider-dot.google  { background: var(--accent); }
   .provider-dot.anthropic { background: #cc785c; }
   .provider-dot.openai  { background: var(--success); }
   
   .model-pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
   .model-price-item { background: var(--bg-input); border-radius: var(--r-sm); padding: 10px; }
   .model-price-label { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 3px; }
   .model-price-val { font-size: .85rem; font-weight: 700; color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }
   
   .model-tags { display: flex; flex-wrap: wrap; gap: 6px; }
   .model-tag {
     font-size: .68rem; font-weight: 600;
     padding: 2px 8px;
     border-radius: 20px;
     background: var(--bg-input);
     color: var(--text-muted);
     display: flex; align-items: center; gap: 3px;
   }
   .model-tag.enabled { background: var(--success-muted); color: var(--success); }
   .model-tag svg { width: 10px; height: 10px; }
   
   .context-badge {
     font-size: .7rem; font-weight: 700;
     padding: 4px 10px;
     border-radius: 20px;
     background: var(--accent-muted);
     color: var(--accent);
     white-space: nowrap;
     flex-shrink: 0;
   }
   
   /* ── Chart Area ──────────────────────────────────────────── */
   .chart-container {
     position: relative;
     height: 220px;
     width: 100%;
   }
   
   /* ── Toast ──────────────────────────────────────────────── */
   .toast-container {
     position: fixed;
     bottom: 24px; right: 24px;
     z-index: 300;
     display: flex;
     flex-direction: column;
     gap: 10px;
     pointer-events: none;
   }
   
   .toast {
     pointer-events: all;
     background: var(--bg-card);
     border: 1px solid var(--border);
     border-radius: var(--r-lg);
     padding: 12px 16px;
     display: flex; align-items: center; gap: 10px;
     font-size: .83rem;
     font-weight: 500;
     box-shadow: var(--shadow-lg);
     animation: toastIn .2s ease;
     min-width: 240px;
     max-width: 340px;
   }
   @keyframes toastIn {
     from { opacity: 0; transform: translateX(20px); }
     to   { opacity: 1; transform: none; }
   }
   .toast svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
   .toast.toast-success { border-left: 3px solid var(--success); }
   .toast.toast-success svg { stroke: var(--success); }
   .toast.toast-error   { border-left: 3px solid var(--danger);  }
   .toast.toast-error svg   { stroke: var(--danger);  }
   .toast.toast-info    { border-left: 3px solid var(--accent);  }
   .toast.toast-info svg    { stroke: var(--accent);  }
   .toast-msg { flex: 1; color: var(--text-secondary); }
   
   /* ── Skeleton Loading ────────────────────────────────────── */
   @keyframes shimmer {
     0%   { background-position: -400px 0; }
     100% { background-position:  400px 0; }
   }
   .skeleton {
     background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
     background-size: 400px 100%;
     animation: shimmer 1.4s infinite;
     border-radius: var(--r-sm);
     display: block;
   }
   
   /* ── Login Page ─────────────────────────────────────────── */
   .login-page {
     min-height: 100vh;
     display: flex;
     align-items: stretch;
   }
   
   .login-left {
     flex: 1;
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 40px;
   }
   
   .login-right {
     width: 460px;
     background: var(--bg-surface);
     border-left: 1px solid var(--border);
     display: flex;
     flex-direction: column;
     justify-content: center;
     padding: 48px 44px;
   }
   
   @media (max-width: 860px) {
     .login-right { width: 100%; border: none; padding: 32px 24px; }
     .login-left  { display: none; }
     .login-page  { background: var(--bg-surface); }
   }
   
   .login-branding {
     margin-bottom: 36px;
   }
   
   .login-logo {
     display: flex;
     align-items: center;
     gap: 12px;
     margin-bottom: 20px;
   }
   
   .login-logo-icon {
     width: 44px; height: 44px;
     background: transparent;
     border-radius: var(--r-lg);
     display: flex; align-items: center; justify-content: center;
     overflow: hidden;
   }
   .login-logo-icon img {
     width: 100%;
     height: 100%;
     object-fit: contain;
     display: block;
   }
   
   .login-logo-text { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); letter-spacing: -.5px; }
   
   .login-tagline { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }
   
   .tg-login-btn {
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 12px;
     width: 100%;
     padding: 14px 24px;
     background: #2aabee;
     color: white;
     border: none;
     border-radius: var(--r-lg);
     font-size: .95rem;
     font-weight: 700;
     cursor: pointer;
     transition: all var(--t);
     text-decoration: none;
     margin-bottom: 16px;
   }
   .tg-login-btn:hover { background: #1a9bd8; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(42,171,238,.3); color: white; }
   .tg-login-btn svg { width: 22px; height: 22px; fill: white; }
   
   .login-divider {
     text-align: center;
     color: var(--text-muted);
     font-size: .75rem;
     margin: 18px 0;
     position: relative;
   }
   .login-divider::before,
   .login-divider::after {
     content: '';
     position: absolute;
     top: 50%;
     width: 42%;
     height: 1px;
     background: var(--border);
   }
   .login-divider::before { left: 0; }
   .login-divider::after  { right: 0; }
   
   .login-features { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
   .login-feature-item {
     display: flex;
     align-items: center;
     gap: 10px;
     color: var(--text-secondary);
     font-size: .82rem;
   }
   .login-feature-item svg { width: 15px; height: 15px; flex-shrink: 0; stroke: var(--success); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
   
   .login-left-bg {
     width: 100%;
     max-width: 480px;
     text-align: center;
     display: flex;
     flex-direction: column;
     align-items: center;
   }
   .login-left-logo {
     width: 72px;
     height: 72px;
     object-fit: contain;
     display: block;
     margin: 0 0 16px;
     flex-shrink: 0;
   }
   .login-left-bg .stat-preview {
     width: 100%;
     align-self: stretch;
   }
   .login-left-bg h2 { font-size: 1.8rem; margin-bottom: 14px; color: var(--text-primary); }
   .login-left-bg p  { color: var(--text-secondary); font-size: .9rem; line-height: 1.6; }
   
   .stat-preview {
     display: grid;
     grid-template-columns: repeat(3, 1fr);
     gap: 14px;
     margin-top: 36px;
   }
   .stat-preview-item {
     background: var(--bg-card);
     border: 1px solid var(--border);
     border-radius: var(--r-xl);
     padding: 18px 14px;
     text-align: center;
   }
   .stat-preview-val { font-size: 1.3rem; font-weight: 700; color: var(--accent); font-family: 'JetBrains Mono', monospace; }
   .stat-preview-lbl { font-size: .72rem; color: var(--text-muted); margin-top: 3px; }
   
   /* ── Responsive ──────────────────────────────────────────── */
   @media (max-width: 768px) {
     .sidebar {
       transform: translateX(-100%);
     }
     .sidebar.open {
       transform: translateX(0);
       box-shadow: var(--shadow-lg);
     }
     .main-area { margin-left: 0; }
     .topbar-hamburger { display: flex; }
     .page-content { padding: 20px 16px 40px; }
     .topbar { padding: 0 16px; }
     .network-cards { grid-template-columns: 1fr; }
     .modal { margin: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 85vh; position: fixed; bottom: 0; }
     .modal-overlay { align-items: flex-end; padding: 0; }
   }
   
   @media (max-width: 480px) {
     .stat-value { font-size: 1.35rem; }
     .model-pricing { grid-template-columns: 1fr; }
   }
   
   /* ── Sidebar overlay ─────────────────────────────────────── */
   .sidebar-overlay {
     display: none;
     position: fixed;
     inset: 0;
     background: rgba(0,0,0,.5);
     z-index: 99;
   }
   .sidebar-overlay.open { display: block; }
   
   /* ── Progress Bar ────────────────────────────────────────── */
   .progress-bar {
     height: 4px;
     background: var(--bg-input);
     border-radius: 4px;
     overflow: hidden;
   }
   .progress-fill {
     height: 100%;
     background: var(--accent);
     border-radius: 4px;
     transition: width .5s ease;
   }
   
   /* ── Misc ────────────────────────────────────────────────── */
   .divider { height: 1px; background: var(--border); margin: 20px 0; }
   .text-muted { color: var(--text-muted); }
   .text-secondary { color: var(--text-secondary); }
   .text-primary-c { color: var(--text-primary); }
   .text-accent { color: var(--accent); }
   .text-success { color: var(--success); }
   .text-danger { color: var(--danger); }
   .text-warning { color: var(--warning); }
   .fw-600 { font-weight: 600; }
   .fw-700 { font-weight: 700; }
   .fs-sm { font-size: .8rem; }
   .fs-xs { font-size: .72rem; }
   .mb-0 { margin-bottom: 0; }
   .mb-8 { margin-bottom: 8px; }
   .mb-16 { margin-bottom: 16px; }
   .mb-24 { margin-bottom: 24px; }
   .mt-16 { margin-top: 16px; }
   .mt-24 { margin-top: 24px; }
   .d-flex { display: flex; }
   .ai-center { align-items: center; }
   .jc-between { justify-content: space-between; }
   .gap-8 { gap: 8px; }
   .gap-12 { gap: 12px; }
   .gap-16 { gap: 16px; }
   .flex-1 { flex: 1; }
   .w-full { width: 100%; }
   
   /* ── Legal pages (Terms / Privacy) ─────────────────────── */
   .legal-page {
     min-height: 100vh;
     background: var(--bg-surface);
     padding: 0 20px 48px;
   }
   .legal-page-header {
     max-width: 720px;
     margin: 0 auto;
     padding: 20px 0 8px;
     display: flex;
     align-items: center;
     justify-content: space-between;
     flex-wrap: wrap;
     gap: 12px;
     border-bottom: 1px solid var(--border);
   }
   .legal-page-brand {
     display: inline-flex;
     align-items: center;
     gap: 10px;
     font-weight: 700;
     color: var(--text-primary);
     font-size: 1rem;
   }
   .legal-page-brand:hover { color: var(--accent); }
   .legal-lang {
     display: flex;
     gap: 10px;
     align-items: center;
   }
   .legal-lang a {
     font-size: .75rem;
     font-weight: 600;
     color: var(--text-muted);
   }
   .legal-lang a.active { color: var(--accent); }
   .legal-page-main {
     max-width: 720px;
     margin: 0 auto;
     padding-top: 28px;
   }
   .legal-page-main > h1 {
     font-size: 1.65rem;
     font-weight: 700;
     letter-spacing: -0.02em;
     margin-bottom: 8px;
   }
   .legal-effective {
     font-size: .85rem;
     color: var(--text-muted);
     margin-bottom: 28px;
   }
   .legal-prose {
     font-size: .92rem;
     line-height: 1.65;
     color: var(--text-secondary);
   }
   .legal-prose h2 {
     font-size: 1.05rem;
     font-weight: 700;
     color: var(--text-primary);
     margin: 28px 0 12px;
   }
   .legal-prose h2:first-child { margin-top: 0; }
   .legal-prose p { margin-bottom: 12px; }
   .legal-prose ul {
     list-style: disc;
     margin: 8px 0 16px 1.25rem;
   }
   .legal-prose li { margin-bottom: 6px; }
   .legal-cross-nav {
     margin-top: 40px;
     padding-top: 24px;
     border-top: 1px solid var(--border);
     font-size: .88rem;
     color: var(--text-muted);
     display: flex;
     flex-wrap: wrap;
     align-items: center;
     gap: 8px;
   }
   .legal-cross-nav span { opacity: 0.45; user-select: none; }
   