    :root {
      --bg: #1a1a2e;
      --card-bg: #16213e;
      --primary: #e8b85a;
      --primary-dark: #c49a3c;
      --accent: #0f3460;
      --text: #e0e0e0;
      --text-secondary: #a0a0b8;
      --border: #2a2a4a;
      --success: #4caf84;
      --error: #e0556a;
      --input-bg: #1e2a3a;
      --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
      background: var(--bg);
      background-image:
        radial-gradient(ellipse at 50% 0%, rgba(232, 184, 90, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(15, 52, 96, 0.3) 0%, transparent 50%);
      min-height: 100vh;
      color: var(--text);
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 20px;
    }

    .header-banner {
      max-width: 600px;
      width: 100%;
      border-radius: 12px;
      box-shadow: var(--shadow);
    }

    /* ===== 主卡片 ===== */
    .main-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 32px 28px;
      max-width: 520px;
      width: 100%;
      box-shadow: var(--shadow);
      animation: fadeInUp 0.6s ease;
    }

    .card-title {
      text-align: center;
      font-size: 1.1rem;
      color: var(--primary);
      margin-bottom: 24px;
      font-weight: 600;
      letter-spacing: 1px;
    }

    /* ===== 表单区 ===== */
    .form-group {
      margin-bottom: 18px;
    }

    .form-group label {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 6px;
    }

    .form-group label .hint-link {
      font-size: 0.75rem;
      color: var(--primary);
      cursor: pointer;
      font-weight: 400;
      text-decoration: underline;
      margin-left: 4px;
    }

    .form-group select,
    .form-group input,
    .form-group textarea {
      width: 100%;
      padding: 12px 14px;
      background: var(--input-bg);
      border: 2px solid var(--border);
      border-radius: 10px;
      color: var(--text);
      font-size: 0.95rem;
      font-family: inherit;
      transition: all 0.3s ease;
      outline: none;
    }

    .form-group select:focus,
    .form-group input:focus,
    .form-group textarea:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(232, 184, 90, 0.12);
    }

    .form-group textarea {
      resize: vertical;
      min-height: 80px;
      line-height: 1.6;
    }

    .form-group textarea::placeholder {
      color: #555;
      line-height: 1.6;
    }

    .form-group select {
      cursor: pointer;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23e8b85a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 14px center;
      padding-right: 36px;
    }

    /* ===== 模式切换 ===== */
    .mode-tabs {
      display: flex;
      gap: 0;
      margin-bottom: 20px;
      background: var(--input-bg);
      border-radius: 10px;
      padding: 3px;
    }

    .mode-tab {
      flex: 1;
      padding: 10px 16px;
      text-align: center;
      cursor: pointer;
      border-radius: 8px;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-secondary);
      transition: all 0.3s ease;
      border: none;
      background: transparent;
      font-family: inherit;
    }

    .mode-tab.active {
      background: var(--primary);
      color: #1a1a2e;
      box-shadow: 0 2px 8px rgba(232, 184, 90, 0.3);
    }

    /* ===== 按钮 ===== */
    .btn {
      width: 100%;
      padding: 14px;
      border: none;
      border-radius: 10px;
      font-size: 1rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.3s ease;
      letter-spacing: 1px;
      font-family: inherit;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: #1a1a2e;
      box-shadow: 0 4px 16px rgba(232, 184, 90, 0.25);
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 24px rgba(232, 184, 90, 0.4);
    }

    .btn-primary:active {
      transform: translateY(0);
    }

    .btn-primary:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    /* ===== 结果区 ===== */
    .results-section {
      margin-top: 20px;
    }

    .results-title {
      font-size: 0.85rem;
      color: var(--text-secondary);
      margin-bottom: 8px;
      font-weight: 600;
    }

    .result-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 14px;
      background: var(--input-bg);
      border-radius: 8px;
      margin-bottom: 8px;
      border-left: 4px solid var(--border);
      animation: fadeIn 0.3s ease;
      font-size: 0.9rem;
    }

    .result-item.success {
      border-left-color: var(--success);
    }

    .result-item.error {
      border-left-color: var(--error);
    }

    .result-icon {
      font-size: 1.2rem;
      flex-shrink: 0;
    }

    .result-info {
      flex: 1;
      min-width: 0;
    }

    .result-code {
      font-weight: 600;
      color: var(--primary);
      font-family: 'Consolas', 'Courier New', monospace;
      font-size: 0.85rem;
    }

    .result-msg {
      color: var(--text-secondary);
      font-size: 0.8rem;
      margin-top: 2px;
    }

    .progress-bar-wrap {
      height: 4px;
      background: var(--border);
      border-radius: 2px;
      margin: 12px 0;
      overflow: hidden;
    }

    .progress-bar {
      height: 100%;
      background: var(--primary);
      border-radius: 2px;
      transition: width 0.3s ease;
      width: 0%;
    }

    /* ===== Toast ===== */
    .toast {
      position: fixed;
      top: 20px;
      left: 50%;
      transform: translateX(-50%);
      padding: 12px 24px;
      border-radius: 8px;
      font-weight: 600;
      font-size: 0.9rem;
      z-index: 999;
      animation: slideDown 0.4s ease;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    .toast.success {
      background: var(--success);
      color: #fff;
    }

    .toast.error {
      background: var(--error);
      color: #fff;
    }

    /* ===== 注意事项 ===== */
    .notes {
      margin-top: 24px;
      padding: 16px;
      background: var(--input-bg);
      border-radius: 10px;
      border: 1px solid var(--border);
    }

    .notes h4 {
      color: var(--primary);
      font-size: 0.85rem;
      margin-bottom: 8px;
    }

    .notes ul {
      list-style: none;
      padding: 0;
    }

    .notes li {
      font-size: 0.8rem;
      color: var(--text-secondary);
      padding: 3px 0;
      padding-left: 16px;
      position: relative;
    }

    .notes li::before {
      content: '•';
      position: absolute;
      left: 0;
      color: var(--primary);
    }

    /* ===== 页脚 ===== */
    .footer {
      margin-top: 28px;
      text-align: center;
      font-size: 0.78rem;
      color: var(--text-secondary);
    }

    .footer a {
      color: var(--primary);
      text-decoration: none;
    }

    /* ===== 模态框 ===== */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      animation: fadeIn 0.2s ease;
    }

    .modal {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 24px;
      max-width: 400px;
      width: 90%;
      box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    }

    .modal h4 {
      color: var(--primary);
      margin-bottom: 12px;
      font-size: 1rem;
    }

    .modal p {
      color: var(--text-secondary);
      font-size: 0.85rem;
      line-height: 1.6;
      margin-bottom: 16px;
    }

    .modal .btn {
      width: auto;
      padding: 10px 24px;
      font-size: 0.9rem;
    }

    /* ===== 动画 ===== */
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    /* ===== AI 面板样式 ===== */
    .ai-main-tabs {
      display: flex;
      gap: 8px;
      margin-bottom: 20px;
      background: rgba(255,255,255,0.03);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 5px;
    }
    .ai-main-tab {
      flex: 1;
      padding: 10px 0;
      border: none;
      border-radius: 9px;
      background: transparent;
      color: var(--text-secondary);
      font-family: inherit;
      font-size: 0.92rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.22s ease;
      letter-spacing: 0.05em;
    }
    .ai-main-tab:hover { color: var(--primary); }
    .ai-main-tab.active {
      background: linear-gradient(135deg, rgba(232,184,90,0.18), rgba(232,184,90,0.08));
      color: var(--primary);
      box-shadow: inset 0 0 0 1.5px rgba(232,184,90,0.55);
    }
    .ai-tab-panel { display: none; animation: fadeInUp 0.35s ease; }
    .ai-tab-panel.active { display: block; }

    .ai-sub-tabs {
      display: flex;
      gap: 6px;
      margin-bottom: 16px;
      flex-wrap: wrap;
    }
    .ai-sub-tab {
      padding: 7px 18px;
      border: 1px solid var(--border);
      border-radius: 20px;
      background: transparent;
      color: var(--text-secondary);
      font-family: inherit;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .ai-sub-tab:hover { border-color: var(--primary); color: var(--primary); }
    .ai-sub-tab.active {
      background: rgba(232,184,90,0.15);
      border-color: rgba(232,184,90,0.6);
      color: var(--primary);
    }
    .ai-sub-panel { display: none; animation: fadeInUp 0.3s ease; }
    .ai-sub-panel.active { display: block; }

    /* AI 基础介绍卡 */
    .ai-intro-card {
      background: rgba(255,255,255,0.03);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 18px 18px 16px;
    }
    .ai-intro-badge {
      display: inline-block;
      padding: 3px 12px;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      background: linear-gradient(135deg, rgba(232,184,90,0.15), rgba(232,184,90,0.05));
      color: var(--primary);
      border: 1px solid rgba(232,184,90,0.35);
      margin-bottom: 12px;
    }
    .ai-intro-text {
      font-size: 0.9rem;
      line-height: 1.75;
      color: var(--text);
    }
    .ai-highlight {
      color: var(--primary);
      font-weight: 700;
    }
    .ai-tech-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-top: 14px;
    }
    .ai-pill {
      padding: 4px 11px;
      border-radius: 20px;
      font-size: 0.78rem;
      font-weight: 600;
      background: rgba(232,184,90,0.1);
      color: var(--primary);
      border: 1px solid rgba(232,184,90,0.25);
    }

    /* AI 对比图表 */
    .ai-chart-wrap {
      margin-top: 18px;
      background: rgba(0,0,0,0.18);
      border: 1px solid rgba(232,184,90,0.2);
      border-radius: 12px;
      padding: 16px 16px 10px;
    }
    .ai-chart-title {
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--primary);
      margin-bottom: 14px;
      letter-spacing: 0.04em;
      text-align: center;
    }
    .ai-chart-bars { display: flex; flex-direction: column; gap: 12px; }
    .ai-bar-row { display: flex; align-items: center; gap: 10px; }
    .ai-bar-label {
      display: flex;
      align-items: center;
      gap: 6px;
      width: 110px;
      flex-shrink: 0;
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text);
    }
    .ai-bar-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .ai-bar-track {
      flex: 1;
      height: 26px;
      background: rgba(255,255,255,0.06);
      border-radius: 6px;
      overflow: hidden;
      position: relative;
    }
    .ai-bar-fill {
      height: 100%;
      width: 0;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding-right: 8px;
      font-size: 0.72rem;
      font-weight: 700;
      animation: barGrow 1.1s cubic-bezier(0.22,1,0.36,1) 0.25s forwards;
      position: relative;
    }
    .ai-bar-our {
      background: linear-gradient(90deg, #c49a3c, #e8b85a, #f5d88a);
      color: #1a1a2e;
      box-shadow: 0 0 16px rgba(232,184,90,0.45);
    }
    .ai-bar-other { background: linear-gradient(90deg, #3a3a5a, #4a4a6a); color: var(--text-secondary); }
    .ai-bar-pct { white-space: nowrap; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em; }
    @keyframes barGrow {
      from { width: 0; opacity: 0.4; }
      to { width: var(--bar-width); opacity: 1; }
    }
    .ai-chart-note {
      font-size: 0.7rem;
      color: var(--text-secondary);
      margin-top: 10px;
      text-align: right;
      opacity: 0.7;
    }

    /* AI 展望 */
    .ai-coming-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 14px;
    }
    .ai-coming-item {
      padding: 9px 14px;
      border-radius: 9px;
      background: rgba(255,255,255,0.03);
      border: 1px solid var(--border);
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* AI WIP 卡 */
    .ai-wip-wrap {
      text-align: center;
      padding: 44px 20px 40px;
    }
    .ai-wip-icon { font-size: 2.8rem; margin-bottom: 12px; }
    .ai-wip-title {
      font-size: 1.2rem;
      font-weight: 800;
      color: var(--primary);
      margin-bottom: 10px;
      letter-spacing: 1px;
    }
    .ai-wip-desc {
      font-size: 0.88rem;
      color: var(--text-secondary);
      line-height: 1.7;
      max-width: 300px;
      margin: 0 auto 18px;
    }
    .ai-wip-badge {
      display: inline-block;
      padding: 6px 20px;
      border-radius: 20px;
      background: linear-gradient(135deg, rgba(232,184,90,0.18), rgba(232,184,90,0.06));
      border: 1px solid rgba(232,184,90,0.45);
      color: var(--primary);
      font-size: 0.85rem;
      font-weight: 700;
      letter-spacing: 0.05em;
      animation: pulse 2.4s ease-in-out infinite;
    }
    @keyframes pulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(232,184,90,0.3); }
      50% { box-shadow: 0 0 0 6px rgba(232,184,90,0); }
    }

    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(24px); }
      to { opacity: 1; transform: translateY(0); }
    }

    @keyframes fadeInDown {
      from { opacity: 0; transform: translateY(-16px); }
      to { opacity: 1; transform: translateY(0); }
    }

    @keyframes slideDown {
      from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
      to { opacity: 1; transform: translateX(-50%) translateY(0); }
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    .spinner {
      display: inline-block;
      width: 18px;
      height: 18px;
      border: 2px solid transparent;
      border-top-color: #1a1a2e;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      vertical-align: middle;
      margin-right: 6px;
    }

    /* ===== 开关按钮 ===== */
    .toggle-switch {
      position: relative;
      display: inline-block;
      width: 52px;
      height: 28px;
      flex-shrink: 0;
    }

    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .toggle-slider {
      position: absolute;
      cursor: pointer;
      inset: 0;
      background: var(--border);
      border-radius: 28px;
      transition: 0.3s;
    }

    .toggle-slider::before {
      content: '';
      position: absolute;
      height: 22px;
      width: 22px;
      left: 3px;
      bottom: 3px;
      background: #fff;
      border-radius: 50%;
      transition: 0.3s;
    }

    .toggle-switch input:checked + .toggle-slider {
      background: var(--primary);
    }

    .toggle-switch input:checked + .toggle-slider::before {
      transform: translateX(24px);
    }

    /* ===== CDK 标签 ===== */
    .cdk-tag {
      display: inline-block;
      padding: 4px 10px;
      background: rgba(232, 184, 90, 0.12);
      border: 1px solid rgba(232, 184, 90, 0.25);
      border-radius: 6px;
      font-size: 0.78rem;
      font-family: 'Consolas', 'Courier New', monospace;
      color: var(--primary);
    }

    /* ===== 响应式 ===== */
    @media (max-width: 540px) {
      .main-card,
      .rank-card,
      .data-card {
        padding: 20px 16px;
      }
      .header h1 {
        font-size: 1.1rem;
      }
      .top-nav { gap: 2px; padding: 4px; }
      .top-nav-item { font-size: 0.72rem; padding: 8px 4px; }
    }

    /* ===== 布局容器 ===== */
    .app-container {
      max-width: 900px;
      width: 100%;
    }

    .logo-splash {
      position: fixed;
      inset: 0;
      z-index: 2000;
      display: flex;
      flex-direction: column;
      gap: 14px;
      align-items: center;
      justify-content: center;
      background: rgba(10, 14, 30, 0.88);
      backdrop-filter: blur(2px);
      pointer-events: none;
      opacity: 1;
      transition: opacity 0.4s ease;
    }

    .logo-splash.hide {
      opacity: 0;
    }

    .logo-splash img {
      width: min(72vw, 620px);
      max-height: 72vh;
      object-fit: contain;
      filter: drop-shadow(0 14px 40px rgba(0, 0, 0, 0.6));
    }

    .logo-splash-title {
      color: var(--primary);
      font-size: clamp(20px, 3.4vw, 34px);
      font-weight: 800;
      letter-spacing: 0.14em;
      text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
    }

    /* ===== 顶部胶囊 Tab 栏 ===== */
    .top-nav {
      display: flex;
      align-items: center;
      flex-wrap: nowrap;
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 6px;
      gap: 4px;
      box-shadow: var(--shadow);
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }

    .top-nav::-webkit-scrollbar {
      display: none;
    }

    .top-nav-item {
      flex: 1 1 0;
      padding: 10px 0;
      border-radius: 10px;
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-family: inherit;
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      letter-spacing: 0.03em;
    }

    .top-nav-item:hover {
      color: var(--primary);
    }

    .top-nav-item.active {
      background: rgba(232,184,90,0.15);
      color: var(--primary);
      box-shadow: inset 0 0 0 2px rgba(232,184,90,0.5);
    }

    .nav-scroll-hint {
      display: none;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-top: 6px;
      margin-bottom: 16px;
      color: var(--text-secondary);
      font-size: 0.75rem;
      letter-spacing: 0.02em;
      opacity: 0.9;
      transition: opacity 0.25s ease;
      user-select: none;
      pointer-events: none;
    }

    .nav-scroll-hint.hidden {
      opacity: 0;
    }

    .nav-scroll-hint .arrow {
      color: var(--primary);
      font-size: 0.82rem;
      font-weight: 700;
    }

    /* ===== 主内容区 ===== */
    .main-content {
      width: 100%;
    }

    .content-panel {
      display: none;
      animation: fadeInUp 0.4s ease;
    }

    .content-panel.active {
      display: block;
    }

    /* 兑换码卡片调整 */
    .main-card.sidebar-mode {
      border-radius: 14px;
      margin: 0 auto;
    }

    @media (max-width: 640px) {
      .top-nav-item { font-size: 0.82rem; }
      .rank-card { padding: 20px 14px; }
    }

    /* ===== 符文质检 - 代理配置卡片 ===== */
    .rune-proxy-card {
      background: var(--input-bg);
      border: 1px solid rgba(232,184,90,0.2);
      border-radius: 14px;
      padding: 16px 18px;
      animation: runeCardIn 0.38s cubic-bezier(0.22,1,0.36,1);
      position: relative;
    }

    @keyframes runeCardIn {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .rune-proxy-header {
      display: flex;
      align-items: center;
      gap: 7px;
      margin-bottom: 10px;
    }

    .rune-proxy-label-text {
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--text-secondary);
      letter-spacing: 1.5px;
      text-transform: uppercase;
    }

    .rune-live-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--success);
      box-shadow: 0 0 6px var(--success);
      animation: runeLivePulse 1.8s ease-in-out infinite;
      flex-shrink: 0;
    }

    .rune-proxy-card.expired .rune-live-dot {
      background: var(--error);
      box-shadow: 0 0 6px var(--error);
      animation: none;
    }

    @keyframes runeLivePulse {
      0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--success); }
      50%       { opacity: 0.5; box-shadow: 0 0 12px var(--success), 0 0 4px var(--success); }
    }

    .rune-countdown {
      margin-left: auto;
      font-size: 0.76rem;
      color: var(--text-secondary);
      font-variant-numeric: tabular-nums;
      letter-spacing: 0.2px;
      background: rgba(0,0,0,0.25);
      border-radius: 6px;
      padding: 2px 8px;
      border: 1px solid var(--border);
    }

    .rune-countdown:empty { display: none; }

    .rune-proxy-row {
      display: flex;
      align-items: center;
      gap: 2px;
      background: rgba(0,0,0,0.22);
      border: 1px solid rgba(232,184,90,0.16);
      border-radius: 10px;
      padding: 10px 14px;
      margin-bottom: 10px;
    }

    .rune-addr {
      font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
      font-size: 1.08rem;
      color: var(--primary);
      font-weight: 700;
      letter-spacing: 0.5px;
    }

    .rune-addr-sep {
      font-family: monospace;
      color: var(--text-secondary);
      font-size: 1rem;
      margin: 0 2px;
      opacity: 0.5;
    }

    .rune-copy-btn {
      margin-left: auto;
      background: none;
      border: 1px solid rgba(232,184,90,0.22);
      border-radius: 7px;
      color: var(--text-secondary);
      padding: 5px 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      transition: color 0.15s, border-color 0.15s, background 0.15s;
    }

    .rune-copy-btn:hover {
      color: var(--primary);
      border-color: rgba(232,184,90,0.5);
      background: rgba(232,184,90,0.07);
    }

    .rune-copy-btn.copied {
      color: var(--success);
      border-color: rgba(76,175,132,0.45);
    }

    .rune-proxy-status-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .rune-status-spinner {
      width: 13px;
      height: 13px;
      border: 1.8px solid rgba(160,160,184,0.2);
      border-top-color: var(--text-secondary);
      border-radius: 50%;
      animation: runeSpin 1s linear infinite;
      flex-shrink: 0;
    }

    .rune-proxy-card.expired .rune-status-spinner {
      animation: none;
      border-color: rgba(224,85,106,0.3);
      border-top-color: var(--error);
    }

    @keyframes runeSpin {
      to { transform: rotate(360deg); }
    }

    /* ===== 排名面板 ===== */
    .rank-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 28px 24px;
      box-shadow: var(--shadow);
    }

    .rank-card .card-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .rank-refresh {
      font-size: 0.75rem;
      color: var(--primary);
      cursor: pointer;
      background: none;
      border: 1px solid var(--primary);
      border-radius: 6px;
      padding: 4px 12px;
      font-family: inherit;
      transition: all 0.3s ease;
    }

    .rank-refresh:hover {
      background: var(--primary);
      color: #1a1a2e;
    }

    .rank-table-wrap {
      overflow-x: auto;
      margin-top: 16px;
      border-radius: 8px;
      border: 1px solid var(--border);
    }

    .rank-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
    }

    .rank-table th {
      background: var(--input-bg);
      color: var(--primary);
      padding: 12px 14px;
      text-align: left;
      font-weight: 600;
      font-size: 0.78rem;
      border-bottom: 2px solid var(--border);
      white-space: nowrap;
    }

    .rank-table td {
      padding: 10px 14px;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      color: var(--text);
      white-space: nowrap;
    }

    .rank-table tbody tr:hover td {
      background: rgba(232,184,90,0.05);
    }

    /* 自适应字体：屏幕越窄字越小，始终保持横排 */
    @media (max-width: 600px) {
      .rank-table { font-size: 0.72rem; }
      .rank-table th { font-size: 0.66rem; padding: 8px 8px; }
      .rank-table td { padding: 7px 8px; }
      .rank-position { min-width: 24px; height: 22px; font-size: 0.68rem; padding: 0 5px; }
    }
    @media (max-width: 420px) {
      .rank-table { font-size: 0.62rem; }
      .rank-table th { font-size: 0.58rem; padding: 6px 5px; }
      .rank-table td { padding: 6px 5px; }
      .rank-position { min-width: 20px; height: 20px; font-size: 0.6rem; padding: 0 4px; }
    }

    .rank-position {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 32px;
      height: 28px;
      border-radius: 6px;
      font-weight: 700;
      font-size: 0.8rem;
      padding: 0 8px;
    }

    .rank-position.r1 { background: linear-gradient(135deg,#FFD700,#FFA500); color:#1a1a2e; }
    .rank-position.r2 { background: linear-gradient(135deg,#C0C0C0,#A0A0A0); color:#1a1a2e; }
    .rank-position.r3 { background: linear-gradient(135deg,#CD7F32,#A0522D); color:#fff; }
    .rank-position.rn { background: var(--input-bg); color: var(--text-secondary); }

    .rank-loading {
      text-align: center;
      padding: 40px;
      color: var(--text-secondary);
    }

    .rank-empty {
      text-align: center;
      padding: 40px;
      color: var(--text-secondary);
      font-size: 0.9rem;
    }
    .ai-monster-card {
      flex: 0 0 80px;
      min-width: 0;
      box-sizing: border-box;
    }
    @media (max-width: 600px) {
      .ai-monster-card {
        flex: 0 0 calc(25% - 6px);
      }
    }

    .win-rate-high {
      color: #4caf84;
      font-weight: 700;
    }

    .rank-name-link {
      color: var(--primary);
      cursor: pointer;
      text-decoration: none;
      transition: color 0.2s;
    }

    .rank-name-link:hover {
      color: #fff;
      text-decoration: underline;
    }

    /* ===== 数据面板 ===== */
    .data-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 28px 24px;
      box-shadow: var(--shadow);
    }

    .data-loading {
      text-align: center;
      padding: 40px;
      color: var(--text-secondary);
    }

    .data-empty {
      text-align: center;
      padding: 40px;
      color: var(--text-secondary);
      font-size: 0.9rem;
    }

    .data-section {
      margin-bottom: 24px;
    }

    .data-section-title {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--primary);
      margin-bottom: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border);
    }

    .unit-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
      gap: 8px;
    }

    .unit-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 8px 6px;
      background: var(--input-bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 0.78rem;
      color: var(--text);
      text-align: center;
    }

    .unit-count {
      font-size: 0.72rem;
      color: var(--text-secondary);
      background: rgba(232,184,90,0.12);
      padding: 2px 8px;
      border-radius: 4px;
    }

    .battle-item {
      padding: 10px 14px;
      background: var(--input-bg);
      border-radius: 8px;
      margin-bottom: 8px;
      border-left: 4px solid var(--border);
    }

    .battle-item.battle-win {
      border-left-color: var(--success);
    }

    .battle-item.battle-lose {
      border-left-color: var(--error);
    }

    .battle-result {
      font-weight: 700;
      font-size: 0.9rem;
      min-width: 28px;
    }

    .battle-win .battle-result {
      color: var(--success);
    }

    .battle-lose .battle-result {
      color: var(--error);
    }

    .battle-info {
      flex: 1;
      min-width: 0;
    }

    .battle-info span {
      color: var(--text);
      font-weight: 600;
    }

    .battle-meta {
      font-size: 0.75rem;
      color: var(--text-secondary);
      margin-top: 2px;
    }

    /* ===== 对战记录 - 阵型布局 ===== */
    .battle-item {
      display: block;
    }

    .battle-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
      gap: 8px;
    }

    .battle-name {
      font-weight: 600;
      font-size: 0.82rem;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
    }
    .battle-name.win      { color: var(--success); }
    .battle-name.lose     { color: var(--error); }
    .battle-name.opp-win  { color: var(--error);   text-align: right; }
    .battle-name.opp-lose { color: var(--success); text-align: right; }

    .battle-teams {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      overflow: visible;
    }

    .battle-vs {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--text-secondary);
      flex-shrink: 0;
    }

    /* ===== 魔灵阵型容器 =====
       40px 图标 · 6px 间距 · 3列
       容器: 132px × 86px
    */
    .unit-formation {
      position: relative;
      width: 132px;
      height: 86px;
      flex-shrink: 0;
    }

    .unit-formation .u {
      position: absolute;
      width: 40px;
      height: 40px;
    }

    .unit-formation .u img {
      width: 40px;
      height: 40px;
      border-radius: 4px;
      object-fit: cover;
      display: block;
      background: var(--input-bg);
      border: 1px solid var(--border);
    }

    /* 禁用：红框；队长：金框 */
    .unit-formation .u.is-ban    img { outline: 2px solid var(--error);  outline-offset: 0; }
    .unit-formation .u.is-leader img { outline: 2px solid #FFD700; outline-offset: 0; }

    /*
     * Layout A — 单图标居中左 + 右侧 2×2
     *   先手「我方」 / 后手「对手」
     *
     *        1  3
     *   0
     *        2  4
     */
    .layout-a .u-0 { left:  0px; top: 23px; }
    .layout-a .u-1 { left: 46px; top:  0px; }
    .layout-a .u-2 { left: 46px; top: 46px; }
    .layout-a .u-3 { left: 92px; top:  0px; }
    .layout-a .u-4 { left: 92px; top: 46px; }

    /*
     * Layout B — 左侧 2×2 + 单图标居中右
     *   先手「对手」 / 后手「我方」
     *
     *   0  2
     *           4
     *   1  3
     */
    .layout-b .u-0 { left:  0px; top:  0px; }
    .layout-b .u-1 { left:  0px; top: 46px; }
    .layout-b .u-2 { left: 46px; top:  0px; }
    .layout-b .u-3 { left: 46px; top: 46px; }
    .layout-b .u-4 { left: 92px; top: 23px; }

    .battle-footer {
      font-size: 0.72rem;
      color: var(--text-secondary);
      margin-top: 8px;
      text-align: center;
    }

    @media (max-width: 640px) {
      .top-nav {
        gap: 6px;
        padding: 6px 8px;
      }

      .top-nav-item {
        flex: 0 0 auto;
        min-width: 92px;
        padding: 9px 12px;
        font-size: 0.82rem;
        white-space: nowrap;
      }

      .nav-scroll-hint {
        display: flex;
      }

      .rank-card { padding: 20px 14px; }
      .logo-splash img { width: min(84vw, 520px); }
    }