
    :root {
      --bg: #f6f7f9;
      --panel: #ffffff;
      --ink: #20242a;
      --muted: #68707c;
      --line: #dfe4ea;
      --a: #1769aa;
      --b: #d1495b;
      --green: #238a7a;
      --amber: #b7791f;
      --shadow: 0 8px 22px rgba(28, 35, 45, 0.07);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      background: var(--bg);
      color: var(--ink);
      font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
      letter-spacing: 0;
    }
    header {
      padding: 22px 28px 12px;
      border-bottom: 1px solid var(--line);
      background: #fff;
    }
    .header-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
    }
    .header-actions {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 10px;
    }
    .mode-tabs {
      display: inline-flex;
      gap: 8px;
      padding: 4px;
      background: #e8edf3;
      border-radius: 10px;
    }
    .mode-tabs button {
      border: 0;
      background: transparent;
      color: var(--muted);
      font: inherit;
      font-size: 14px;
      font-weight: 700;
      padding: 8px 20px;
      border-radius: 8px;
      cursor: pointer;
    }
    .mode-tabs button.active {
      background: var(--a);
      color: #fff;
      box-shadow: 0 2px 8px rgba(23, 105, 170, 0.24);
    }
    .warehouse-tabs {
      display: inline-flex;
      gap: 8px;
      padding: 4px;
      background: #eef2f6;
      border-radius: 10px;
    }
    .warehouse-tabs.hidden {
      display: none;
    }
    .warehouse-tabs button {
      border: 0;
      background: transparent;
      color: var(--muted);
      font: inherit;
      font-size: 14px;
      font-weight: 600;
      padding: 8px 18px;
      border-radius: 8px;
      cursor: pointer;
    }
    .warehouse-tabs button.active {
      background: #fff;
      color: var(--a);
      box-shadow: 0 2px 8px rgba(23, 105, 170, 0.12);
    }
    h1 {
      margin: 0;
      font-size: 24px;
      line-height: 1.25;
      font-weight: 700;
    }
    .title-block {
      min-width: 0;
    }
    .title-row {
      display: flex;
      align-items: baseline;
      gap: 10px 14px;
      flex-wrap: wrap;
      margin-bottom: 8px;
    }
    .browse-log-btn {
      border: 0;
      background: none;
      color: var(--muted);
      font: inherit;
      font-size: 13px;
      line-height: 1.2;
      cursor: pointer;
      padding: 0;
      text-decoration: underline;
      text-underline-offset: 2px;
    }
    .browse-log-btn:hover {
      color: var(--a);
    }
    .browse-dialog {
      max-width: 920px;
    }
    .sub {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 18px;
      color: var(--muted);
      font-size: 13px;
    }
    main { padding: 18px 28px 32px; }
    .filters {
      display: grid;
      grid-template-columns: repeat(7, minmax(150px, 1fr));
      gap: 12px;
      padding: 14px;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
      position: sticky;
      top: 0;
      z-index: 5;
    }
    label {
      display: grid;
      gap: 6px;
      font-size: 12px;
      color: var(--muted);
      min-width: 0;
    }
    select {
      width: 100%;
      height: 34px;
      padding: 5px 9px;
      border: 1px solid #cbd3dc;
      border-radius: 6px;
      background: #fff;
      color: var(--ink);
      font-size: 13px;
    }
    .multi-select {
      position: relative;
      min-width: 0;
    }
    .multi-trigger {
      width: 100%;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 5px 9px;
      border: 1px solid #cbd3dc;
      border-radius: 6px;
      background: #fff;
      color: var(--ink);
      font-size: 13px;
      cursor: pointer;
    }
    .multi-trigger span:first-child {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .multi-menu {
      display: none;
      position: absolute;
      left: 0;
      right: 0;
      top: calc(100% + 5px);
      max-height: 250px;
      overflow: auto;
      padding: 6px;
      border: 1px solid #cbd3dc;
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 12px 28px rgba(20, 28, 38, 0.16);
      z-index: 30;
    }
    .multi-select.open .multi-menu { display: grid; gap: 2px; }
    .multi-option {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 30px;
      padding: 4px 6px;
      border-radius: 6px;
      color: var(--ink);
      font-size: 13px;
    }
    .multi-option:hover { background: #f3f6f9; }
    .multi-option input { width: 14px; height: 14px; }
    .kpis {
      display: grid;
      grid-template-columns: repeat(4, minmax(160px, 1fr));
      gap: 12px;
      margin-top: 16px;
    }
    .period-kpis {
      grid-template-columns: repeat(3, minmax(220px, 1fr));
    }
    .kpi {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
      min-height: 112px;
      box-shadow: var(--shadow);
    }
    .kpi span {
      color: var(--muted);
      font-size: 12px;
      display: block;
      margin-bottom: 8px;
    }
    .kpi strong {
      font-size: 24px;
      line-height: 1.2;
      display: block;
      margin-bottom: 6px;
    }
    .kpi small {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      display: block;
    }
    .metric-tag {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      min-height: 128px;
      box-shadow: var(--shadow);
    }
    .metric-tag .tag-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
    }
    .metric-tag .tag-name {
      color: var(--muted);
      font-size: 12px;
    }
    .metric-tag .tag-main {
      color: var(--ink);
      font-size: 22px;
      font-weight: 700;
    }
    .tag-row {
      display: grid;
      grid-template-columns: minmax(64px, 96px) minmax(58px, 1fr) auto;
      gap: 8px;
      align-items: center;
      min-height: 23px;
      font-size: 12px;
      color: var(--muted);
    }
    .tag-row > span:first-child {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .tag-bar {
      height: 7px;
      overflow: hidden;
      border-radius: 99px;
      background: #edf1f5;
    }
    .tag-bar i {
      display: block;
      height: 100%;
      min-width: 2px;
      border-radius: inherit;
    }
    .tag-mini {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 9px;
    }
    .tag-mini span {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 2px 7px;
      border-radius: 99px;
      background: #f4f7fa;
      color: var(--muted);
      font-size: 12px;
    }
    .period-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 13px;
      min-height: 148px;
      box-shadow: var(--shadow);
    }
    .period-card .period-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
    }
    .period-card .period-title {
      color: var(--muted);
      font-size: 12px;
    }
    .period-card .period-rate {
      font-size: 23px;
      font-weight: 700;
      color: var(--ink);
    }
    .period-card .period-sub {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 10px;
    }
    .period-warn {
      display: block;
      margin-bottom: 8px;
      color: #b7791f;
      font-size: 12px;
    }
    .period-bar-row {
      display: grid;
      grid-template-columns: minmax(76px, 112px) 1fr minmax(58px, auto);
      align-items: center;
      gap: 8px;
      min-height: 24px;
      font-size: 12px;
      color: var(--muted);
    }
    .period-bar-row b {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 600;
      color: var(--ink);
    }
    .period-track {
      height: 8px;
      overflow: hidden;
      border-radius: 99px;
      background: #edf1f5;
    }
    .period-track i {
      display: block;
      height: 100%;
      min-width: 2px;
      border-radius: inherit;
    }
    .panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
    }
    .panel-head h2 { margin: 0; }
    .inline-filter {
      display: grid;
      grid-template-columns: auto minmax(150px, 190px);
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: var(--muted);
    }
    .up { color: #b42318; }
    .down { color: #13795b; }
    .flat { color: var(--muted); }
    .grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      margin-top: 16px;
    }
    .panel {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      min-width: 0;
      box-shadow: var(--shadow);
    }
    .panel h2 {
      margin: 0 0 8px;
      font-size: 15px;
      line-height: 1.4;
    }
    .chart {
      width: 100%;
      height: 330px;
    }
    .wide { grid-column: 1 / -1; }
    .table-wrap {
      width: 100%;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 940px;
      font-size: 13px;
    }
    th, td {
      padding: 8px 10px;
      border-bottom: 1px solid #edf0f3;
      text-align: right;
      white-space: nowrap;
    }
    th:first-child, td:first-child { text-align: left; }
    th {
      color: #4b5563;
      background: #f8fafc;
      font-weight: 600;
      position: sticky;
      top: 0;
    }
    tbody tr:hover { background: #f6fbff; }
    .note {
      color: var(--muted);
      font-size: 12px;
      margin-top: 8px;
      line-height: 1.5;
    }
    .empty {
      min-height: 120px;
      display: grid;
      place-items: center;
      color: var(--muted);
      border: 1px dashed var(--line);
      border-radius: 8px;
    }
    .detail-fab {
      position: fixed;
      right: 22px;
      bottom: 22px;
      z-index: 80;
    }
    .detail-fab > button {
      width: 54px;
      height: 54px;
      border: 0;
      border-radius: 50%;
      background: var(--a);
      color: #fff;
      font-weight: 700;
      box-shadow: 0 10px 26px rgba(23, 105, 170, 0.34);
      cursor: pointer;
    }
    .detail-menu {
      display: none;
      position: absolute;
      right: 0;
      bottom: 64px;
      min-width: 126px;
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 12px 28px rgba(20, 28, 38, 0.18);
    }
    .detail-fab.open .detail-menu { display: grid; gap: 4px; }
    .detail-menu button {
      height: 32px;
      border: 0;
      border-radius: 6px;
      background: #fff;
      color: var(--ink);
      text-align: left;
      padding: 0 10px;
      cursor: pointer;
    }
    .detail-menu button:hover { background: #f3f6f9; }
    .detail-modal {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 90;
      background: rgba(15, 23, 42, 0.42);
      padding: 34px;
    }
    .detail-modal.open { display: block; }
    .detail-dialog {
      width: min(1380px, 100%);
      height: min(820px, calc(100vh - 68px));
      margin: 0 auto;
      display: grid;
      grid-template-rows: auto auto auto minmax(0, 1fr);
      gap: 10px;
      background: #fff;
      border-radius: 8px;
      border: 1px solid var(--line);
      box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
      padding: 14px;
    }
    .detail-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .detail-head h2 { margin: 0; font-size: 16px; }
    .detail-head button {
      height: 32px;
      border: 1px solid #cbd3dc;
      border-radius: 6px;
      background: #fff;
      cursor: pointer;
    }
    .detail-filters {
      display: grid;
      grid-template-columns: repeat(3, minmax(160px, 1fr));
      gap: 10px;
    }
    .detail-filters input {
      height: 34px;
      padding: 5px 9px;
      border: 1px solid #cbd3dc;
      border-radius: 6px;
      font: inherit;
      font-size: 13px;
    }
    .detail-count { color: var(--muted); font-size: 12px; }
    .detail-table-wrap {
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
    }
    .detail-table-wrap table { min-width: 1180px; }
    .detail-table-wrap th {
      cursor: pointer;
      user-select: none;
    }
    .detail-table-wrap td {
      max-width: 260px;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    @media (max-width: 1180px) {
      .filters { grid-template-columns: repeat(3, minmax(150px, 1fr)); position: static; }
      .kpis { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
      .grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 680px) {
      header, main { padding-left: 14px; padding-right: 14px; }
      .filters, .kpis { grid-template-columns: 1fr; }
      .chart { height: 300px; }
      .detail-modal { padding: 10px; }
      .detail-dialog { height: calc(100vh - 20px); }
      .detail-filters { grid-template-columns: 1fr; }
    }
  