  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #5b6fe0 0%, #8e44ad 50%, #6c5ce7 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    position: relative;
    overflow-x: hidden;
  }
  /* 背景装饰光斑 */
  body::before, body::after {
    content: ''; position: fixed; border-radius: 50%; filter: blur(80px);
    z-index: 0; pointer-events: none; opacity: .35;
  }
  body::before { width: 360px; height: 360px; background: #ff6ec4; top: -100px; right: -80px; }
  body::after { width: 320px; height: 320px; background: #4facfe; bottom: -80px; left: -60px; }
  .window {
    width: 820px;
    max-width: 98vw;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0,0,0,.3);
    overflow: hidden;
    margin: 20px auto;
    position: relative;
    z-index: 1;
  }
  .titlebar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 20px 26px;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
  }
  .titlebar::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: shine 4s linear infinite;
  }
  @keyframes shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
  .titlebar .t-main { display: flex; align-items: center; gap: 10px; }
  .titlebar .dot { font-size: 13px; opacity: .85; }
  .body { padding: 26px; }
  .row { margin-bottom: 14px; }
  label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
  }
  input, select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e6e8f0;
    border-radius: 9px;
    font-size: 14px;
    outline: none;
    transition: all .2s;
    background: #fafbfd;
  }
  input:focus, select:focus { border-color: #667eea; background: #fff; box-shadow: 0 0 0 3px rgba(102,126,234,.14); }
  .form-row { display: flex; gap: 14px; }
  .form-row .row { flex: 1; margin-bottom: 14px; }

  /* 分区卡片 */
  .section-card {
    background: linear-gradient(180deg, #fcfdff, #f7f9ff);
    border: 1px solid #eaedf5;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
  }
  .section-card .sc-title {
    font-size: 13px; font-weight: 700; color: #5a67d8;
    margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
  }

  /* 批次列表 */
  .batch-section {  }
  .batch-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .batch-header label { margin-bottom: 0; }
  .batch-add {
    background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none;
    border-radius: 7px; padding: 6px 14px; font-size: 12px; cursor: pointer; font-weight: 600;
    box-shadow: 0 3px 10px rgba(102,126,234,.35); transition: all .2s;
  }
  .batch-add:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(102,126,234,.5); }
  .batch-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
  .batch-row .batch-date { flex: 1.5; }
  .batch-row .batch-qty { flex: 1; }
  .batch-del {
    width: 34px; height: 38px; background: #fff1f0; color: #ff4d4f;
    border: 1px solid #ffccc7; border-radius: 7px; font-size: 18px; cursor: pointer; line-height: 1;
    transition: all .2s;
  }
  .batch-del:hover { background: #ffccc7; transform: scale(1.05); }
  .batch-del:disabled { opacity: .4; cursor: not-allowed; }
  .btn-link {
    background: none; border: none; color: #667eea; cursor: pointer;
    text-decoration: underline; font-size: inherit; padding: 0; font-weight: 600;
  }
  .btn-link:hover { color: #5568d3; }
  .btn-group { display: flex; gap: 10px; margin-top: 6px; }
  /* 登录栏 */
  .auth-bar {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
    padding: 8px 12px; background: rgba(255,255,255,.5);
    border-radius: 8px; font-size: 13px; flex-wrap: wrap;
  }
  .auth-bar #authStatus { flex: 1; min-width: 80px; color: #555; }
  .btn-mini {
    padding: 5px 12px; font-size: 12px; border: 1px solid #6a5acd;
    background: #fff; color: #6a5acd; border-radius: 6px; cursor: pointer;
    transition: all .2s;
  }
  .btn-mini:hover { background: #6a5acd; color: #fff; }
  .btn-mini.btn-save { border-color: #2ecc71; color: #2ecc71; }
  .btn-mini.btn-save:hover { background: #2ecc71; color: #fff; }
  /* 认证弹窗 */
  .auth-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 9999;
  }
  .auth-modal.show { display: flex; }
  .auth-box {
    background: #fff; border-radius: 14px; padding: 24px; width: 320px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: pop .25s;
  }
  @keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  .auth-box h3 { margin: 0 0 16px; text-align: center; color: #333; }
  .auth-box input {
    width: 100%; box-sizing: border-box; padding: 10px; margin-bottom: 10px;
    border: 1px solid #ddd; border-radius: 8px; font-size: 13px;
  }
  .auth-box input:focus { outline: none; border-color: #6a5acd; box-shadow: 0 0 0 3px rgba(106,90,205,.15); }
  .auth-box .auth-submit {
    width: 100%; padding: 11px; border: none; border-radius: 8px;
    background: linear-gradient(135deg, #6a5acd, #8e44ad); color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .auth-box .auth-tip { margin-top: 10px; font-size: 12px; color: #888; text-align: center; }
  .auth-box .auth-tip a { color: #6a5acd; cursor: pointer; text-decoration: underline; }
  .auth-msg { color: #e74c3c; font-size: 12px; margin-bottom: 8px; min-height: 16px; }
  /* 年+月时间输入 */
  .ym-inputs { display: flex; align-items: center; gap: 6px; }
  .ym-inputs input { flex: 1; min-width: 0; }
  .ym-unit { color: #888; font-size: 13px; flex: none; }
  /* 无权限遮罩 */
  .calc-block-mask {
    position: fixed; inset: 0; background: rgba(240,242,248,.98);
    display: flex; align-items: center; justify-content: center; z-index: 10000;
  }
  .calc-block-box {
    background: #fff; border-radius: 16px; padding: 40px 36px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.15); max-width: 360px;
  }
  .calc-block-icon { font-size: 48px; margin-bottom: 12px; }
  .calc-block-title { font-size: 18px; font-weight: 700; color: #333; margin-bottom: 8px; }
  .calc-block-desc { font-size: 13px; color: #888; line-height: 1.6; }
  .calc-block-box .auth-submit {
    width: 100%; padding: 11px; border: none; border-radius: 8px;
    background: linear-gradient(135deg, #6a5acd, #8e44ad); color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .btn {
    flex: 1;
    padding: 13px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    color: #fff;
    letter-spacing: .5px;
  }
  .btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); box-shadow: 0 5px 16px rgba(102,126,234,.35); }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(102,126,234,.5); }
  .btn-live { background: linear-gradient(135deg, #f5576c, #f093fb); box-shadow: 0 5px 16px rgba(245,87,108,.35); }
  .btn-live:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(245,87,108,.5); }
  .btn-live.active { background: linear-gradient(135deg, #7f8c8d, #95a5a6); box-shadow: 0 4px 12px rgba(127,140,141,.4); }
  .btn:active { transform: translateY(0); }

  /* 实时状态条 */
  .live-bar {
    display: none;
    background: linear-gradient(135deg, #fff5f5, #fff0f6);
    border: 1.5px solid #ffd6e0;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 14px 0;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }
  .live-bar.show { display: flex; }
  .live-dot {
    display: inline-block;
    width: 9px; height: 9px;
    background: #f5576c;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgba(245,87,108,.5);
    animation: pulse 1.2s infinite;
  }
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(245,87,108,.5); }
    70% { box-shadow: 0 0 0 8px rgba(245,87,108,0); }
    100% { box-shadow: 0 0 0 0 rgba(245,87,108,0); }
  }
  .live-text { font-size: 13px; color: #555; }
  .live-text b { color: #333; }

  .result { margin-top: 18px; border-top: 1px dashed #e6e8f0; padding-top: 16px; }

  /* 卡片式统计 */
  .stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
  }
  .stat-card {
    background: #fff;
    border: 1px solid #eaedf5;
    border-radius: 10px;
    padding: 12px 14px;
    transition: all .2s;
    position: relative;
    overflow: hidden;
  }
  .stat-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    opacity: .7;
  }
  .stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(102,126,234,.15); border-color: #d4d8f0; }
  .stat-card .k { font-size: 12px; color: #888; }
  .stat-card .v { font-size: 15px; font-weight: 700; color: #222; margin-top: 3px; }
  .stat-card.full { grid-column: 1 / -1; }

  .highlight {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 14px;
    padding: 22px;
    text-align: center;
    margin-top: 14px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(102,126,234,.4);
    position: relative;
    overflow: hidden;
  }
  .highlight::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,.15) 0%, transparent 60%);
    animation: glow 6s ease-in-out infinite;
  }
  @keyframes glow { 0%,100% { transform: scale(1); opacity: .6; } 50% { transform: scale(1.1); opacity: 1; } }
  .highlight .num { font-size: 34px; font-weight: 800; position: relative; letter-spacing: 1px; }
  .highlight .num.neg { color: #ffd6d6; }
  .highlight .lbl { font-size: 12px; opacity: .92; margin-top: 6px; position: relative; }

  .detail {
    margin-top: 14px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #eaedf5;
    border-radius: 10px;
  }
  .detail table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .detail th {
    background: linear-gradient(180deg, #f0f2fa, #e8ebf5);
    padding: 11px 8px;
    text-align: center;
    color: #5a67d8;
    font-weight: 600;
    border-bottom: 1px solid #e0e3ee;
    position: sticky;
    top: 0;
    z-index: 1;
  }
  .detail td {
    padding: 9px 8px;
    text-align: center;
    border-bottom: 1px solid #f3f4f8;
  }
  .detail tbody tr:nth-child(even) td { background: #fafbff; }
  .detail tr:hover td { background: #eef1ff; }
  .section-title { font-size: 14px; color: #5a67d8; font-weight: 700; margin: 18px 0 8px; display: flex; align-items: center; gap: 6px; }

  .zoom-btn {
    display: block;
    width: 100%;
    text-align: center;
    margin: 12px 0 4px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f0f5ff, #eef1ff);
    color: #5a67d8;
    border: 1px solid #c5cae9;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
  }
  .zoom-btn:hover { background: linear-gradient(135deg, #e8ecff, #e0e5ff); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,.2); }

  .modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30,32,60,.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    padding: 30px;
    overflow: auto;
  }
  .modal-mask.show { display: flex; justify-content: center; align-items: flex-start; }
  .modal-box {
    background: #fff;
    border-radius: 16px;
    width: 92%;
    max-width: 1400px;
    padding: 24px 28px;
    box-shadow: 0 14px 50px rgba(0,0,0,.4);
  }
  .modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }
  .modal-head h3 { font-size: 17px; color: #333; }
  .modal-close {
    background: linear-gradient(135deg, #ff4d4f, #ff7875);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 3px 10px rgba(255,77,79,.35);
  }
  .modal-close:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(255,77,79,.5); }
  .modal-body { max-height: 80vh; overflow: auto; }
  .modal-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
  .modal-body th {
    background: linear-gradient(180deg, #f0f2fa, #e8ebf5);
    padding: 13px 10px;
    text-align: center;
    color: #5a67d8;
    font-weight: 600;
    border-bottom: 1px solid #e0e3ee;
    position: sticky;
    top: 0;
  }
  .modal-body td {
    padding: 11px;
    text-align: center;
    border-bottom: 1px solid #f3f4f8;
  }
  .modal-body tbody tr:nth-child(even) td { background: #fafbff; }
  .modal-body tr:hover td { background: #eef1ff; }

  .hint {
    font-size: 12px; color: #9099b5; margin-top: 16px; line-height: 1.8;
    background: linear-gradient(135deg, #fafbfd, #f5f7ff); padding: 12px 16px; border-radius: 10px; border: 1px solid #eaedf5;
  }
  .charts { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
  .chart-box { flex: 1; min-width: 320px; border: 1px solid #eaedf5; border-radius: 12px; padding: 16px; background: linear-gradient(180deg,#fcfdff,#f8faff); }
  .chart-title { font-size: 13px; color: #5a67d8; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
  .chart-canvas-wrap { position: relative; height: 240px; }