    /* ======= 重置 ======= */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    
    /* ======= 变量 ======= */
    :root {
      --c-bg:        #f0f4ec;
      --c-surface:   #ffffff;
      --c-green-1:   #1a3d20;
      --c-green-2:   #2d6a35;
      --c-green-3:   #4a9456;
      --c-green-pale: #e8f2e9;
      --c-border:    #c9dfc9;
      --c-text:      #1c2b1e;
      --c-muted:     #6b7c6c;
      --c-amber:     #e6a817;
      --c-error-bg:  #fff3e0;
      --c-error:     #c45600;
      --radius-sm:   10px;
      --radius-md:   14px;
      --radius-lg:   20px;
      --shadow:      0 2px 16px rgba(26,61,32,0.10);
      --shadow-btn:  0 4px 14px rgba(26,61,32,0.28);
    }

    /* ======= 全局 ======= */
    html { -webkit-text-size-adjust: 100%; }
    body {
      font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC",
                   "Microsoft YaHei", sans-serif;
      background: var(--c-bg);
      color: var(--c-text);
      min-height: 100dvh;
      padding-bottom: 48px;
    }

    /* ======= 顶栏 ======= */
    .topbar {
      background: linear-gradient(160deg, var(--c-green-1) 0%, var(--c-green-2) 100%);
      padding: 20px 16px 18px;
      display: flex;
      align-items: center;
      gap: 14px;
      position: sticky;
      top: 0;
      z-index: 10;
    }
    .topbar-icon {
      font-size: 34px;
      line-height: 1;
      filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
    }
    .topbar-info {}
    .topbar-title {
      font-size: 19px;
      font-weight: 800;
      color: #fff;
      letter-spacing: .5px;
    }
    .topbar-sub {
      font-size: 11px;
      color: rgba(255,255,255,.65);
      margin-top: 2px;
      letter-spacing: 1.5px;
    }

    /* ======= 状态条 ======= */
    .statusbar {
      background: var(--c-green-pale);
      border-bottom: 1px solid var(--c-border);
      padding: 7px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12px;
      color: var(--c-muted);
    }
    .status-left { display: flex; align-items: center; gap: 6px; }
    .dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: #81c784;
      flex-shrink: 0;
      transition: background .3s;
    }
    .dot.loading {
      background: var(--c-amber);
      animation: blink 1s ease-in-out infinite;
    }
    .dot.error { background: #e53935; }
    @keyframes blink { 0%,100% { opacity:1; } 50% { opacity:.3; } }

    .btn-refresh {
      background: none;
      border: none;
      color: var(--c-green-2);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      padding: 4px 8px;
      border-radius: 6px;
      transition: background .15s;
    }
    .btn-refresh:active { background: var(--c-green-pale); }

    .offline-badge {
      font-size: 11px;
      color: #b85c00;
      background: #fff3e0;
      padding: 3px 8px;
      border-radius: 6px;
      font-weight: 700;
      letter-spacing: .3px;
    }

    /* ======= 主体 ======= */
    .main { padding: 14px 14px 0; max-width: 500px; margin: 0 auto; }

    /* ======= 卡片 ======= */
    .card {
      background: var(--c-surface);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow);
      padding: 16px;
      margin-bottom: 12px;
      transition: opacity .25s;
    }
    .card-head {
      font-size: 13px;
      font-weight: 800;
      color: var(--c-green-2);
      letter-spacing: .3px;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* ======= 欢迎引导（首次使用） ======= */
    .welcome-guide {
      text-align: center;
      padding: 20px 0 8px;
      color: var(--c-muted);
    }
    .welcome-guide .welcome-icon {
      font-size: 40px;
      margin-bottom: 10px;
    }
    .welcome-guide h3 {
      font-size: 16px;
      color: var(--c-green-2);
      margin-bottom: 6px;
    }
    .welcome-guide p {
      font-size: 13px;
      line-height: 1.7;
    }
    .welcome-guide .welcome-steps {
      text-align: left;
      margin: 12px auto 0;
      display: inline-block;
      font-size: 12px;
      line-height: 2;
    }

    /* ======= CSV 格式预览 ======= */
    .csv-preview-toggle {
      background: none;
      border: none;
      color: var(--c-green-2);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      padding: 4px 0;
      margin-top: 6px;
      font-family: inherit;
    }
    .csv-preview-panel {
      margin-top: 8px;
      background: #fafbfa;
      border: 1px solid var(--c-border);
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 11px;
      color: var(--c-muted);
      line-height: 1.8;
      overflow-x: auto;
    }
    .csv-preview-panel table {
      width: 100%;
      border-collapse: collapse;
      font-size: 11px;
      margin-top: 4px;
    }
    .csv-preview-panel th {
      background: var(--c-green-pale);
      padding: 4px 6px;
      border: 1px solid var(--c-border);
      font-weight: 700;
    }
    .csv-preview-panel td {
      padding: 4px 6px;
      border: 1px solid #eef5ee;
      text-align: center;
    }

    /* ======= 模糊数据醒目横幅 ======= */
    .amb-banner {
      background: #fff3e0;
      border: 1.5px solid #e6a817;
      border-left: 4px solid #e6a817;
      border-radius: 8px;
      padding: 10px 14px;
      margin-bottom: 10px;
      font-size: 13px;
      font-weight: 600;
      color: #b85c00;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      line-height: 1.5;
    }

    /* ======= 表单 ======= */
    .field { margin-bottom: 12px; }
    .field:last-of-type { margin-bottom: 0; }
    .field-label {
      display: block;
      font-size: 11px;
      font-weight: 700;
      color: var(--c-muted);
      text-transform: uppercase;
      letter-spacing: 1px;
      margin-bottom: 6px;
    }
    .field-input {
      width: 100%;
      border: 1.5px solid var(--c-border);
      border-radius: var(--radius-sm);
      padding: 13px 14px;
      font-size: 16px;
      color: var(--c-text);
      background: var(--c-green-pale);
      outline: none;
      transition: border-color .2s, background .2s;
      -webkit-appearance: none;
      font-family: inherit;
    }
    .field-clear {
      background: none;
      border: none;
      color: var(--c-muted);
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      padding: 0 8px;
      border-radius: 6px;
      transition: background .15s;
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
    }
    .field-clear:active {
      background: var(--c-green-pale);
    }
    .field-input-wrapper {
      position: relative;
    }
    .field-input:focus {
      border-color: var(--c-green-3);
      background: #fff;
    }
    .field-row { display: flex; gap: 10px; }
    .field-row .field { flex: 1; }

    /* ======= 菜品下拉面板 ======= */
    .veg-dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      z-index: 20;
      background: #fff;
      border: 1.5px solid var(--c-green-3);
      border-top: none;
      border-radius: 0 0 var(--radius-sm) var(--radius-sm);
      max-height: 220px;
      overflow-y: auto;
      list-style: none;
      padding: 0;
      margin: 0;
      box-shadow: 0 4px 16px rgba(0,0,0,.12);
      -webkit-overflow-scrolling: touch;
    }
    .veg-dropdown li {
      padding: 11px 14px;
      font-size: 15px;
      color: var(--c-text);
      cursor: pointer;
      border-bottom: 1px solid #eef5ee;
      transition: background .1s;
    }
    .veg-dropdown li:last-child { border-bottom: none; }
    .veg-dropdown li:active,
    .veg-dropdown li:hover { background: var(--c-green-pale); }
    .veg-dropdown li.highlight { background: var(--c-green-pale); outline: none; }
    .veg-dropdown li mark {
      background: #fff3cd;
      color: #b85c00;
      font-weight: 700;
    }

    /* ======= 按钮 ======= */
    .btn {
      display: block;
      width: 100%;
      border: none;
      border-radius: var(--radius-md);
      padding: 15px;
      font-size: 16px;
      font-weight: 800;
      letter-spacing: .5px;
      cursor: pointer;
      transition: transform .1s, opacity .2s, box-shadow .2s;
      font-family: inherit;
    }
    .btn:active { transform: scale(.97); }
    .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

    .btn-query {
      background: linear-gradient(135deg, var(--c-green-1) 0%, var(--c-green-3) 100%);
      color: #fff;
      box-shadow: var(--shadow-btn);
      margin-top: 16px;
    }
    .btn-copy {
      background: var(--c-green-2);
      color: #fff;
      box-shadow: 0 3px 10px rgba(45,106,53,.35);
      margin-top: 2px;
    }
    .btn-copy.done {
      background: #43a047;
      box-shadow: none;
    }


    .btn-back {
      background: none;
      color: var(--c-green-2);
      box-shadow: none;
      border: 1.5px solid var(--c-border);
      margin-top: 10px;
    }
    .btn-back:active { background: var(--c-green-pale); }

    .copy-hint {
      font-size: 10px;
      color: var(--c-muted);
      text-align: center;
      margin-bottom: 4px;
    }

    /* ======= 合计信息条 ======= */
    .total-bar {
      background: #fffef5;
      border: 1px solid #ffecb3;
      border-radius: var(--radius-sm);
      padding: 6px 12px;
      font-size: 12px;
      color: #7a5d00;
      text-align: center;
      margin-bottom: 8px;
      font-weight: 400;
    }
    .total-bar .verify-hint {
      font-size: 12px;
      font-weight: 400;
      color: #8d6e00;
    }

    /* ======= 原始数据表格 ======= */
    .raw-scroll {
      overflow-x: auto;
      margin: 6px 0 0;
      -webkit-overflow-scrolling: touch;
      border-radius: var(--radius-sm);
      border: 1px solid var(--c-border);
      background: var(--c-surface);
    }
    .raw-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
      min-width: 490px;
    }
    .raw-table th {
      background: var(--c-green-pale);
      color: var(--c-green-2);
      font-weight: 800;
      padding: 9px 0;
      text-align: center;
      border-bottom: 2px solid var(--c-border);
      font-size: 12px;
      white-space: nowrap;
      min-width: 32px;
      position: sticky;
      top: 0;
      z-index: 1;
    }
    .raw-table th + th,
    .raw-table td + td {
      border-left: 1px solid #e8f0e8;
    }
    .raw-table td {
      padding: 11px 6px;
      text-align: center;
      border-bottom: 1px solid #eef5ee;
      color: var(--c-text);
      font-size: 13px;
      white-space: nowrap;
      min-width: 32px;
      font-variant-numeric: tabular-nums;
    }
    .raw-table td.active {
      background: #f0fff1;
      font-weight: 700;
      color: var(--c-green-1);
    }
    .raw-table td.warn {
      background: #fff8e1;
      font-weight: 600;
      color: #b85c00;
      position: relative;
    }
    .raw-table td .warn-dot {
      display: inline-block;
      width: 14px; height: 14px;
      background: #e6a817;
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      line-height: 14px;
      text-align: center;
      border-radius: 50%;
      margin-left: 2px;
      vertical-align: top;
    }
    .raw-table td.zero { color: #c0c0c0; font-size: 12px; }

    .raw-hint {
      font-size: 11px;
      color: var(--c-muted);
      text-align: center;
      margin-top: 8px;
    }

    /* ======= 输出模式切换 ======= */
    .mode-bar {
      display: flex;
      background: var(--c-green-pale);
      border-radius: var(--radius-sm);
      padding: 3px;
      margin-bottom: 14px;
      gap: 3px;
    }
    .mode-tab {
      flex: 1;
      padding: 10px 6px;
      border: none;
      background: transparent;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      color: var(--c-muted);
      cursor: pointer;
      transition: all .2s;
      font-family: inherit;
      white-space: nowrap;
    }
    .mode-tab.active {
      background: var(--c-surface);
      color: var(--c-green-2);
      box-shadow: 0 1px 5px rgba(0,0,0,.1);
    }

    /* ======= 输出文字框 ======= */
    .output-box {
      background: var(--c-green-pale);
      border: 1.5px solid var(--c-border);
      border-radius: var(--radius-sm);
      padding: 16px;
      font-size: 15px;
      line-height: 1.9;
      color: var(--c-text);
      white-space: pre-wrap;
      word-break: break-all;
      font-family: "SF Mono", "Menlo", "Consolas", "PingFang SC", monospace;
      margin-bottom: 14px;
      min-height: 80px;
      letter-spacing: .3px;
    }

    /* ======= 错误提示 ======= */
    .err-box {
      background: var(--c-error-bg);
      border: 1px solid #ffcc80;
      border-radius: var(--radius-sm);
      padding: 12px 14px;
      font-size: 14px;
      color: var(--c-error);
      margin-top: 10px;
    }

    /* ======= Loading ======= */
    .loading-box {
      text-align: center;
      padding: 24px 0 8px;
      color: var(--c-muted);
      font-size: 14px;
    }
    .spin {
      width: 26px; height: 26px;
      border: 3px solid var(--c-border);
      border-top-color: var(--c-green-3);
      border-radius: 50%;
      animation: spin .75s linear infinite;
      margin: 0 auto 10px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

/* ======= 加载遮罩 ======= */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.loading-overlay .spin { width: 36px; height: 36px; border-width: 4px; }
.loading-overlay p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--c-green-2);
  font-weight: 700;
}
.loading-cancel {
  margin-top: 16px;
  padding: 8px 24px;
  border: 1.5px solid var(--c-border);
  border-radius: 20px;
  background: #fff;
  color: var(--c-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ======= 显示/隐藏 ======= */
.hidden { display: none !important; }

    /* ======= 分隔线 ======= */
    .divider {
      height: 1px;
      background: var(--c-border);
      margin: 14px -16px;
    }

    /* ======= 数据来源切换 ======= */
    .ds-tabs {
      display: flex;
      background: var(--c-green-pale);
      border-radius: var(--radius-sm);
      padding: 3px;
      margin-bottom: 12px;
      gap: 3px;
    }
    .ds-tab {
      flex: 1;
      padding: 9px 6px;
      border: none;
      background: transparent;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      color: var(--c-muted);
      cursor: pointer;
      transition: all .2s;
      font-family: inherit;
      white-space: nowrap;
    }
    .ds-tab.active {
      background: var(--c-surface);
      color: var(--c-green-2);
      box-shadow: 0 1px 5px rgba(0,0,0,.08);
    }
    .ds-upload-row {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .btn-upload {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 10px 16px;
      border: 1.5px dashed var(--c-border);
      border-radius: var(--radius-sm);
      background: var(--c-green-pale);
      color: var(--c-green-2);
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all .2s;
      font-family: inherit;
      flex-shrink: 0;
    }
    .btn-upload:active {
      background: var(--c-surface);
      border-color: var(--c-green-3);
    }
    .csv-name {
      font-size: 12px;
      color: var(--c-muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
    }
    .csv-hint {
      font-size: 11px;
      color: var(--c-amber);
      margin-top: 8px;
      line-height: 1.5;
    }
    .ds-api-ok {
      font-size: 11px;
      color: var(--c-green-3);
      margin-top: 6px;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .ds-api-ok .dot-sm {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: #81c784;
      flex-shrink: 0;
    }
  </style>