    /* ── 字体 ── */
    @font-face {
      font-family: 'XiaoWuZK';
      src: url('https://chinese-font.netlify.app/packages/lxgwwenkai/dist/LXGWWenKai-Regular/result.woff2') format('woff2');
      font-weight: normal;
      font-style: normal;
      font-display: swap;
    }

    /* ── 基础重置 ── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --orange:      #E8570B;
      --orange-mid:  #F27120;
      --orange-light:#FFF3E8;
      --orange-pale: #FFF9F4;
      --green:       #3DAA5B;
      --dark:        #1A1208;
      --text:        #3D2B10;
      --muted:       #8C7355;
      --border:      #EFE3D5;
      --white:       #FFFFFF;
      --shadow-sm:   0 2px 8px rgba(232,87,11,.10);
      --shadow-md:   0 4px 20px rgba(232,87,11,.15);
      --shadow-lg:   0 8px 40px rgba(232,87,11,.18);
      --radius-sm:   10px;
      --radius-md:   16px;
      --radius-lg:   24px;
      --font: 'XiaoWuZK', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    }

    /* 深色模式变量 */
    :root[data-theme="dark"] {
      --bg-main:     #1A1208;
      --bg-card:     #2D1F0E;
      --bg-input:     #3B2A14;
      --bg-pale:     #2D1F0E;
      --bg-light:    #3B2A14;
      --text:        #F5E6D0;
      --text-dark:   #FFF8F0;
      --muted:       #B89E7A;
      --border:      #5A3F1E;
      --orange-light:#3D2A14;
      --orange-pale: #2D1F0E;
    }

    :root:not([data-theme="dark"]) {
      --bg-main:     #FDF5EE;
      --bg-card:     #FFFFFF;
      --bg-input:    #FFF9F4;
      --bg-pale:     #FFF9F4;
      --bg-light:    #FFF3E8;
    }

    html { font-size: 16px; }

    body {
      font-family: var(--font);
      background: var(--bg-main);
      color: var(--text);
      min-height: 100vh;
      padding-bottom: 100px;
    }

    .page-container {
      max-width: 640px;
      margin: 0 auto;
      padding: 0;
    }
    /* 全屏弹窗/面板不受页面宽度限制 */
    .wage-overlay, .wage-panel, .coach-pwd-overlay,
    .student-panel, .student-panel-overlay,
    .pay-overlay, .history-overlay,
    .student-dropdown,
    .pwd-overlay, .coach-pwd-modal, .pwd-modal, .pay-modal {
      max-width: none !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
    }
    body > *:not(.page-container) {
      max-width: 640px;
      margin-left: auto;
      margin-right: auto;
    }

    /* ══════════════════════════════
       Header
    ══════════════════════════════ */
    .site-header {
      background: linear-gradient(135deg, #1A1208 0%, #3B1F05 60%, #5C2E06 100%);
      padding: 10px 16px 10px;
      text-align: center;
      position: relative;
      overflow: hidden;
    }
    .site-header::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(242,113,32,.25) 0%, transparent 70%);
      pointer-events: none;
    }
    .header-inner {
      position: relative;
      z-index: 1;
      max-width: 640px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
    }
    .brand-logo {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      border: 3px solid rgba(255,255,255,.15);
      object-fit: contain;
      background: #fff;
      box-shadow: 0 4px 16px rgba(0,0,0,.35);
    }
    .brand-name {
      font-size: 1.4rem;
      font-weight: 700;
      color: #fff;
      letter-spacing: .08em;
      text-shadow: 0 2px 8px rgba(0,0,0,.4);
    }
    .brand-en {
      font-size: .7rem;
      color: rgba(255,255,255,.55);
      letter-spacing: .18em;
      text-transform: uppercase;
    }
    .brand-tagline {
      font-size: .8rem;
      color: rgba(255,255,255,.7);
      background: rgba(255,255,255,.08);
      border: 1px solid rgba(255,255,255,.12);
      border-radius: 20px;
      padding: 6px 16px;
      margin-top: 4px;
    }
    .brand-tagline em {
      color: #FFB347;
      font-style: normal;
      font-weight: 600;
    }

    /* ══════════════════════════════
       工具栏（深色模式+历史+教练）
    ══════════════════════════════ */
    .toolbar {
      padding: 6px 12px;
      display: grid;
      grid-template-columns: 34px repeat(5, minmax(0, 1fr));
      gap: 6px;
      align-items: center;
      overflow: visible;
    }
    .tool-btn {
      width: 100%;
      padding: 5px 10px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-card);
      color: var(--text);
      font-family: var(--font);
      font-size: .78rem;
      font-weight: 600;
      cursor: pointer;
      transition: all .18s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      box-shadow: var(--shadow-sm);
      white-space: nowrap;
      min-height: 34px;
      text-align: center;
    }
    .tool-btn:hover { background: var(--orange-light); border-color: var(--orange); color: var(--orange); }
    .tool-btn.active { background: var(--orange); border-color: var(--orange); color: #fff; }
    .tool-btn svg { flex-shrink: 0; }
    /* 套餐购买按钮特殊高亮 */
    .tool-btn-pkg {
      background: linear-gradient(135deg, #FF6B35, #FF8F5E);
      border-color: #FF6B35;
      color: #fff;
      text-decoration: none;
    }
    .tool-btn-pkg:hover {
      background: linear-gradient(135deg, #E85A20, #FF7A45);
      border-color: #E85A20;
      color: #fff;
      transform: translateY(-1px);
      box-shadow: 0 3px 12px rgba(255,107,53,.35);
    }
    /* 教练工资按钮 */
    .tool-btn-wage {
      background: linear-gradient(135deg, #1A7A3A, #22C55E);
      border-color: #16A34A;
      color: #fff;
    }
    .tool-btn-wage:hover {
      background: linear-gradient(135deg, #15692F, #1DA851);
      border-color: #15692F;
      color: #fff;
      transform: translateY(-1px);
      box-shadow: 0 3px 12px rgba(22,163,74,.35);
    }
    .tool-btn-dashboard {
      background: linear-gradient(135deg, #0F766E, #14B8A6);
      border-color: #0F766E;
      color: #fff;
    }
    .tool-btn-dashboard:hover {
      background: linear-gradient(135deg, #0B5F59, #0F9F93);
      border-color: #0B5F59;
      color: #fff;
      transform: translateY(-1px);
      box-shadow: 0 3px 12px rgba(20,184,166,.35);
    }

    /* ══════════════════════════════
       教练工资面板
    ══════════════════════════════ */
    .wage-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.6);
      z-index: 1500;
      backdrop-filter: blur(4px);
    }
    .wage-overlay.show { display: block; }
    .wage-panel {
      display: flex;
      position: fixed;
      top: 0;
      right: 0;
      width: min(600px, 100vw);
      height: 100vh;
      background: var(--bg-main);
      box-shadow: -6px 0 40px rgba(0,0,0,.25);
      z-index: 1501;
      flex-direction: column;
      transform: translateX(100%);
      transition: transform .32s cubic-bezier(.4,0,.2,1), visibility 0s .32s;
      visibility: hidden;
      overflow: hidden;
    }
    .wage-panel.open { transform: translateX(0); visibility: visible; transition: transform .32s cubic-bezier(.4,0,.2,1), visibility 0s 0s; }
    .wage-panel-header {
      padding: 16px 20px;
      background: linear-gradient(135deg, #0F3D1F 0%, #1A7A3A 60%, #22C55E 100%);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-shrink: 0;
      position: relative;
      overflow: hidden;
    }
    .wage-panel-header::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,.12) 0%, transparent 70%);
      pointer-events: none;
    }
    .wage-header-left { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
    .wage-header-icon {
      width: 38px; height: 38px;
      border-radius: 10px;
      background: rgba(255,255,255,.2);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .wage-header-title { color: #fff; }
    .wage-header-title h3 { font-size: 1.1rem; font-weight: 700; }
    .wage-header-title p { font-size: .72rem; color: rgba(255,255,255,.7); margin-top: 1px; }
    .wage-close {
      background: rgba(255,255,255,.15);
      border: none;
      border-radius: 8px;
      color: #fff;
      width: 32px; height: 32px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
      transition: background .18s;
      position: relative;
      z-index: 1;
    }
    .wage-close:hover { background: rgba(255,255,255,.25); }
    .wage-body {
      flex: 1;
      overflow-y: auto;
      padding: 0;
    }
    /* 工资结算Tab */
    .wage-tabs {
      display: flex;
      background: var(--bg-card);
      border-bottom: 2px solid var(--border);
      padding: 0 16px;
      gap: 0;
      flex-shrink: 0;
    }
    .wage-tab-btn {
      padding: 12px 18px;
      border: none;
      background: transparent;
      font-family: var(--font);
      font-size: .9rem;
      font-weight: 700;
      cursor: pointer;
      color: var(--muted);
      position: relative;
      transition: color .2s;
      white-space: nowrap;
    }
    .wage-tab-btn.active {
      color: #16A34A;
    }
    .wage-tab-btn.active::after {
      content: '';
      position: absolute;
      bottom: -2px;
      left: 0;
      right: 0;
      height: 2px;
      background: #16A34A;
      border-radius: 1px;
    }
    .wage-tab-content { display: none; padding: 16px; }
    .wage-tab-content.active { display: block; }

    /* 工资计算表单 */
    .wage-card {
      background: var(--bg-card);
      border-radius: var(--radius-md);
      padding: 14px;
      margin-bottom: 12px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
    }
    .wage-card-head {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 12px;
    }
    .wage-card-icon {
      width: 28px; height: 28px;
      border-radius: 6px;
      background: linear-gradient(135deg, #16A34A, #22C55E);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .wage-card-icon svg { color: #fff; }
    .wage-card-title {
      font-size: .95rem;
      font-weight: 700;
      color: var(--dark);
    }
    :root[data-theme="dark"] .wage-card-title { color: var(--text-dark); }
    .wage-rate-tip {
      font-size: .8rem;
      color: #16A34A;
      background: rgba(22,163,74,.08);
      border: 1px solid rgba(22,163,74,.2);
      border-radius: 8px;
      padding: 8px 12px;
      margin-bottom: 12px;
      line-height: 1.6;
    }
    .wage-service-type-group {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }
    .wage-stype-btn {
      padding: 8px 14px;
      border: 1.5px solid var(--border);
      border-radius: 8px;
      background: var(--bg-pale);
      color: var(--muted);
      font-family: var(--font);
      font-size: .85rem;
      font-weight: 600;
      cursor: pointer;
      transition: all .18s;
    }
    .wage-stype-btn.active {
      background: rgba(22,163,74,.1);
      border-color: #16A34A;
      color: #16A34A;
    }
    /* 服务类型分类 */
    .wage-type-category {
      margin-bottom: 14px;
    }
    .wage-type-cat-title {
      font-size: .82rem;
      font-weight: 700;
      color: var(--muted);
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .wage-type-cat-title::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }
    .wage-type-cat-title .cat-icon {
      font-size: 1rem;
    }
    .wage-type-sub {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
    .wage-stype-btn {
      padding: 8px 14px;
      font-size: .82rem;
      min-width: 0;
      text-align: center;
      flex-shrink: 0;
    }
    .wage-stype-btn .stype-price {
      display: block;
      font-size: .7rem;
      font-weight: 400;
      opacity: .7;
      margin-top: 1px;
    }
    .wage-stype-btn .stype-sub {
      display: block;
      font-size: .68rem;
      font-weight: 400;
      opacity: .6;
      margin-top: 1px;
    }
    .wage-gen-btn {
      width: 100%;
      padding: 14px;
      border: none;
      border-radius: var(--radius-md);
      background: linear-gradient(135deg, #16A34A, #22C55E);
      color: #fff;
      font-family: var(--font);
      font-size: 1rem;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(22,163,74,.35);
      transition: transform .14s, box-shadow .14s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-top: 14px;
    }
    .wage-gen-btn:active { transform: scale(.98); }

    /* 工资结果展示 */
    .wage-result { display: none; margin-top: 12px; touch-action: pan-y; }
    .wage-result.show { display: block; pointer-events: auto; }
    .wage-total-banner {
      background: linear-gradient(135deg, #0F3D1F, #1A7A3A);
      border-radius: var(--radius-md);
      padding: 16px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
      box-shadow: var(--shadow-md);
      position: relative;
      overflow: hidden;
    }
    .wage-total-banner::after {
      content: '';
      position: absolute;
      right: -20px; top: -20px;
      width: 100px; height: 100px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(34,197,94,.25) 0%, transparent 70%);
    }
    .wage-total-label { font-size: .9rem; color: rgba(255,255,255,.7); font-weight: 600; }
    .wage-total-sub { font-size: .75rem; color: rgba(255,255,255,.45); margin-top: 2px; }
    .wage-total-amount {
      font-size: 2.4rem;
      font-weight: 800;
      color: #86EFAC;
      text-shadow: 0 2px 8px rgba(0,0,0,.3);
      position: relative; z-index: 1;
    }
    .wage-total-amount span { font-size: 1.1rem; font-weight: 600; margin-left: 2px; color: rgba(134,239,172,.7); }

    /* 工资明细卡片 */
    .wage-receipt-card {
      background: var(--bg-card);
      border-radius: var(--radius-md);
      overflow: hidden;
      box-shadow: var(--shadow-sm);
      border: 1px solid rgba(22,163,74,.2);
      margin-bottom: 12px;
    }
    .wage-receipt-header {
      background: linear-gradient(135deg, #16A34A, #22C55E);
      padding: 12px 16px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .wage-receipt-logo {
      width: 40px; height: 40px;
      border-radius: 50%;
      border: 2px solid rgba(255,255,255,.6);
      background: #fff;
      object-fit: contain;
      flex-shrink: 0;
    }
    .wage-receipt-brand { color: #fff; }
    .wage-receipt-brand-name { font-size: 1rem; font-weight: 700; letter-spacing: .04em; }
    .wage-receipt-brand-sub { font-size: .7rem; color: rgba(255,255,255,.7); margin-top: 1px; }
    .wage-receipt-body { padding: 16px; }
    .wage-receipt-meta {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding-bottom: 10px;
      border-bottom: 1px dashed var(--border);
      margin-bottom: 12px;
      flex-wrap: wrap;
      gap: 8px;
    }
    .wage-receipt-meta-item { display: flex; flex-direction: column; gap: 2px; }
    .wage-receipt-meta-label { font-size: .7rem; color: var(--muted); }
    .wage-receipt-meta-value { font-size: .88rem; font-weight: 600; color: var(--dark); }
    :root[data-theme="dark"] .wage-receipt-meta-value { color: var(--text-dark); }
    .wage-receipt-section { margin-bottom: 10px; position: relative; transition: opacity .25s; }
    .wage-receipt-section.hidden-section { opacity: .35; }
    .wage-receipt-section.hidden-section .wage-receipt-line { display: none; }
    .wage-receipt-section-title {
      font-size: .88rem; font-weight: 700; color: #16A34A; margin-bottom: 5px;
      display: flex; align-items: center; gap: 6px;
    }
    .wage-receipt-section-title .toggle-eye {
      margin-left: auto; background: none; border: none; cursor: pointer;
      color: var(--muted); padding: 2px 4px; border-radius: 4px; font-size: .72rem;
      flex-shrink: 0; line-height: 1; opacity: 0; transition: opacity .2s;
    }
    .wage-receipt-section:hover .toggle-eye,
    .wage-receipt-section.hidden-section .toggle-eye { opacity: 1; }
    .wage-receipt-section-title .toggle-eye:hover { color: #16A34A; background: var(--bg); }
    .wage-receipt-line { padding: 3px 0; font-size: .85rem; color: var(--text); line-height: 1.5; overflow: hidden; }
    .wage-receipt-line::after { content: ''; display: table; clear: both; }
    .wage-receipt-divider { border: none; border-top: 1px dashed var(--border); margin: 8px 0; }
    .wage-receipt-footer {
      padding: 10px 16px;
      border-top: 1px solid var(--border);
      background: rgba(22,163,74,.04);
      display: flex;
      justify-content: center;
      gap: 6px;
      align-items: center;
      font-size: .72rem;
      color: var(--muted);
    }
    .wage-action-row {
      display: flex;
      gap: 10px;
      margin-bottom: 6px;
    }
    .wage-action-btn {
      flex: 1;
      padding: 11px 8px;
      border: 1.5px solid;
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: .88rem;
      font-weight: 600;
      cursor: pointer;
      transition: all .18s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .wage-btn-copy {
      background: var(--bg-card);
      border-color: #16A34A;
      color: #16A34A;
    }
    .wage-btn-copy:hover { background: rgba(22,163,74,.06); }
    .wage-btn-copy.copied { background: #DCFCE7; border-color: #16A34A; color: #16A34A; }
    .wage-btn-screenshot {
      background: linear-gradient(135deg, #16A34A, #22C55E);
      border-color: transparent;
      color: #fff;
      box-shadow: 0 2px 8px rgba(22,163,74,.25);
    }

    /* 工资历史列表 */
    .wage-history-list { padding: 4px 0; }
    .wage-hist-item {
      background: var(--bg-pale);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 12px;
      margin-bottom: 8px;
      transition: all .18s;
    }
    .wage-hist-item:hover { border-color: #16A34A; }
    .wage-hist-item-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 4px;
    }
    .wage-hist-badge {
      font-size: .72rem;
      font-weight: 700;
      padding: 3px 8px;
      border-radius: 4px;
      background: rgba(22,163,74,.1);
      color: #16A34A;
    }
    .wage-hist-date { font-size: .72rem; color: var(--muted); }
    .wage-hist-name { font-size: .9rem; font-weight: 600; color: var(--dark); margin-bottom: 3px; }
    :root[data-theme="dark"] .wage-hist-name { color: var(--text-dark); }
    .wage-hist-amount { font-size: 1.15rem; font-weight: 800; color: #16A34A; }
    .wage-hist-actions { display: flex; gap: 6px; margin-top: 8px; }
    .wage-hist-action {
      flex: 1;
      padding: 5px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-card);
      font-size: .75rem;
      font-family: var(--font);
      cursor: pointer;
      color: var(--muted);
      transition: all .18s;
      display: flex; align-items: center; justify-content: center; gap: 4px;
    }
    .wage-hist-action:hover { border-color: #16A34A; color: #16A34A; }
    .wage-hist-action.delete:hover { border-color: #ef4444; color: #ef4444; }
    .wage-hist-empty {
      text-align: center;
      padding: 40px 20px;
      color: var(--muted);
    }
    .wage-hist-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
    .wage-hist-clear-btn {
      width: 100%;
      padding: 10px;
      border: 1.5px solid #ef4444;
      border-radius: var(--radius-sm);
      background: transparent;
      color: #ef4444;
      font-family: var(--font);
      font-size: .88rem;
      font-weight: 600;
      cursor: pointer;
      transition: all .18s;
    }
    .wage-hist-clear-btn:hover { background: #fef2f2; }

    /* 密码验证弹窗 - 教练专用绿色主题 */
    .coach-pwd-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.6);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 99999;
      padding: 20px;
    }
    .coach-pwd-overlay.show { display: flex; }
    .coach-pwd-modal {
      background: var(--bg-card);
      border-radius: var(--radius-lg);
      width: 100%;
      max-width: 340px;
      box-shadow: var(--shadow-lg);
      overflow: hidden;
      animation: pwdSlideIn .25s ease-out;
    }
    .coach-pwd-modal-header {
      background: linear-gradient(135deg, #16A34A, #22C55E);
      padding: 18px 20px;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .coach-pwd-modal-header svg { flex-shrink: 0; }
    .coach-pwd-modal-header h3 { font-size: 1.05rem; font-weight: 700; }
    .coach-pwd-modal-body { padding: 24px 20px; text-align: center; }
    .coach-pwd-modal-body p { font-size: .88rem; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
    .coach-pwd-input { border-color: var(--border) !important; }
    .coach-pwd-input:focus { border-color: #16A34A !important; box-shadow: 0 0 0 3px rgba(22,163,74,.12) !important; }
    .coach-pwd-btn-ok {
      background: linear-gradient(135deg, #16A34A, #22C55E) !important;
      box-shadow: 0 2px 8px rgba(22,163,74,.3) !important;
    }
    .coach-pwd-btn-ok:hover { box-shadow: 0 4px 16px rgba(22,163,74,.4) !important; transform: translateY(-1px) !important; }
    @media (max-width: 480px) {
      .toolbar {
        grid-template-columns: 34px repeat(5, minmax(0, 1fr));
        gap: 4px;
        padding: 6px max(6px, env(safe-area-inset-left)) 6px max(6px, env(safe-area-inset-right));
      }
      .tool-btn {
        min-width: 0;
        width: 100%;
        height: 34px;
        padding: 0 3px;
        font-size: .66rem;
        gap: 2px;
        border-radius: 8px;
        box-shadow: none;
      }
      .tool-btn svg { width: 13px; height: 13px; }
    }

    /* ══════════════════════════════
       Tab bar
    ══════════════════════════════ */
    .tab-wrap {
      padding: 0 12px;
    }
    .tab-bar {
      display: flex;
      gap: 6px;
      margin-top: -1px;
      padding: 6px 0 0;
    }
    .tab-btn {
      flex: 1;
      padding: 8px 6px;
      border: 2px solid transparent;
      border-radius: var(--radius-md);
      font-family: var(--font);
      font-size: .85rem;
      font-weight: 700;
      cursor: pointer;
      transition: all .22s;
      background: var(--bg-card);
      color: var(--muted);
      box-shadow: var(--shadow-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }
    .tab-btn svg { flex-shrink: 0; }
    .tab-btn.active {
      background: linear-gradient(135deg, var(--orange), var(--orange-mid));
      color: #fff;
      border-color: transparent;
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
    }
    @media (max-width: 480px) {
      .tab-wrap { padding: 0 10px; }
      .tab-btn { padding: 8px 4px; font-size: .78rem; gap: 3px; }
      .tab-btn svg { width: 16px; height: 16px; }
    }

    /* ══════════════════════════════
       Main content
    ══════════════════════════════ */
    .main {
      padding: 0 12px;
    }

    /* ══════════════════════════════
       Card
    ══════════════════════════════ */
    .card {
      background: var(--bg-card);
      border-radius: var(--radius-md);
      padding: 16px 14px;
      margin-top: 10px;
      box-shadow: var(--shadow-sm);
      border: 1px solid rgba(239,227,213,.6);
    }
    :root[data-theme="dark"] .card { border-color: var(--border); }
    .card-head {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }
    @media (max-width: 480px) {
      .card { padding: 12px 10px; margin-top: 8px; }
      .card-head { margin-bottom: 10px; gap: 6px; }
      .card-icon { width: 26px; height: 26px; }
      .card-title { font-size: .9rem; }
    }
    .card-icon {
      width: 30px; height: 30px;
      border-radius: 7px;
      background: linear-gradient(135deg, var(--orange), var(--orange-mid));
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 2px 6px rgba(232,87,11,.25);
    }
    .card-icon svg { color: #fff; }
    .card-title {
      font-size: 1rem;
      font-weight: 700;
      color: var(--dark);
      word-break: break-word;
      max-width: calc(100% - 36px);
    }
    :root[data-theme="dark"] .card-title { color: var(--text-dark); }
    .rate-badge {
      font-size: .95rem;
      color: var(--orange);
      background: var(--orange-light);
      border: 1px solid rgba(232,87,11,.25);
      border-radius: 8px;
      padding: 8px 12px;
      margin-bottom: 14px;
      display: inline-flex;
      flex-direction: row;
      align-items: center;
      gap: 8px;
      font-weight: 600;
      line-height: 1.6;
      flex-wrap: wrap;
    }
    @media (max-width: 480px) {
      .rate-badge { font-size: .82rem; padding: 6px 10px; gap: 6px; margin-bottom: 10px; }
    }

    /* ── Form rows ── */
    .form-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
      flex-wrap: wrap;
    }
    .form-label {
      flex: 0 0 80px;
      font-size: .8rem;
      color: var(--text);
      min-width: 70px;
    }
    .input-wrap {
      flex: 1;
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 0;
    }
    input[type="number"],
    input[type="text"] {
      flex: 1;
      padding: 7px 8px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: .9rem;
      background: var(--bg-input);
      color: var(--text-dark);
      transition: border-color .2s, box-shadow .2s;
      min-width: 50px;
    }
    input[type="number"]:focus,
    input[type="text"]:focus {
      outline: none;
      border-color: var(--orange);
      background: var(--bg-card);
      box-shadow: 0 0 0 3px rgba(232,87,11,.12);
    }
    .unit {
      font-size: .75rem;
      color: var(--muted);
      white-space: nowrap;
      flex-shrink: 0;
      min-width: 50px;
      text-align: right;
    }

    @media (max-width: 480px) {
      .form-label { font-size: .85rem; }
    }

    /* ── Radio group ── */
    .radio-group {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .radio-label {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 10px 18px;
      border: 2px solid var(--border);
      border-radius: 10px;
      cursor: pointer;
      font-size: 1rem;
      font-weight: 600;
      color: var(--text);
      transition: all .18s;
      background: var(--bg-pale);
      user-select: none;
    }
    /* 折扣区域优化 - 移动端 */
    .radio-group[id$="-discount-type-group"] {
      gap: 6px;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .radio-group[id$="-discount-type-group"]::-webkit-scrollbar { display: none; }
    .radio-group[id$="-discount-type-group"] .radio-label {
      padding: 8px 12px;
      font-size: .9rem;
      flex: 1 1 auto;
      white-space: nowrap;
      justify-content: center;
    }
    .radio-label input[type="radio"] { display: none; }
    .radio-label.checked {
      background: var(--orange-light);
      border-color: var(--orange);
      color: var(--orange);
      font-weight: 700;
    }
    /* 服务类型标签放大 */
    .service-label {
      font-size: 1rem;
      font-weight: 600;
      color: var(--dark);
      padding: 4px 0;
    }

    /* ── 折扣区域 ── */
    .discount-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed var(--border);
    }
    .discount-tag {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
    .discount-chip {
      padding: 5px 12px;
      border: 1.5px solid var(--border);
      border-radius: 20px;
      font-size: .82rem;
      font-family: var(--font);
      font-weight: 600;
      cursor: pointer;
      transition: all .18s;
      background: var(--bg-pale);
      color: var(--muted);
    }
    .discount-chip:hover { border-color: var(--orange); color: var(--orange); }
    .discount-chip.checked { background: var(--orange); border-color: var(--orange); color: #fff; }
    .discount-chip input { display: none; }

    /* ══════════════════════════════
       Generate button
    ══════════════════════════════ */
    .gen-btn {
      width: 100%;
      margin-top: 18px;
      padding: 15px;
      border: none;
      border-radius: var(--radius-md);
      background: linear-gradient(135deg, var(--orange) 0%, #F27120 50%, #F5912A 100%);
      color: #fff;
      font-family: var(--font);
      font-size: 1.08rem;
      font-weight: 700;
      letter-spacing: .05em;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(232,87,11,.35);
      transition: transform .14s, box-shadow .14s, opacity .14s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .gen-btn:active { transform: scale(.98); opacity: .9; }
    .gen-btn svg { flex-shrink: 0; }

    /* ══════════════════════════════
       Result section
    ══════════════════════════════ */
    .result-section { display: none; margin-top: 10px; }
    .result-section.show { display: block; }

    /* 总计横幅 */
    .total-banner {
      background: linear-gradient(135deg, #1A1208, #3B1F05);
      border-radius: var(--radius-md);
      padding: 18px 22px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
      box-shadow: var(--shadow-md);
      position: relative;
      overflow: hidden;
    }
    .total-banner::after {
      content: '';
      position: absolute;
      right: -20px; top: -20px;
      width: 100px; height: 100px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(242,113,32,.25) 0%, transparent 70%);
    }
    .total-label {
      font-size: .95rem;
      color: rgba(255,255,255,.7);
      font-weight: 600;
    }
    .total-student {
      font-size: .78rem;
      color: rgba(255,255,255,.45);
      margin-top: 2px;
    }
    .total-amount {
      font-size: 2rem;
      font-weight: 800;
      color: #FFB347;
      text-shadow: 0 2px 8px rgba(0,0,0,.3);
      position: relative;
      z-index: 1;
    }
    .total-amount span {
      font-size: 1rem;
      font-weight: 600;
      margin-left: 2px;
      color: rgba(255,179,71,.7);
    }

    /* 明细截图区 */
    .receipt-card {
      background: var(--bg-card);
      border-radius: var(--radius-md);
      overflow: hidden;
      box-shadow: var(--shadow-sm);
      border: 1px solid rgba(239,227,213,.8);
      margin-bottom: 12px;
    }
    .receipt-header {
      background: linear-gradient(135deg, var(--orange), var(--orange-mid));
      padding: 12px 16px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .receipt-logo {
      width: 44px; height: 44px;
      border-radius: 50%;
      border: 2px solid rgba(255,255,255,.6);
      background: #fff;
      object-fit: contain;
      flex-shrink: 0;
    }
    .receipt-brand { color: #fff; }
    .receipt-brand-name {
      font-size: 1.1rem;
      font-weight: 700;
      letter-spacing: .06em;
    }
    .receipt-brand-sub {
      font-size: .72rem;
      color: rgba(255,255,255,.7);
      margin-top: 1px;
    }
    .receipt-body { padding: 18px 20px; }
    .receipt-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 12px;
      border-bottom: 1px dashed var(--border);
      margin-bottom: 14px;
    }
    .receipt-meta-item {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .receipt-meta-label {
      font-size: .72rem;
      color: var(--muted);
    }
    .receipt-meta-value {
      font-size: .92rem;
      font-weight: 600;
      color: var(--dark);
    }
    :root[data-theme="dark"] .receipt-meta-value { color: var(--text-dark); }

    /* 明细行 */
    .receipt-section { margin-bottom: 12px; position: relative; transition: opacity .25s; }
    .receipt-section.hidden-section { opacity: .35; }
    .receipt-section.hidden-section .receipt-line { display: none; }
    .receipt-section-title {
      font-size: .9rem;
      font-weight: 700;
      color: var(--orange);
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .receipt-section-title .toggle-eye {
      margin-left: auto;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--muted);
      padding: 2px 4px;
      border-radius: 4px;
      font-size: .72rem;
      flex-shrink: 0;
      line-height: 1;
      opacity: 0;
      transition: opacity .2s;
    }
    .receipt-section:hover .toggle-eye,
    .receipt-section.hidden-section .toggle-eye { opacity: 1; }
    .receipt-section-title .toggle-eye:hover { color: var(--orange); background: var(--bg); }
    .receipt-line {
      padding: 3px 0;
      font-size: .88rem;
      color: var(--text);
      line-height: 1.5;
    }
    .receipt-divider { border: none; border-top: 1px dashed var(--border); margin: 10px 0; }

    .receipt-footer {
      padding: 12px 20px;
      border-top: 1px solid var(--border);
      background: var(--orange-pale);
      display: flex;
      justify-content: center;
      gap: 6px;
      align-items: center;
      font-size: .75rem;
      color: var(--muted);
    }

    .receipt-card.highlight-for-shot {
      outline: 3px solid var(--orange);
      outline-offset: 3px;
      box-shadow: 0 0 0 6px rgba(232,87,11,.15), var(--shadow-lg);
    }
    .action-row {
      display: flex;
      gap: 10px;
      margin-bottom: 6px;
    }
    .action-btn {
      flex: 1;
      padding: 12px 8px;
      border: 1.5px solid;
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: .9rem;
      font-weight: 600;
      cursor: pointer;
      transition: all .18s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .btn-copy {
      background: var(--bg-card);
      border-color: var(--orange);
      color: var(--orange);
    }
    .btn-copy:hover { background: var(--orange-light); }
    .btn-copy.copied { background: #DCFCE7; border-color: #16A34A; color: #16A34A; }
    .btn-screenshot {
      background: linear-gradient(135deg, var(--orange), var(--orange-mid));
      border-color: transparent;
      color: #fff;
      box-shadow: 0 2px 8px rgba(232,87,11,.25);
    }

    /* ══════════════════════════════
       历史记录面板
    ══════════════════════════════ */
    .history-panel {
      display: none;
      position: fixed;
      top: 0; right: 0;
      width: min(420px, 95vw);
      height: 100vh;
      background: var(--bg-card);
      box-shadow: -4px 0 30px rgba(0,0,0,.2);
      z-index: 1000;
      flex-direction: column;
      transform: translateX(100%);
      transition: transform .3s cubic-bezier(.4,0,.2,1);
    }
    .history-panel.open { display: flex; transform: translateX(0); }
    .history-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.4);
      z-index: 999;
    }
    .history-overlay.show { display: block; }
    .history-header {
      padding: 20px;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: linear-gradient(135deg, #1A1208, #3B1F05);
    }
    .history-header h3 { color: #fff; font-size: 1.1rem; }
    .history-close {
      background: rgba(255,255,255,.1);
      border: none;
      border-radius: 8px;
      color: #fff;
      width: 32px; height: 32px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
      transition: background .18s;
    }
    .history-close:hover { background: rgba(255,255,255,.2); }
    .history-body {
      flex: 1;
      overflow-y: auto;
      padding: 12px;
    }
    .history-empty {
      text-align: center;
      padding: 40px 20px;
      color: var(--muted);
    }
    .history-empty svg { margin-bottom: 12px; opacity: .5; }
    .history-item {
      background: var(--bg-pale);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 14px;
      margin-bottom: 10px;
      cursor: pointer;
      transition: all .18s;
    }
    .history-item:hover { border-color: var(--orange); box-shadow: var(--shadow-sm); }
    .history-item-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
    }
    .history-item-mode {
      font-size: .75rem;
      font-weight: 700;
      padding: 3px 8px;
      border-radius: 4px;
      background: var(--orange-light);
      color: var(--orange);
    }
    .history-item-date {
      font-size: .75rem;
      color: var(--muted);
    }
    .history-item-name {
      font-size: .92rem;
      font-weight: 600;
      color: var(--dark);
      margin-bottom: 4px;
    }
    :root[data-theme="dark"] .history-item-name { color: var(--text-dark); }
    .history-item-total {
      font-size: 1.2rem;
      font-weight: 800;
      color: var(--orange);
    }
    .history-item-actions {
      display: flex;
      gap: 6px;
      margin-top: 8px;
    }
    .hist-action {
      flex: 1;
      padding: 6px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-card);
      font-size: .78rem;
      font-family: var(--font);
      cursor: pointer;
      color: var(--muted);
      transition: all .18s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }
    .hist-action:hover { border-color: var(--orange); color: var(--orange); }
    .hist-action.delete:hover { border-color: #ef4444; color: #ef4444; }
    .history-footer {
      padding: 12px;
      border-top: 1px solid var(--border);
    }
    .history-clear-btn {
      width: 100%;
      padding: 10px;
      border: 1.5px solid #ef4444;
      border-radius: var(--radius-sm);
      background: transparent;
      color: #ef4444;
      font-family: var(--font);
      font-size: .9rem;
      font-weight: 600;
      cursor: pointer;
      transition: all .18s;
    }
    .history-clear-btn:hover { background: #fef2f2; }
    .history-load-more {
      text-align: center;
      padding: 12px;
      margin: 8px 0;
      border: 1px dashed var(--border);
      border-radius: var(--radius);
      color: var(--orange);
      font-size: .82rem;
      cursor: pointer;
      transition: all .2s;
    }
    .history-load-more:hover {
      background: rgba(249,115,22,.06);
      border-color: var(--orange);
    }

    /* ══════════════════════════════
       教练管理面板
    ══════════════════════════════ */
    .student-panel {
      display: none;
      position: fixed;
      top: 0; right: 0;
      width: min(360px, 95vw);
      height: 100vh;
      background: var(--bg-card);
      box-shadow: -4px 0 30px rgba(0,0,0,.2);
      z-index: 1000;
      flex-direction: column;
      transform: translateX(100%);
      transition: transform .3s cubic-bezier(.4,0,.2,1);
    }
    .student-panel.open { display: flex; transform: translateX(0); }
    .student-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.4);
      z-index: 999;
    }
    .student-overlay.show { display: block; }
    .student-header {
      padding: 20px;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: linear-gradient(135deg, #1A1208, #3B1F05);
    }
    .student-header h3 { color: #fff; font-size: 1.1rem; }
    .student-close {
      background: rgba(255,255,255,.1);
      border: none;
      border-radius: 8px;
      color: #fff;
      width: 32px; height: 32px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
    }
    .student-body { flex: 1; overflow-y: auto; padding: 12px; }
    .student-add {
      display: flex;
      gap: 6px;
      margin-bottom: 14px;
    }
    .student-add input {
      flex: 1;
      padding: 9px 12px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-input);
      color: var(--text-dark);
      font-family: var(--font);
      font-size: .9rem;
    }
    .student-add input:focus { outline: none; border-color: var(--orange); }
    .student-add button {
      padding: 9px 16px;
      border: none;
      border-radius: var(--radius-sm);
      background: var(--orange);
      color: #fff;
      font-family: var(--font);
      font-weight: 600;
      cursor: pointer;
      transition: background .18s;
    }
    .student-add button:hover { background: var(--orange-mid); }
    .student-list-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      margin-bottom: 8px;
      background: var(--bg-pale);
      cursor: pointer;
      transition: all .18s;
    }
    .student-list-item:hover { border-color: var(--orange); }
    .student-list-item .sname { font-weight: 600; color: var(--dark); font-size: .95rem; }
    :root[data-theme="dark"] .student-list-item .sname { color: var(--text-dark); }
    .student-list-item .sdel {
      background: none;
      border: none;
      color: #ef4444;
      cursor: pointer;
      font-size: 1.1rem;
      padding: 4px;
      opacity: .6;
      transition: opacity .18s;
    }
    .student-list-item .sdel:hover { opacity: 1; }

    /* ══════════════════════════════
       Toast 通知
    ══════════════════════════════ */
    .toast {
      position: fixed;
      bottom: 30px;
      left: 50%;
      transform: translateX(-50%) translateY(100px);
      background: #1A1208;
      color: #fff;
      padding: 12px 24px;
      border-radius: 30px;
      font-size: .9rem;
      font-family: var(--font);
      font-weight: 600;
      box-shadow: 0 4px 20px rgba(0,0,0,.3);
      z-index: 9999;
      transition: transform .3s cubic-bezier(.4,0,.2,1);
      pointer-events: none;
      white-space: nowrap;
    }
    .toast.show { transform: translateX(-50%) translateY(0); }
    .toast.success { background: #16A34A; }
    .toast.error { background: #ef4444; }

    /* ══════════════════════════════
       深色模式切换按钮
    ══════════════════════════════ */
    .theme-toggle {
      width: 36px; height: 36px;
      border-radius: 50%;
      border: 1.5px solid rgba(255,255,255,.2);
      background: rgba(255,255,255,.1);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all .18s;
      color: #fff;
    }
    .theme-toggle:hover { background: rgba(255,255,255,.2); }

    /* ══════════════════════════════
       打印样式
    ══════════════════════════════ */
    @media print {
      body { background: #fff; padding: 0; }
      .site-header, .toolbar, .tab-wrap, .main > .card,
      .gen-btn, .action-row, .result-section .card:first-child { display: none !important; }
      .toggle-eye { display: none !important; }
      .hidden-section { display: none !important; }
      .result-section { display: block !important; }
      .receipt-card {
        box-shadow: none;
        border: 1px solid #ddd;
        margin: 0;
        border-radius: 8px;
      }
      .receipt-card.highlight-for-shot { outline: none; box-shadow: none; }
      .action-row { display: none !important; }
    }

    /* ══════════════════════════════
       Responsive
    ══════════════════════════════ */
    @media (max-width: 480px) {
      html { font-size: 15px; }
      .brand-name { font-size: 1.5rem; }
      .form-label { flex: 0 0 65px; font-size: .8rem; }
      .total-amount { font-size: 1.7rem; }
      /* 折扣区域移动端紧凑布局 */
      .radio-group[id$="-discount-type-group"] {
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: none;
      }
      .radio-group[id$="-discount-type-group"]::-webkit-scrollbar { display: none; }
      .radio-group[id$="-discount-type-group"] .radio-label {
        padding: 7px 10px;
        font-size: .82rem;
        flex: 1 1 auto;
        white-space: nowrap;
        justify-content: center;
      }
      /* 服务类型优化 */
      .radio-group[id$="-type-group"] {
        gap: 8px;
      }
      .radio-group[id$="-type-group"] .radio-label {
        padding: 10px 14px;
        font-size: .95rem;
      }
      /* 车型选择优化 */
      .radio-group[id$="-car-type-group"],
      .radio-group[id$="-fuel-type-group"],
      .radio-group[id$="-fuel-calc-group"] {
        gap: 6px;
      }
      .radio-group[id$="-car-type-group"] .radio-label,
      .radio-group[id$="-fuel-type-group"] .radio-label,
      .radio-group[id$="-fuel-calc-group"] .radio-label {
        padding: 8px 12px;
        font-size: .85rem;
      }
      /* 工具栏按钮优化 */
      .toolbar {
        display: grid;
        grid-template-columns: 34px repeat(5, minmax(0, 1fr));
        gap: 4px;
        padding: 6px max(6px, env(safe-area-inset-left)) 6px max(6px, env(safe-area-inset-right));
        overflow: visible;
      }
      .tool-btn {
        min-width: 0;
        width: 100%;
        height: 34px;
        padding: 0 3px;
        font-size: .66rem;
        gap: 2px;
      }
      .tool-btn svg { width: 13px; height: 13px; }
      /* 输入框优化 */
      input[type="number"] {
        min-width: 40px;
      }
    }
    @media (min-width: 768px) {
      body { padding-bottom: 80px; }
      .card { padding: 24px 22px; }
      .receipt-body { padding: 22px 24px; }
    }
    /* 时间输入 - 原生 time picker，移动端友好 */
    .time-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
    .time-native {
      flex: 1;
      padding: 10px 8px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: 1.05rem;
      font-weight: 600;
      background: var(--bg-input);
      color: var(--text-dark);
      min-width: 0;
    }
    .time-native:focus {
      outline: none;
      border-color: var(--orange);
      box-shadow: 0 0 0 3px rgba(232,87,11,.15);
    }
    .time-label { font-size: .9rem; color: var(--muted); white-space: nowrap; font-weight: 600; min-width: 32px; }
    .time-sep { color: var(--muted); font-size: .85rem; font-weight: 600; flex-shrink: 0; }
    .manual-time-input {
      width: 60px;
      padding: 8px 4px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: 1.05rem;
      font-weight: 600;
      background: var(--bg-input);
      color: var(--text-dark);
      text-align: center;
    }
    .manual-time-input:focus {
      outline: none;
      border-color: var(--orange);
      box-shadow: 0 0 0 3px rgba(232,87,11,.15);
    }
    .hours-display { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; background: linear-gradient(135deg, rgba(232,87,11,.08), rgba(242,113,32,.05)); border-radius: var(--radius-sm); margin-bottom: 10px; border: 1.5px dashed rgba(232,87,11,.25); }
    .hours-display .label { font-size: .85rem; color: var(--muted); }
    .hours-display .value { font-size: 1.6rem; font-weight: 800; color: var(--orange); min-width: 50px; text-align: center; }
    .hours-display .unit { font-size: .85rem; color: var(--muted); }
    .time-input-area { background: var(--bg-pale); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; border: 1px solid var(--border); }
    .time-auto-area { margin-bottom: 10px; }
    .time-manual-area { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
    .time-manual-area span { font-size: .85rem; color: var(--muted); }
    @media (min-width: 768px) {
      .time-native { padding: 10px 12px; font-size: 1.1rem; }
    }
    @media (max-width: 480px) {
      .time-row { gap: 6px; }
      .time-native { padding: 8px 6px; font-size: .95rem; }
      .time-label { font-size: .8rem; min-width: 28px; }
      .time-sep { font-size: .75rem; }
      .hours-display { gap: 6px; padding: 10px 12px; }
      .hours-display .value { font-size: 1.4rem; min-width: 40px; }
      .time-input-area { padding: 10px; }
    }
    /* 加班勾选开关 */
    .night-toggle {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 12px;
      font-size: .88rem;
      color: var(--muted);
      font-weight: 600;
    }
    .night-toggle input[type="checkbox"] {
      width: 18px;
      height: 18px;
      accent-color: var(--orange);
      cursor: pointer;
      flex-shrink: 0;
    }
    .night-toggle label {
      cursor: pointer;
      user-select: none;
    }
    .night-content {
      transition: opacity .2s;
    }
    .night-content.disabled {
      opacity: .35;
      pointer-events: none;
    }

    /* ══════════════════════════════
       收钱浮动按钮
    ══════════════════════════════ */
    .pay-fab {
      position: fixed;
      bottom: 24px;
      right: 24px;
      width: 60px;
      height: 60px;
      border-radius: 50%;
      border: none;
      background: linear-gradient(135deg, #16A34A, #22C55E);
      color: #fff;
      font-size: .85rem;
      font-weight: 700;
      font-family: var(--font);
      cursor: pointer;
      box-shadow: 0 4px 20px rgba(22,163,74,.45);
      z-index: 900;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 2px;
      transition: transform .18s, box-shadow .18s;
      flex-direction: column;
      line-height: 1.1;
    }
    .pay-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(22,163,74,.55); }
    .pay-fab:active { transform: scale(.96); }
    .pay-fab svg { width: 22px; height: 22px; margin-bottom: 1px; }

    /* ══════════════════════════════
       自定义教练选择器
    ══════════════════════════════ */
    .student-selector {
      position: relative;
      flex: 1;
    }
    .student-selector-input {
      width: 100%;
      padding: 7px 32px 7px 10px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: .9rem;
      background: var(--bg-input);
      color: var(--text-dark);
      cursor: pointer;
      transition: border-color .2s, box-shadow .2s;
    }
    .student-selector-input:focus {
      outline: none;
      border-color: var(--orange);
      background: var(--bg-card);
      box-shadow: 0 0 0 3px rgba(232,87,11,.12);
    }
    .student-selector-input::placeholder { color: var(--muted); opacity: .7; }
    .student-selector-arrow {
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      cursor: pointer;
      color: var(--muted);
      transition: transform .2s;
      z-index: 1;
    }
    .student-selector.open .student-selector-arrow { transform: translateY(-50%) rotate(180deg); }
    .student-dropdown {
      position: fixed;
      background: var(--bg-card);
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      box-shadow: 0 8px 24px rgba(0,0,0,.12);
      z-index: 9999;
      max-height: 260px;
      overflow-y: auto;
      display: none;
      min-width: 200px;
    }
    .student-dropdown.show { display: block; }
    .student-dropdown-search {
      position: sticky;
      top: 0;
      background: var(--bg-card);
      padding: 8px;
      border-bottom: 1px solid var(--border);
    }
    .student-dropdown-search input {
      width: 100%;
      padding: 7px 10px;
      border: 1.5px solid var(--border);
      border-radius: 6px;
      font-family: var(--font);
      font-size: .85rem;
      background: var(--bg-input);
      color: var(--text-dark);
    }
    .student-dropdown-search input:focus { outline: none; border-color: var(--orange); }
    .student-dropdown-list {
      padding: 4px;
    }
    .student-dropdown-item {
      padding: 10px 12px;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: background .15s;
      font-size: .9rem;
      color: var(--text);
    }
    .student-dropdown-item:hover, .student-dropdown-item.active {
      background: var(--orange-light);
      color: var(--orange);
    }
    .student-dropdown-item .avatar {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--orange), var(--orange-mid));
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: .75rem;
      font-weight: 700;
      flex-shrink: 0;
    }
    .student-dropdown-item .item-name { font-weight: 600; white-space: nowrap; overflow: visible; }
    .student-dropdown-empty {
      padding: 20px;
      text-align: center;
      color: var(--muted);
      font-size: .82rem;
    }
    .pay-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.6);
      z-index: 2000;
      align-items: center;
      justify-content: center;
      padding: 24px;
      backdrop-filter: blur(8px);
    }
    .pay-overlay.show { display: flex; }
    .pay-modal {
      background: var(--bg-card);
      border-radius: var(--radius-lg);
      width: min(400px, 92vw);
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0,0,0,.35);
      position: relative;
      animation: payModalIn .25s ease;
    }
    @keyframes payModalIn {
      from { opacity: 0; transform: scale(.92) translateY(20px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }
    .pay-modal-header {
      background: linear-gradient(135deg, #16A34A, #22C55E);
      padding: 18px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .pay-modal-header h3 {
      color: #fff;
      font-size: 1.1rem;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .pay-modal-close {
      background: rgba(255,255,255,.15);
      border: none;
      border-radius: 8px;
      color: #fff;
      width: 32px;
      height: 32px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.3rem;
      transition: background .18s;
    }
    .pay-modal-close:hover { background: rgba(255,255,255,.25); }
    .pay-modal-body { padding: 20px; text-align: center; }
    /* 收款码 Tab 切换 */
    .pay-tabs {
      display: flex;
      gap: 0;
      margin-bottom: 18px;
      background: var(--bg-pale);
      border-radius: var(--radius-sm);
      overflow: hidden;
    }
    .pay-tab {
      flex: 1;
      padding: 10px 0;
      border: none;
      background: transparent;
      font-family: var(--font);
      font-size: .95rem;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      color: var(--muted);
      transition: all .2s;
      position: relative;
    }
    .pay-tab.active-wechat { background: #07C160; color: #fff; }
    .pay-tab.active-alipay { background: #1677FF; color: #fff; }
    .pay-tab:not(.active-wechat):not(.active-alipay):hover { background: rgba(128,128,128,.08); }
    .pay-tab-logo { width: 22px; height: 22px; border-radius: 4px; }
    .pay-qr-area {
      width: 280px;
      min-height: 280px;
      max-width: 90vw;
      margin: 0 auto 18px;
      border-radius: var(--radius-lg);
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      background: #fff;
      position: relative;
      box-shadow: 0 2px 12px rgba(0,0,0,.06);
    }
    .pay-qr-area.has-image {
      border: none;
      min-height: auto;
      width: auto;
    }
    .pay-qr-area img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }
    .pay-qr-placeholder {
      width: 280px;
      height: 280px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      border: 2.5px dashed var(--border);
      border-radius: var(--radius-lg);
    }
    .pay-qr-placeholder {
      text-align: center;
      color: var(--muted);
      font-size: .9rem;
      line-height: 1.6;
    }
    .pay-qr-placeholder svg { margin-bottom: 8px; opacity: .4; }
    .pay-upload-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 10px 20px;
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-pale);
      color: var(--text);
      font-family: var(--font);
      font-size: .9rem;
      font-weight: 600;
      cursor: pointer;
      transition: all .18s;
    }
    .pay-upload-btn:hover { border-color: #16A34A; color: #16A34A; background: rgba(22,163,74,.06); }
    .pay-change-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 16px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-card);
      color: var(--muted);
      font-family: var(--font);
      font-size: .8rem;
      font-weight: 600;
      cursor: pointer;
      transition: all .18s;
      margin-top: 10px;
    }
    .pay-change-btn:hover { border-color: #16A34A; color: #16A34A; }
    .pay-tip {
      font-size: .78rem;
      color: var(--muted);
      margin-top: 12px;
      line-height: 1.5;
    }
    #pay-qr-file-wechat, #pay-qr-file-alipay { display: none; }

    /* 密码验证弹窗 */
    .pwd-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.55);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 99999;
      padding: 20px;
    }
    .pwd-overlay.show { display: flex; }
    .pwd-modal {
      background: var(--bg-card);
      border-radius: var(--radius-lg);
      width: 100%;
      max-width: 340px;
      box-shadow: var(--shadow-lg);
      overflow: hidden;
      animation: pwdSlideIn .25s ease-out;
    }
    @keyframes pwdSlideIn {
      from { opacity: 0; transform: scale(.92) translateY(12px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }
    .pwd-modal-header {
      background: linear-gradient(135deg, #E8570B, #F27120);
      padding: 18px 20px;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .pwd-modal-header svg { flex-shrink: 0; }
    .pwd-modal-header h3 { font-size: 1.05rem; font-weight: 700; }
    .pwd-modal-body { padding: 24px 20px; text-align: center; }
    .pwd-modal-body p { font-size: .88rem; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
    .pwd-input-wrap {
      position: relative;
      margin-bottom: 18px;
    }
    .pwd-input {
      width: 100%;
      padding: 12px 44px 12px 16px;
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-input);
      color: var(--text);
      font-family: var(--font);
      font-size: 1rem;
      font-weight: 600;
      outline: none;
      transition: border-color .2s;
    }
    .pwd-input:focus { border-color: #E8570B; }
    .pwd-toggle {
      position: absolute;
      right: 4px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      padding: 8px;
      cursor: pointer;
      color: var(--muted);
      display: flex;
      align-items: center;
    }
    .pwd-toggle:hover { color: var(--text); }
    .pwd-error {
      font-size: .82rem;
      color: #DC2626;
      min-height: 20px;
      margin-bottom: 12px;
      font-weight: 600;
    }
    .pwd-actions {
      display: flex;
      gap: 10px;
    }
    .pwd-btn {
      flex: 1;
      padding: 11px 0;
      border: none;
      border-radius: var(--radius-sm);
      font-family: var(--font);
      font-size: .92rem;
      font-weight: 700;
      cursor: pointer;
      transition: all .18s;
    }
    .pwd-btn-cancel {
      background: var(--bg-pale);
      color: var(--muted);
      border: 1.5px solid var(--border);
    }
    .pwd-btn-cancel:hover { background: var(--bg-light); color: var(--text); }
    .pwd-btn-ok {
      background: linear-gradient(135deg, #E8570B, #F27120);
      color: #fff;
      box-shadow: 0 2px 8px rgba(232,87,11,.3);
    }
    .pwd-btn-ok:hover { box-shadow: 0 4px 16px rgba(232,87,11,.4); transform: translateY(-1px); }
    .pwd-btn-ok:active { transform: translateY(0); }

    /* ══════════════════════════════
       收款码弹窗
    ══════════════════════════════ */
    .pay-qr-area {
      width: 300px;
      min-height: 300px;
    }
    .pay-qr-placeholder {
      width: 280px;
      height: 280px;
    }

    /* ══════════════════════════════
       细节优化
    ══════════════════════════════ */
    /* 收钱按钮安全区域避开底部导航 */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
      .pay-fab { bottom: calc(24px + env(safe-area-inset-bottom)); }
    }
    /* 改善动画性能 */
    .card, .radio-label, .tool-btn, .tab-btn, .gen-btn, .action-btn {
      will-change: transform;
    }
    /* 输入框聚焦时卡片微亮 */
    .card:has(input:focus) {
      box-shadow: var(--shadow-md);
    }
    /* 自备车教练选择器与教练车统一 */
    .student-selector-input {
      -webkit-appearance: none;
      appearance: none;
    }
    /* 收款码弹窗内图片尺寸自适应 */
    .pay-qr-area.has-image {
      width: auto;
      max-width: 90vw;
    }
    .ops-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.45);
      z-index: 1600;
    }
    .ops-overlay.show { display: block; }
    .ops-panel {
      display: none;
      position: fixed;
      top: 0;
      right: 0;
      width: min(880px, 100vw);
      height: 100vh;
      background: var(--bg);
      z-index: 1601;
      box-shadow: -8px 0 32px rgba(0,0,0,.18);
      flex-direction: column;
      overflow: hidden;
    }
    .ops-panel.open { display: flex; }
    .ops-header {
      background: linear-gradient(135deg, #0F766E, #14B8A6);
      color: #fff;
      padding: 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .ops-header h3 { font-size: 1.05rem; margin: 0; }
    .ops-close {
      border: 0;
      color: #fff;
      background: rgba(255,255,255,.18);
      width: 34px;
      height: 34px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 1.2rem;
    }
    .ops-body { padding: 14px; overflow-y: auto; }
    .ops-tabs {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      margin-bottom: 12px;
      position: sticky;
      top: 0;
      z-index: 2;
      background: var(--bg);
      padding-bottom: 8px;
    }
    .ops-tab {
      border: 1.5px solid var(--border);
      background: var(--bg-card);
      color: var(--text);
      border-radius: 8px;
      padding: 9px 6px;
      font-weight: 700;
      cursor: pointer;
    }
    .ops-tab.active { border-color: #0F766E; color: #0F766E; background: rgba(20,184,166,.08); }
    .ops-section { display: none; }
    .ops-section.active { display: block; }
    .metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
    .metric-card, .ops-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 12px;
      box-shadow: var(--shadow-sm);
      margin-bottom: 10px;
    }
    .metric-label { color: var(--muted); font-size: .75rem; font-weight: 700; }
    .metric-value { color: var(--dark); font-size: 1.2rem; font-weight: 900; margin-top: 3px; white-space: nowrap; }
    :root[data-theme="dark"] .metric-value { color: var(--text-dark); }
    .ops-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; align-items: end; }
    .ops-field label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 4px; font-weight: 700; }
    .ops-field input, .ops-field select, .ops-field textarea {
      width: 100%;
      border: 1.5px solid var(--border);
      background: var(--bg-input);
      color: var(--text);
      border-radius: 8px;
      padding: 9px 10px;
      font-family: var(--font);
      font-size: .88rem;
    }
    .ops-field textarea { min-height: 68px; resize: vertical; }
    .ops-wide { grid-column: 1 / -1; }
    .ops-half { grid-column: span 2; }
    .ops-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
    .ops-btn {
      border: 0;
      border-radius: 8px;
      padding: 9px 12px;
      background: #0F766E;
      color: #fff;
      font-family: var(--font);
      font-weight: 800;
      cursor: pointer;
    }
    .ops-btn.secondary { background: var(--bg-card); color: var(--text); border: 1.5px solid var(--border); }
    .ops-btn.danger { background: #ef4444; }
    .ops-list { display: flex; flex-direction: column; gap: 8px; }
    .ops-item {
      border: 1px solid var(--border);
      background: var(--bg-card);
      border-radius: 8px;
      padding: 10px;
    }
    .ops-item-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; }
    .ops-muted { color: var(--muted); font-size: .78rem; margin-top: 3px; }
    @media (max-width: 480px) {
      .input-wrap {
        grid-template-columns: minmax(76px, 30%) minmax(0, 1fr) auto;
        gap: 8px;
      }
      .input-wrap > label,
      .input-wrap > span:first-child {
        line-height: 1.25;
        word-break: keep-all;
      }
      .wage-panel .input-wrap {
        grid-template-columns: minmax(82px, 32%) minmax(0, 1fr) auto;
      }
      .wage-action-row,
      .action-row {
        position: sticky;
        bottom: 0;
        background: var(--bg);
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 5;
      }
      .wage-total-banner {
        position: sticky;
        top: 0;
        z-index: 4;
      }
      .ops-panel { width: 100vw; }
      .ops-body { padding: 10px; }
      .ops-tabs { gap: 6px; }
      .ops-tab { padding: 8px 4px; font-size: .82rem; }
      .metric-grid,
      .ops-form-grid {
        grid-template-columns: 1fr;
      }
      .ops-half,
      .ops-wide {
        grid-column: 1 / -1;
      }
      .metric-value { font-size: 1.1rem; }
    }

/* ══════════════════════════════
   快捷设置栏
══════════════════════════════ */
.quick-bar {
  padding: 6px 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.quick-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-sm);
}
.quick-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background .2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.quick-toggle input:checked + .toggle-track { background: var(--orange); }
.quick-toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
  transition: all .18s;
}
.quick-btn:hover { background: var(--orange-light); border-color: var(--orange); color: var(--orange); }

/* ══════════════════════════════
   模板面板
══════════════════════════════ */
.template-overlay, .help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.template-overlay.show, .help-overlay.show { opacity: 1; visibility: visible; }
.template-panel, .help-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(520px, 92vw);
  max-height: 80vh;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transform: translate(-50%, -50%) scale(.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, transform .25s, visibility .25s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.template-panel.show, .help-modal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.template-header, .help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--orange-pale);
}
.template-header h3, .help-header h3 { font-size: 1.05rem; margin: 0; color: var(--text); }
.template-close, .help-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  transition: all .18s;
}
.template-close:hover, .help-close:hover { background: var(--orange-light); color: var(--orange); }
.template-body, .help-body { padding: 16px; overflow-y: auto; }
.template-save-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.template-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: .92rem;
}
.template-list { display: flex; flex-direction: column; gap: 8px; }
.template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-pale);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
}
.template-item-info { display: flex; flex-direction: column; gap: 2px; }
.template-item-name { font-weight: 600; font-size: .92rem; }
.template-item-meta { font-size: .75rem; color: var(--muted); }
.template-item-actions { display: flex; gap: 6px; }
.template-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: all .18s;
}
.template-btn:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-light); }
.template-btn.danger:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.template-empty {
  text-align: center;
  padding: 30px 0;
  color: var(--muted);
  font-size: .9rem;
}
.template-io-row {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.template-io-btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: .82rem;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.template-io-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.template-io-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ══════════════════════════════
   帮助模态框
══════════════════════════════ */
.help-section { margin-bottom: 18px; }
.help-section h4 { font-size: .95rem; margin-bottom: 8px; color: var(--orange); }
.help-section p { font-size: .85rem; line-height: 1.6; color: var(--text); opacity: .9; }
.help-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: .85rem;
  color: var(--text);
  border-bottom: 1px dashed var(--border);
}
.help-row:last-child { border-bottom: none; }
.help-row kbd {
  display: inline-block;
  min-width: 24px;
  padding: 3px 7px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: .75rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
}

/* ══════════════════════════════
   历史记录搜索
══════════════════════════════ */
.history-search-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-pale);
}
.history-search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: .88rem;
}
.history-filter-chip {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  transition: all .18s;
  white-space: nowrap;
}
.history-filter-chip.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.history-filter-chip:hover:not(.active) { border-color: var(--orange); color: var(--orange); background: var(--orange-light); }
.history-count { padding: 0 16px 6px; font-size: .75rem; color: var(--muted); }

@media (max-width: 480px) {
  .quick-bar { padding: 5px 8px 8px; gap: 6px; }
  .quick-toggle { padding: 4px 9px; font-size: .72rem; }
  .quick-btn { padding: 4px 9px; font-size: .72rem; }
  .toggle-track { width: 32px; height: 18px; }
  .toggle-track::after { width: 14px; height: 14px; }
  .quick-toggle input:checked + .toggle-track::after { transform: translateX(14px); }
  .template-save-row { flex-direction: column; }
  .template-save-row .gen-btn { width: 100%; justify-content: center; }
  .help-row { flex-wrap: wrap; gap: 6px; }
  .history-search-row { flex-wrap: wrap; }
  .history-filter-chip { flex: 1; text-align: center; }
}
