
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh; color: #333; padding: 24px;
  }
  .container { max-width: 1100px; margin: 0 auto; }
  header {
    text-align: center; padding: 32px 0 24px;
  }
  header h1 { font-size: 32px; color: #1a1a2e; }
  header h1 span { color: #e74c3c; }
  header p { color: #666; margin-top: 6px; font-size: 14px; }

  .card {
    background: #fff; border-radius: 16px; box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    padding: 24px; margin-bottom: 20px;
  }
  .card-header { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #1a1a2e; }

  /* Upload */
  .upload-zone {
    border: 2px dashed #c0c0c0; border-radius: 12px; padding: 48px 24px;
    text-align: center; cursor: pointer; transition: all 0.25s ease;
    background: #fafbfc;
  }
  .upload-zone:hover, .upload-zone.drag-over {
    border-color: #4472C4; background: #f0f4ff;
  }
  .upload-zone.drag-over { transform: scale(1.01); }
  .upload-zone .icon { font-size: 48px; margin-bottom: 12px; }
  .upload-zone .text { font-size: 16px; color: #555; }
  .upload-zone .subtext { font-size: 13px; color: #999; margin-top: 6px; }
  .upload-zone input[type="file"] { display: none; }

  /* Files */
  .file-list { margin-top: 16px; }
  .file-item {
    display: flex; align-items: center; padding: 8px 12px;
    background: #f8f9fa; border-radius: 8px; margin-bottom: 6px;
    transition: background 0.15s;
  }
  .file-item:hover { background: #eef1f5; }
  .file-icon { font-size: 20px; margin-right: 10px; }
  .file-name { flex: 1; font-size: 14px; word-break: break-all; }
  .file-size { font-size: 12px; color: #999; margin: 0 12px; white-space: nowrap; }
  .file-cat select {
    padding: 3px 8px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 12px; background: #fff; cursor: pointer;
  }
  .file-cat select.sales { border-color: #27ae60; color: #27ae60; }
  .file-cat select.procurement { border-color: #2980b9; color: #2980b9; }
  .file-cat select.other { border-color: #f39c12; color: #f39c12; }
  .file-remove {
    margin-left: 8px; cursor: pointer; color: #ccc; font-size: 18px; line-height: 1;
    transition: color 0.15s; user-select: none;
  }
  .file-remove:hover { color: #e74c3c; }
  .file-empty { text-align: center; color: #bbb; padding: 16px; font-size: 14px; }

  /* Buttons */
  .btn-row { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 24px; border-radius: 8px; border: none;
    font-size: 15px; font-weight: 500; cursor: pointer;
    transition: all 0.2s; text-decoration: none;
  }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .btn-primary {
    background: #4472C4; color: #fff;
  }
  .btn-primary:hover:not(:disabled) { background: #365a9b; transform: translateY(-1px); }
  .btn-success {
    background: #27ae60; color: #fff;
  }
  .btn-success:hover:not(:disabled) { background: #1e8449; transform: translateY(-1px); }
  .btn-outline {
    background: transparent; border: 1px solid #ddd; color: #666;
  }
  .btn-outline:hover:not(:disabled) { background: #f5f5f5; }
  .btn-sm { padding: 6px 14px; font-size: 13px; }

  /* Progress */
  .progress-area { margin-top: 12px; }
  .progress-bar {
    height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden;
    display: none;
  }
  .progress-bar.active { display: block; }
  .progress-bar .fill {
    height: 100%; width: 0%; background: linear-gradient(90deg, #4472C4, #27ae60);
    border-radius: 3px; transition: width 0.3s;
  }
  .upload-buttons { margin-top: 12px; display: flex; gap: 8px; justify-content: center; }
  .payment-panel {
    margin-top: 12px; padding: 16px 20px; border-radius: 12px;
    border: 2px solid #e74c3c; background: #fff5f5;
    display: flex; align-items: center; justify-content: space-between;
    animation: slideIn 0.3s ease;
  }
  @keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
  .payment-panel .pay-info { display: flex; gap: 8px; align-items: baseline; }
  .payment-panel .pay-count { font-size: 14px; color: #333; }
  .payment-panel .pay-tier { font-size: 12px; color: #999; }
  .payment-panel .pay-price { font-size: 28px; font-weight: 700; color: #e74c3c; margin: 0 16px; }
  .payment-panel .pay-btn { font-size: 15px; padding: 10px 24px; }
  .tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .tier-card { border: 2px solid #e0e0e0; border-radius: 12px; padding: 14px; cursor: pointer; transition: all 0.2s; text-align: center; }
  .tier-card:hover { border-color: #4472C4; box-shadow: 0 2px 8px rgba(68,114,196,0.15); }
  .tier-name { font-size: 16px; font-weight: 600; color: #1a1a2e; }
  .tier-range { font-size: 12px; color: #666; margin: 4px 0; }
  .tier-mb { font-size: 12px; color: #999; }
  .tier-price { font-size: 22px; font-weight: 700; color: #e74c3c; margin: 6px 0; }
  .tier-unit { font-size: 11px; color: #999; }
  .progress-text { font-size: 13px; color: #666; margin-top: 6px; }

  /* Summary */
  .summary-row { display: flex; gap: 12px; flex-wrap: wrap; }
  .summary-item {
    flex: 1; min-width: 120px; padding: 16px; border-radius: 10px; text-align: center;
  }
  .summary-item.sales { background: #e8f5e9; }
  .summary-item.procurement { background: #e3f2fd; }
  .summary-item.other { background: #fff8e1; }
  .summary-item.total { background: #f3e5f5; }
  .summary-item.risk { background: #fce4ec; }
  .summary-number { font-size: 28px; font-weight: 700; }
  .summary-item.sales .summary-number { color: #27ae60; }
  .summary-item.procurement .summary-number { color: #2980b9; }
  .summary-item.other .summary-number { color: #f39c12; }
  .summary-item.total .summary-number { color: #8e44ad; }
  .summary-item.risk .summary-number { color: #e74c3c; }
  .summary-label { font-size: 13px; color: #666; margin-top: 4px; }

  /* Table */
  .table-wrap { overflow-x: auto; margin-top: 12px; }
  table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    white-space: nowrap;
  }
  th {
    background: #4472C4; color: #fff; padding: 10px 12px;
    text-align: left; font-weight: 500; position: sticky; top: 0; z-index: 1;
  }
  td { padding: 8px 12px; border-bottom: 1px solid #eee; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
  tr:hover td { background: #f8f9ff; }
  .tag {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 500;
  }
  .tag-sales { background: #e8f5e9; color: #27ae60; }
  .tag-procurement { background: #e3f2fd; color: #2980b9; }
  .tag-other { background: #fff8e1; color: #f39c12; }
  .tag-low { background: #e8f5e9; color: #27ae60; }
  .tag-mid { background: #fff8e1; color: #f39c12; }
  .tag-high { background: #fce4ec; color: #e74c3c; }
  .tag-critical { background: #ff6b6b; color: #fff; }

  /* Log */
  .log-area {
    background: #1e1e1e; color: #d4d4d4; border-radius: 8px;
    padding: 12px 16px; font-family: "Menlo", "Fira Code", monospace;
    font-size: 12px; max-height: 160px; overflow-y: auto; line-height: 1.7;
    margin-top: 12px;
  }
  .log-area .log-ok { color: #6a9955; }
  .log-area .log-err { color: #f44747; }
  .log-area .log-warn { color: #ce9178; }
  .log-area .log-info { color: #569cd6; }

  /* Empty state */
  .empty-state { text-align: center; padding: 40px 20px; color: #999; }
  .empty-state .icon { font-size: 40px; margin-bottom: 12px; }

  /* Toast */
  .toast {
    position: fixed; top: 24px; right: 24px; padding: 14px 24px;
    border-radius: 10px; color: #fff; font-size: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 999;
    transform: translateX(120%); transition: transform 0.35s ease;
    max-width: 380px;
  }
  .toast.show { transform: translateX(0); }
  .toast-success { background: #27ae60; }
  .toast-error { background: #e74c3c; }
  .toast-warning { background: #f39c12; }  /* Responsive */
  @media (max-width: 640px) {
    body { padding: 12px; }
    header h1 { font-size: 24px; }
    .summary-item { min-width: 80px; padding: 10px; }
    .summary-number { font-size: 22px; }
    .btn { padding: 8px 16px; font-size: 13px; }
  }

  /* Tab 导航 */
  .tab-nav { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
  .tab-btn {
    padding: 10px 24px; font-size: 15px; font-weight: 600; border: 2px solid #ddd;
    border-radius: 24px; background: #fff; color: #555; cursor: pointer; transition: all .2s;
  }
  .tab-btn:hover { border-color: #4472C4; color: #4472C4; }
  .tab-btn.active { background: #4472C4; color: #fff; border-color: #4472C4; box-shadow: 0 4px 12px rgba(68,114,196,.3); }
  .tab-pane { display: none; }
  .tab-pane.active { display: block; }

  .badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
  .badge-ok { background: #e8f8ee; color: #1e9e4e; }
  .badge-warn { background: #fdeaea; color: #d64545; }
  .row-warn td { background: #fff8f0; }
  .issue-cell { max-width: 260px; font-size: 12px; color: #d64545; }
  .summary-item { margin-right: 20px; font-size: 14px; }
  .summary-item .ok { color: #1e9e4e; }
  .summary-item .warn { color: #d64545; }
  .log-error { color: #d64545; }
