/* ==============================================================================
   web/css/style.css - Sky 控制台苹果质感设计系统与全局 UI 样式表
   提供高透毛玻璃卡片、侧边栏导航、响应式弹窗、暗色适配与现代化按钮组件体系
   ============================================================================== */

:root {
      --bg-body: #f5f5f7;
      --bg-card: rgba(255, 255, 255, 0.88);
      --bg-card-solid: #ffffff;
      --bg-sidebar: rgba(245, 245, 247, 0.92);
      --bg-input: #ffffff;
      --text-main: #1d1d1f;
      --text-sub: #86868b;
      --text-dim: #a1a1a6;
      --border-light: rgba(0, 0, 0, 0.08);
      --border-focus: #0071e3;
      --accent: #0071e3;
      --accent-hover: #0077ed;
      --accent-soft: rgba(0, 113, 227, 0.08);
      --success: #34c759;
      --success-soft: rgba(52, 199, 89, 0.12);
      --warning: #ff9500;
      --warning-soft: rgba(255, 149, 0, 0.12);
      --danger: #ff3b30;
      --danger-soft: rgba(255, 59, 48, 0.12);
      --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
      --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
      --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 18px;
      --radius-full: 9999px;
      --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", Roboto, sans-serif;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: var(--font-family);
      background-color: var(--bg-body);
      color: var(--text-main);
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
      line-height: 1.5;
    }

    #app-container { display: flex; min-height: 100vh; }
    
    /* Sidebar */
    .sidebar {
      width: 240px;
      flex-shrink: 0;
      background: var(--bg-sidebar);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-right: 1px solid var(--border-light);
      display: flex;
      flex-direction: column;
      height: 100vh;
      position: sticky;
      top: 0;
      padding: 24px 16px;
      z-index: 50;
    }

    .brand-box {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 4px 8px 20px;
      border-bottom: 1px solid var(--border-light);
      margin-bottom: 16px;
    }
    .brand-icon {
      width: 36px;
      height: 36px;
      border-radius: var(--radius-md);
      background: linear-gradient(135deg, var(--accent) 0%, #1e87f0 100%);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      box-shadow: 0 4px 12px var(--accent-soft);
    }
    .brand-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
    .brand-subtitle { font-size: 11px; color: var(--text-sub); }

    .nav-label {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-dim);
      padding: 8px 12px 4px;
    }
    .nav-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
    .nav-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 14px;
      border-radius: var(--radius-sm);
      color: var(--text-sub);
      font-size: 13.5px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.16s ease;
      user-select: none;
    }
    .nav-item:hover {
      background: var(--bg-card-solid);
      color: var(--text-main);
    }
    .nav-item.active {
      background: var(--bg-card-solid);
      color: var(--accent);
      font-weight: 600;
      box-shadow: var(--shadow-sm);
    }
    .nav-item i { font-size: 16px; }

    .sidebar-footer {
      margin-top: auto;
      padding-top: 16px;
      border-top: 1px solid var(--border-light);
    }
    .user-pill {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px;
      border-radius: var(--radius-md);
      background: var(--bg-card-solid);
      border: 1px solid var(--border-light);
    }
    .user-name { font-size: 13px; font-weight: 600; }
    .user-role { font-size: 11px; color: var(--text-sub); }

    /* Main Area */
    .main-view {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      height: 100vh;
      overflow-y: auto;
    }
    .navbar {
      height: 56px;
      min-height: 56px;
      max-height: 56px;
      flex-shrink: 0;
      padding: 0 28px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--bg-sidebar);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-bottom: 1px solid var(--border-light);
      position: sticky;
      top: 0;
      z-index: 40;
    }
    .navbar-title {
      font-size: 17px;
      font-weight: 700;
      letter-spacing: -0.01em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .navbar-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
      white-space: nowrap;
    }

    .points-badge {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 14px;
      background: var(--accent-soft);
      color: var(--accent);
      border-radius: var(--radius-full);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      border: 1px solid transparent;
      transition: all 0.16s ease;
    }
    .points-badge:hover { border-color: var(--accent); }

    .icon-btn {
      width: 36px;
      height: 36px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-light);
      background: var(--bg-card-solid);
      color: var(--text-sub);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 15px;
      transition: all 0.16s ease;
    }
    .icon-btn:hover { color: var(--text-main); border-color: var(--border-focus); }

    .content-area {
      padding: 28px 32px 64px;
      max-width: 1200px;
      width: 100%;
      margin: 0 auto;
    }

    /* Apple Cards */
    .card {
      background: var(--bg-card);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid var(--border-light);
      border-radius: var(--radius-lg);
      padding: 22px 24px;
      box-shadow: var(--shadow-sm);
      margin-bottom: 20px;
    }
    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 18px;
    }
    .card-title {
      font-size: 15px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 8px 18px;
      border-radius: var(--radius-full);
      font-size: 13.5px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: all 0.16s ease;
      text-decoration: none;
    }
    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:hover { background: var(--accent-hover); }
    .btn-secondary {
      background: var(--bg-card-solid);
      color: var(--text-main);
      border: 1px solid var(--border-light);
    }
    .btn-secondary:hover { background: var(--border-light); }
    .btn-danger { background: var(--danger-soft); color: var(--danger); }
    .btn-danger:hover { background: var(--danger); color: #fff; }
    .btn-sm { padding: 4px 12px; font-size: 12px; }

    /* Inputs */
    .input-group { margin-bottom: 16px; }
    .input-label {
      display: block;
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text-sub);
      margin-bottom: 6px;
    }
    .input-field {
      width: 100%;
      padding: 10px 14px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-light);
      background: var(--bg-input);
      color: var(--text-main);
      font-size: 14px;
      outline: none;
      transition: border 0.16s ease;
    }
    .input-field:focus { border-color: var(--border-focus); }

    /* New Task Layout */
    .task-split-grid {
      display: grid;
      grid-template-columns: 1.2fr 0.8fr;
      gap: 20px;
      margin-bottom: 20px;
    }
    @media (max-width: 900px) {
      .task-split-grid { grid-template-columns: 1fr; }
    }

    /* Invite (创建邀请码) Layout */
    .invite-grid {
      display: grid;
      grid-template-columns: 0.9fr 1.1fr;
      gap: 20px;
      margin-bottom: 20px;
      align-items: start;
    }
    @media (max-width: 900px) {
      .invite-grid { grid-template-columns: 1fr; }
    }

    /* 邀请码页的账号卡片：比通用 picker 更紧凑，避免列表过高 */
    .account-picker-list .invite-acc-item {
      padding: 6px 12px;
      gap: 10px;
      align-items: flex-start;
    }
    .account-picker-list .invite-acc-item input[type="checkbox"] {
      width: 15px;
      height: 15px;
      margin-top: 1px;
      flex-shrink: 0;
    }

    .account-picker-list {
      max-height: 260px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 12px;
    }
    .account-picker-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 14px;
      border: 1px solid var(--border-light);
      border-radius: var(--radius-sm);
      background: var(--bg-card-solid);
      cursor: pointer;
      transition: all 0.14s ease;
      user-select: none;
    }
    .account-picker-item:hover { border-color: var(--border-focus); }
    .account-picker-item.selected {
      border-color: var(--accent);
      background: var(--accent-soft);
    }
    .account-picker-item input[type="checkbox"] {
      accent-color: var(--accent);
      width: 16px;
      height: 16px;
    }

    .cost-summary-box {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .cost-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 13.5px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border-light);
    }
    .cost-row.total {
      border-bottom: none;
      padding-top: 4px;
      font-size: 15px;
      font-weight: 700;
      color: var(--accent);
    }

    /* 8 Official Task Features Grid */
    .official-features-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      gap: 12px;
      margin-top: 12px;
    }
    .feature-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border: 1px solid var(--border-light);
      border-radius: var(--radius-md);
      background: var(--bg-card-solid);
      cursor: pointer;
      transition: all 0.16s ease;
      user-select: none;
    }
    .feature-card:hover { border-color: var(--border-focus); }
    .feature-card.checked {
      border-color: var(--accent);
      background: var(--accent-soft);
    }
    .feature-card input[type="checkbox"] {
      accent-color: var(--accent);
      width: 18px;
      height: 18px;
    }
    .feature-title {
      font-size: 14px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .feature-cost {
      font-size: 12px;
      color: var(--text-sub);
      margin-left: auto;
      padding: 2px 8px;
      border-radius: var(--radius-full);
      background: var(--border-light);
      font-weight: 600;
    }

    /* Tables */
    .table-responsive { width: 100%; overflow-x: auto; }
    .apple-table {
      width: 100%;
      border-collapse: collapse;
      text-align: left;
      font-size: 13.5px;
    }
    .apple-table th {
      padding: 12px 14px;
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-sub);
      text-transform: uppercase;
      letter-spacing: 0.04em;
      border-bottom: 1px solid var(--border-light);
    }
    .apple-table td {
      padding: 14px;
      border-bottom: 1px solid var(--border-light);
      vertical-align: middle;
    }
    .apple-table tr:hover td { background: var(--accent-soft); }

    /* Badges */
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: var(--radius-full);
      font-size: 11.5px;
      font-weight: 600;
    }
    .badge-success { background: var(--success-soft); color: var(--success); }
    .badge-warning { background: var(--warning-soft); color: var(--warning); }
    .badge-danger { background: var(--danger-soft); color: var(--danger); }
    .badge-accent { background: var(--accent-soft); color: var(--accent); }

    /* iOS Switch */
    .switch {
      position: relative;
      display: inline-block;
      width: 44px;
      height: 24px;
    }
    .switch input { opacity: 0; width: 0; height: 0; }
    .slider {
      position: absolute;
      cursor: pointer;
      top: 0; left: 0; right: 0; bottom: 0;
      background-color: var(--border-light);
      transition: .24s;
      border-radius: 24px;
    }
    .slider:before {
      position: absolute;
      content: "";
      height: 20px;
      width: 20px;
      left: 2px;
      bottom: 2px;
      background-color: white;
      transition: .24s;
      border-radius: 50%;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    input:checked + .slider { background-color: var(--success); }
    input:checked + .slider:before { transform: translateX(20px); }

    /* Modal */
    .modal-overlay {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,0.45);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 2000;
      align-items: center;
      justify-content: center;
    }
    .modal-box {
      background: var(--bg-card-solid);
      border-radius: var(--radius-lg);
      padding: 24px;
      width: 100%;
      max-width: 540px;
      box-shadow: var(--shadow-lg);
      border: 1px solid var(--border-light);
      max-height: 90vh;
      display: flex;
      flex-direction: column;
    }
    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
      flex-shrink: 0;
    }
    .modal-body {
      flex: 1;
      overflow-y: auto;
      min-height: 0;
      -webkit-overflow-scrolling: touch;
      padding-right: 4px;
    }
    .modal-footer {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 18px;
      padding-top: 14px;
      border-top: 1px solid var(--border-light);
      flex-shrink: 0;
    }

    /* Toast - 最高层级 999999，永远浮于所有弹窗、遮罩与全屏视图之上 */
    #toast-box {
      position: fixed;
      top: 24px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      z-index: 999999 !important;
      pointer-events: none;
      max-width: 90vw;
    }
    .toast-msg {
      pointer-events: auto;
      background: var(--bg-card-solid);
      color: var(--text-main);
      padding: 12px 22px;
      border-radius: var(--radius-full);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
      border: 1px solid var(--border-light);
      display: inline-flex;
      align-items: center;
      gap: 10px;
      font-size: 14px;
      font-weight: 500;
      animation: toastSlideDown .25s cubic-bezier(0.16, 1, 0.3, 1);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      white-space: nowrap;
    }
    @keyframes toastSlideDown {
      from { opacity: 0; transform: translateY(-14px) scale(0.96); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* 人机验证样式：完全隐藏 cap.bug.im / ALTCHA 品牌与外链，支持全方框直接点击 */
    .cap-captcha {
      cursor: pointer !important;
      user-select: none;
    }
    .cap-captcha * {
      cursor: pointer !important;
    }
    .cap-captcha .cap-tag,
    .cap-captcha .altcha-footer,
    .cap-captcha .altcha-logo,
    .cap-tag,
    .altcha-footer,
    .altcha-logo {
      display: none !important;
      opacity: 0 !important;
      visibility: hidden !important;
      pointer-events: none !important;
      width: 0 !important;
      height: 0 !important;
    }
    .cap-captcha altcha-widget,
    .cap-captcha .altcha,
    .cap-captcha .altcha-main,
    .cap-captcha .altcha-main > div,
    .cap-captcha .altcha-checkbox-wrap {
      width: 100% !important;
      display: flex !important;
      align-items: center !important;
      cursor: pointer !important;
    }
    .cap-captcha label {
      flex: 1 !important;
      width: 100% !important;
      padding: 8px 0 !important;
      margin: 0 !important;
      cursor: pointer !important;
    }

    /* Login Overlay */
    #login-view {
      display: none;
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: radial-gradient(circle at 50% 30%, var(--accent-soft) 0%, var(--bg-body) 70%);
      z-index: 99;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .login-card {
      width: 100%;
      max-width: 380px;
      background: var(--bg-card);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid var(--border-light);
      border-radius: var(--radius-lg);
      padding: 36px 28px;
      box-shadow: var(--shadow-lg);
      text-align: center;
    }

    .view-panel { display: none; }
    .view-panel.active { display: block; }
    .flex-between { display: flex; align-items: center; justify-content: space-between; }

    /* =========================================================================
       Dedicated Mobile Adaptation (Apple HIG Mobile)
       ========================================================================= */
    .mobile-hamburger-btn { display: none !important; }
    .mobile-tab-bar { display: none !important; }
    .mobile-card-list { display: none !important; }
    .table-desktop { width: 100%; overflow-x: auto; }
    .sheet-drag-handle { display: none; }
    .drawer-backdrop { display: none; }
    .mobile-drawer-close-btn { display: none; }

    @media (max-width: 768px) {
      /* Prevent iOS text auto-zoom */
      html { -webkit-text-size-adjust: 100%; }
      body {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        padding-bottom: env(safe-area-inset-bottom, 0px);
      }

      /* Force 16px on inputs to prevent iOS Safari auto-zoom on focus */
      .input-field, input, select, textarea {
        font-size: 16px !important;
      }

      /* Sidebar turns into off-canvas drawer */
      .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        max-width: 84vw !important;
        height: 100vh !important;
        z-index: 1000 !important;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: none;
        border-right: 1px solid var(--border-light);
        padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 16px));
      }
      .sidebar.drawer-open {
        transform: translateX(0) !important;
        box-shadow: 12px 0 36px rgba(0, 0, 0, 0.3) !important;
      }

      .mobile-drawer-close-btn {
        display: flex !important;
        margin-left: auto;
      }

      /* Drawer Backdrop */
      .drawer-backdrop {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
      }
      .drawer-backdrop.active {
        opacity: 1;
        pointer-events: auto;
      }

      /* Navbar */
      .navbar {
        height: 54px !important;
        min-height: 54px !important;
        max-height: 54px !important;
        flex-shrink: 0 !important;
        padding: 0 14px !important;
        gap: 8px !important;
      }
      .mobile-hamburger-btn {
        display: inline-flex !important;
        flex-shrink: 0 !important;
      }
      .navbar-title {
        font-size: 16px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }
      .navbar-actions {
        gap: 8px !important;
        flex-shrink: 0 !important;
      }
      .points-badge {
        padding: 4px 10px !important;
        font-size: 12px !important;
        flex-shrink: 0 !important;
      }

      /* Content Area */
      .content-area {
        flex-shrink: 0 !important;
        padding: 14px 12px calc(80px + env(safe-area-inset-bottom, 20px)) !important;
      }
      .card {
        padding: 16px 14px !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 14px !important;
      }
      .card-header {
        margin-bottom: 14px !important;
      }

      /* Split grid */
      .task-split-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
      }

      /* 8 Official features in 2 columns on phone */
      .official-features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
      }
      .feature-card {
        padding: 10px 10px !important;
        border-radius: var(--radius-sm) !important;
        min-height: 48px !important;
      }
      .feature-title {
        font-size: 13px !important;
        gap: 5px !important;
      }
      .feature-cost {
        display: inline-block !important;
        font-size: 11px !important;
        padding: 2px 7px !important;
        border-radius: var(--radius-full) !important;
        background: var(--border-light) !important;
        color: var(--accent) !important;
        font-weight: 700 !important;
        margin-left: auto !important;
        white-space: nowrap !important;
      }

      /* Full width submit button */
      .mobile-full-btn {
        width: 100% !important;
        height: 46px !important;
        font-size: 15px !important;
        border-radius: var(--radius-md) !important;
      }

      /* Tables to Mobile Cards */
      .table-desktop {
        display: none !important;
      }
      .mobile-card-list {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
      }

      .mobile-item-card {
        background: var(--bg-card-solid);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        padding: 14px;
        box-shadow: var(--shadow-sm);
        display: flex;
        flex-direction: column;
        gap: 8px;
        transition: transform 0.12s ease;
      }
      .mobile-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      .mobile-card-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--text-main);
      }
      .mobile-card-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin: 2px 0;
      }
      .mobile-card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px solid var(--border-light);
        font-size: 12px;
        color: var(--text-sub);
      }

      /* 星愿爱心：桌面双列、移动单列 */
      .wish-love-grid {
        display: grid;
        grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.15fr);
        gap: 20px;
        align-items: start;
      }
      @media (max-width: 860px) {
        .wish-love-grid {
          grid-template-columns: 1fr !important;
          gap: 16px !important;
        }
      }

      /* iOS Bottom Tab Bar */
      .mobile-tab-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--bg-sidebar);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-top: 1px solid var(--border-light);
        z-index: 900;
        justify-content: space-around;
        align-items: center;
      }
      .mobile-tab-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 100%;
        color: var(--text-sub);
        font-size: 10px;
        font-weight: 500;
        cursor: pointer;
        user-select: none;
        transition: color 0.16s ease, transform 0.16s ease;
      }
      .mobile-tab-item i {
        font-size: 18px;
        line-height: 1;
      }
      .mobile-tab-item.active {
        color: var(--accent);
        font-weight: 600;
      }
      .mobile-tab-item:active {
        transform: scale(0.92);
      }

      /* iOS Bottom Sheet Modals */
      .modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
        z-index: 2000 !important;
      }
      .modal-box {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 14px 18px calc(24px + env(safe-area-inset-bottom, 16px)) !important;
        max-height: 85vh !important;
        border-bottom: none !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3) !important;
        animation: sheetSlideUp 0.25s cubic-bezier(0.32, 0.72, 0, 1) !important;
        display: flex !important;
        flex-direction: column !important;
      }
      .modal-body {
        flex: 1 !important;
        overflow-y: auto !important;
        min-height: 0 !important;
        max-height: calc(85vh - 130px) !important;
        -webkit-overflow-scrolling: touch !important;
      }
      .modal-footer {
        gap: 10px !important;
        margin-top: 12px !important;
        padding-top: 12px !important;
        border-top: 1px solid var(--border-light) !important;
      }
      .modal-footer .btn {
        flex: 1 !important;
        height: 44px !important;
        font-size: 15px !important;
        border-radius: var(--radius-md) !important;
      }
      .sheet-drag-handle {
        display: block !important;
        width: 38px;
        height: 5px;
        border-radius: 10px;
        background: var(--border-light);
        margin: 0 auto 12px;
      }
      @keyframes sheetSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
      }

      /* Toast on mobile - 顶部安全区胶囊样式，绝不被底部弹窗、遮罩与键盘遮挡 */
      #toast-box {
        top: calc(16px + env(safe-area-inset-top, 10px)) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: auto !important;
        right: auto !important;
        width: auto !important;
        max-width: calc(100vw - 32px) !important;
        align-items: center;
        z-index: 999999 !important;
      }
      .toast-msg {
        width: auto;
        max-width: 100%;
        padding: 10px 18px;
        font-size: 13.5px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
      }
    }
  
    /* 平台切换胶囊 */
    .platform-capsule {
      display: inline-flex;
      align-items: center;
      background: var(--bg-body);
      border: 1px solid var(--border-light);
      border-radius: 999px;
      padding: 2px;
      gap: 2px;
      user-select: none;
    }
    .platform-capsule .cap-item {
      padding: 2px 10px;
      font-size: 11.5px;
      font-weight: 500;
      border-radius: 999px;
      cursor: pointer;
      color: var(--text-sub);
      transition: all 0.2s ease;
      white-space: nowrap;
    }
    /* 每端独立天数输入（嵌在端胶囊内） */
    .acc-day-input {
      width: 42px;
      padding: 1px 4px;
      font-size: 11.5px;
      font-weight: 600;
      text-align: center;
      border: 1px solid var(--border-light);
      border-radius: 6px;
      background: var(--bg-card-solid);
      color: var(--text-main);
      outline: none;
      -moz-appearance: textfield;
    }
    .acc-day-input::-webkit-outer-spin-button,
    .acc-day-input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    .acc-day-input:focus {
      border-color: var(--accent);
    }
    .acc-day-unit {
      font-size: 11px;
      color: var(--text-sub);
      padding-right: 4px;
    }

    .platform-capsule .cap-item.active {
      background: var(--accent);
      color: #fff;
      font-weight: 600;
      box-shadow: 0 1px 4px rgba(0, 113, 227, 0.25);
    }
    .platform-capsule .cap-item:hover:not(.active) {
      color: var(--text-main);
      background: rgba(0,0,0,0.05);
    }

    /* 充值模块样式 */
    .recharge-tier-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
      gap: 10px;
    }
    .recharge-tier-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      padding: 12px 8px;
      background: var(--bg-card);
      border: 1.5px solid var(--border-light);
      border-radius: var(--radius-md);
      cursor: pointer;
      transition: all .16s ease;
      font-family: inherit;
    }
    .recharge-tier-btn:hover {
      border-color: var(--accent);
      background: var(--bg-card-solid);
    }
    .recharge-tier-btn.active {
      border-color: var(--accent);
      background: var(--accent-soft);
      box-shadow: 0 0 0 1px var(--accent);
    }
    .recharge-tier-btn .tier-money {
      font-size: 15px;
      font-weight: 700;
      color: var(--text-main);
    }
    .recharge-tier-btn.active .tier-money {
      color: var(--accent);
    }
    .recharge-tier-btn .tier-points {
      font-size: 11.5px;
      color: var(--text-sub);
    }
    .recharge-tier-btn.active .tier-points {
      color: var(--accent);
      font-weight: 600;
    }

    .pay-method-card {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 18px;
      background: var(--bg-card);
      border: 1.5px solid var(--border-light);
      border-radius: var(--radius-md);
      cursor: pointer;
      transition: all .16s ease;
      user-select: none;
    }
    .pay-method-card:hover {
      border-color: var(--accent);
    }
    .pay-method-card.active {
      border-color: var(--accent);
      background: var(--accent-soft);
      box-shadow: 0 0 0 1px var(--accent);
    }
