:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #66736d;
  --line: #dce3df;
  --soft: #f4f7f5;
  --paper: #ffffff;
  --green: #167052;
  --green-dark: #0e543d;
  --amber: #b46a1f;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(20, 38, 30, 0.13);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eef3f0; font-size: 14px; letter-spacing: 0; }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef3f0 0 52%, #e4ebe7 52% 100%);
}
.login-panel {
  width: min(400px, 100%);
  padding: 38px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 6px;
  font-size: 20px;
  font-weight: 700;
}
.brand-mark.small { width: 36px; height: 36px; font-size: 16px; }
.login-heading { margin: 22px 0 28px; }
.login-heading p { margin: 0 0 5px; color: var(--green); font-size: 12px; font-weight: 700; }
.login-heading h1 { margin: 0; font-size: 26px; line-height: 1.3; }
.login-panel form { display: grid; gap: 9px; }
.login-panel label, .field label { color: #46514c; font-size: 13px; font-weight: 600; }
input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5d0;
  border-radius: 4px;
  outline: none;
}
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 112, 82, .12); }
.login-panel input { margin-bottom: 8px; height: 44px; }
.form-error { margin: 0 0 4px; color: var(--danger); font-size: 13px; }

.primary-button, .secondary-button, .quiet-button, .page-button {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-weight: 600;
}
.primary-button { color: #fff; background: var(--green); }
.primary-button:hover { background: var(--green-dark); }
.secondary-button, .page-button { color: #34423b; background: #fff; border-color: #cbd5d0; }
.secondary-button:hover, .page-button:hover { border-color: var(--green); color: var(--green); }
.quiet-button { min-height: 34px; padding: 0 12px; color: #fff; background: transparent; border-color: rgba(255,255,255,.34); }

.dashboard { min-height: 100vh; }
.content-width, .topbar-inner { width: min(1460px, calc(100% - 48px)); margin: 0 auto; }
.topbar { height: 64px; color: #fff; background: #1f2924; }
.topbar-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 17px; }
.brand span { color: #aebbb4; font-size: 11px; }
.account-area { display: flex; align-items: center; gap: 14px; }
.data-nav { background: #fff; border-bottom: 1px solid var(--line); }
.data-nav-inner { min-height: 58px; display: flex; align-items: stretch; justify-content: space-between; gap: 28px; }
.source-switch { display: flex; align-items: center; gap: 4px; }
.source-switch > span { margin-right: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.source-option {
  height: 34px;
  padding: 0 14px;
  color: #4d5b54;
  background: #f3f6f4;
  border: 1px solid #d8e0dc;
}
.source-option:first-of-type { border-radius: 4px 0 0 4px; }
.source-option:last-child { margin-left: -5px; border-radius: 0 4px 4px 0; }
.source-option.active { position: relative; z-index: 1; color: #fff; background: var(--green); border-color: var(--green); }
.tab-list { display: flex; gap: 28px; min-width: 180px; }
.tab { position: relative; padding: 0 4px; color: #58655f; background: none; border: 0; font-weight: 600; }
.tab.active { color: var(--green); }
.tab.active::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--green); }

.workspace { padding-top: 24px; padding-bottom: 36px; }
.query-bar {
  display: grid;
  grid-template-columns: 170px 170px minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
}
.field { display: grid; gap: 7px; }
.query-button { min-width: 88px; }
.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.summary-strip div { min-width: 0; padding: 15px 18px; border-right: 1px solid var(--line); }
.summary-strip div:last-child { border-right: 0; }
.summary-strip span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.summary-strip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }

.data-section { margin-top: 16px; background: #fff; border: 1px solid var(--line); }
.section-heading { min-height: 72px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.status-message { min-height: 260px; display: grid; place-items: center; color: var(--muted); }
.status-message.error { color: var(--danger); }
.table-scroll { width: 100%; max-height: calc(100vh - 390px); min-height: 260px; overflow: auto; }
table { width: 100%; min-width: 1100px; border-collapse: collapse; }
th, td { height: 43px; padding: 8px 12px; border-right: 1px solid #edf1ef; border-bottom: 1px solid #e5ebe8; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; color: #405049; background: #f1f5f3; font-size: 12px; }
td { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
tbody tr:hover { background: #f7faf8; }
.pagination { min-height: 58px; padding: 9px 18px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; border-top: 1px solid var(--line); }
.page-button { min-height: 34px; padding: 0 13px; }
#page-info { color: var(--muted); font-size: 13px; }

@media (max-width: 820px) {
  .content-width, .topbar-inner { width: min(100% - 24px, 1460px); }
  .topbar { height: 58px; }
  .brand div span, #account-name { display: none; }
  .data-nav-inner { min-height: 104px; display: grid; gap: 0; }
  .source-switch { min-width: 0; overflow-x: auto; }
  .tab-list { height: 46px; gap: 22px; }
  .workspace { padding-top: 12px; }
  .query-bar { grid-template-columns: 1fr 1fr; padding: 14px; }
  .product-field { grid-column: 1 / -1; }
  .query-button, .query-bar > .secondary-button { width: 100%; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-strip div:nth-child(even) { border-right: 0; }
  .summary-strip div:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .summary-strip div:last-child { grid-column: 1 / -1; border-right: 0; }
  .section-heading { align-items: flex-start; }
  .table-scroll { max-height: 58vh; }
}

@media (max-width: 460px) {
  .login-panel { padding: 28px 22px; }
  .query-bar { grid-template-columns: 1fr; }
  .product-field { grid-column: auto; }
  .summary-strip { grid-template-columns: 1fr; }
  .summary-strip div:last-child { grid-column: auto; }
  .summary-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-strip div:last-child { border-bottom: 0; }
  .section-heading { display: grid; }
  #export-button { width: 100%; }
}
