:root {
  color: #e7f1ff;
  background: #071426;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: #071426; color: #e7f1ff; }
a { color: #6eb6ff; text-decoration: none; }
a:hover { color: #b9dcff; }
h1, h2 { line-height: 1.3; margin: 0 0 12px; color: #ffffff; }
p { margin: 0 0 10px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #12386f; color: #fff; padding: 6px 10px; }
.site-header { background: #07182f; border-bottom: 1px solid rgba(70, 130, 210, 0.28); }
.header-inner, .wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.header-inner { min-height: 64px; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: #ffffff; font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.nav a, .nav button { color: #d5e6fb; background: transparent; border: 0; padding: 0; font: inherit; cursor: pointer; }
.nav a:hover, .nav button:hover { color: #ffffff; }
.logout { margin-left: auto; }
main { padding: 28px 0 48px; }
.card, .table-wrap, form.stack, .stats { background: #0d2244; border: 1px solid #1d4b86; border-radius: 12px; }
.card, form.stack { padding: 18px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 12px; }
.stat { padding: 8px 10px; }
.stat span { display: block; color: #9eb6d8; font-size: 13px; }
.stat strong { font-size: 22px; color: #ffffff; }
.section-head { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid #1a3f72; text-align: left; vertical-align: top; color: #e7f1ff; }
th { color: #8eb4e0; font-size: 13px; font-weight: 650; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
label { display: block; font-weight: 650; margin: 12px 0 6px; }
input, select, textarea { width: 100%; max-width: 420px; min-height: 40px; border: 1px solid #24528f; border-radius: 8px; padding: 8px 10px; font: inherit; background: #0a1c3a; color: #f4f8ff; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; margin-right: 6px; accent-color: #1a7cff; }
textarea { min-height: 80px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.filters label { margin: 0; font-size: 13px; color: #b7ccea; }
.filters input, .filters select { max-width: 180px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent; background: #1a7cff; color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
.button.secondary, button.secondary { background: transparent; color: #e7f1ff; border-color: #3d6eae; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.help, .muted { color: #9eb6d8; font-size: 14px; }
.errorlist, .auth-error { color: #ffb4b4; padding-left: 0; margin: 0 0 8px; }
.messages { list-style: none; padding: 0; }
.messages li { background: rgba(24, 92, 64, 0.45); border: 1px solid #2f8f68; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.messages .error { background: rgba(120, 32, 32, 0.4); border-color: #c45a5a; }
.banner { background: rgba(92, 64, 18, 0.35); border: 1px solid #b8893a; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.pager { display: flex; gap: 12px; margin-top: 14px; }
ul.choices { list-style: none; padding: 0; }
ul.choices li { margin: 6px 0; }

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(36, 112, 255, 0.38), transparent 46%),
    radial-gradient(ellipse at 18% 78%, rgba(18, 70, 170, 0.28), transparent 42%),
    #06122c;
}
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  width: min(1180px, calc(100% - 72px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 440px);
  gap: 56px;
  align-items: center;
}
.auth-center .auth-shell {
  grid-template-columns: minmax(320px, 440px);
  justify-content: center;
  width: min(440px, calc(100% - 32px));
  gap: 0;
}
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: #f3f8ff; font-weight: 700; font-size: 18px; }
.auth-hero h1 { margin: 28px 0 0; font-size: 56px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.18; }
.auth-hero h1 span { color: #2f8bff; }
.auth-lead { margin: 18px 0 0; color: #9eb6d4; font-size: 16px; letter-spacing: 0.08em; }
.auth-scene { width: min(100%, 620px); height: auto; margin-top: 12px; display: block; }
.auth-card {
  background: rgba(8, 28, 66, 0.78);
  border: 1px solid rgba(88, 150, 230, 0.38);
  border-radius: 18px;
  padding: 36px 32px 22px;
}
.auth-card h2 { margin: 0 0 8px; font-size: 32px; font-weight: 750; }
.auth-sub { margin: 0 0 22px; color: #9eb4d2; font-size: 14px; }
.auth-card label { margin: 14px 0 8px; font-size: 14px; font-weight: 650; }
.field { position: relative; }
.field svg { position: absolute; left: 14px; top: 13px; width: 18px; height: 18px; color: #8eafd6; }
.field input { max-width: none; min-height: 46px; padding: 0 44px; border-radius: 10px; background: #0b2146; border-color: #2a5ea8; }
.field input::placeholder { color: #7f9dc4; }
.eye { position: absolute; right: 8px; top: 7px; width: 34px; height: 32px; padding: 0; background: transparent; color: #9ec0e6; }
.eye svg { position: static; width: 18px; height: 18px; }
.remember { display: flex; align-items: center; gap: 8px; margin: 16px 0 18px; font-weight: 500; color: #d5e6f8; }
.remember input { width: 16px; height: 16px; }
.auth-submit { width: 100%; min-height: 48px; border-radius: 10px; background: #1a7cff; font-size: 16px; }
.auth-submit:hover { background: #3b90ff; }
.auth-switch { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 22px 0 8px; color: #9eb4d2; font-size: 14px; }
.auth-switch span { width: 54px; height: 1px; background: rgba(120, 160, 210, 0.45); }
.auth-switch a { color: #3d97ff; }
.auth-foot { margin: 8px 0 0; text-align: center; color: #6f8eb8; font-size: 12px; }
.auth-hint { margin: 6px 0 0; color: #8eabcc; font-size: 13px; }
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; width: min(480px, calc(100% - 32px)); padding: 28px 0 40px; gap: 28px; }
  .auth-center .auth-shell { width: min(440px, calc(100% - 32px)); padding: 0; }
  .auth-card { order: 1; }
  .auth-hero { order: 2; }
  .auth-hero h1 { font-size: 40px; }
  .auth-scene { display: none; }
}
@media (max-width: 480px) {
  .auth-center .auth-shell { width: min(440px, calc(100% - 24px)); }
  .auth-card { padding: 28px 16px 16px; }
  .auth-card h2 { font-size: 26px; }
}
@media (max-width: 800px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .header-inner { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .logout { margin-left: 0; }
  .nav { width: 100%; }
  .wrap { width: min(1120px, calc(100% - 24px)); }
}

.user-app { background: #07111f; }
.user-frame { display: flex; min-height: 100vh; align-items: stretch; }
.side {
  width: 232px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: #081424;
  border-right: 1px solid rgba(80, 140, 210, 0.22);
  padding: 18px 14px 16px;
}
.side-brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 0; }
.side-brand strong, .side-brand small { display: block; }
.side-brand strong { font-size: 15px; line-height: 1.3; }
.side-brand small { color: #8eabcc; font-size: 12px; font-weight: 500; }
.side-nav, .side-foot { display: flex; flex-direction: column; gap: 4px; }
.side-nav { margin-top: 22px; }
.side-foot { margin-top: auto; padding-top: 16px; }
.side a, .side button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #d5e4f7;
  font-weight: 500;
  text-align: left;
  justify-content: flex-start;
}
.side a svg, .side button svg { width: 18px; height: 18px; flex: none; }
.side a:hover, .side button:hover { background: rgba(26, 115, 255, 0.16); color: #fff; }
.side a.active { background: #1a73ff; color: #fff; }
.side .chev, .shortcut .go { margin-left: auto; color: #8eabcc; font-size: 18px; line-height: 1; }
.side a.active .chev { color: #fff; }
.user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(80, 140, 210, 0.2);
  color: #9eb6d4;
  font-size: 14px;
  background: #07111f;
}
.top-tools { display: flex; align-items: center; gap: 10px; }
.top-account, .top-logout { display: none; }
.top-logout button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #3d6eae;
  background: transparent;
  color: #d5e6f8;
  font-weight: 650;
}
.top-account.active { color: #fff; }
.user-content { padding: 26px 28px 48px; }
.page-head { margin-bottom: 14px; }
.page-head h1 { font-size: 28px; margin: 0 0 6px; }
.page-head p { margin: 0; color: #9eb6d8; }
.note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #1d4e86;
  border-radius: 10px;
  background: rgba(18, 58, 112, 0.45);
  color: #d5e6f8;
  font-size: 14px;
}
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 14px;
  background: #0d2244;
  border: 1px solid #1d4b86;
  border-radius: 12px;
}
.metric-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.metric-icon svg { width: 20px; height: 20px; }
.icon-blue { background: rgba(26, 115, 255, 0.18); color: #7eb6ff; }
.icon-purple { background: rgba(124, 107, 255, 0.18); color: #b9b0ff; }
.icon-orange { background: rgba(245, 165, 36, 0.16); color: #ffc56b; }
.icon-green { background: rgba(34, 197, 139, 0.16); color: #7df0b8; }
.metric-label { display: block; color: #9eb6d8; font-size: 13px; }
.metric strong { display: block; color: #fff; font-size: 22px; line-height: 1.25; }
.dash-split { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; margin-bottom: 14px; }
.panel { background: #0d2244; border: 1px solid #1c467e; border-radius: 14px; padding: 16px 18px 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head span, .panel-head a { color: #9eb6d8; font-size: 14px; }
.mix { display: flex; height: 38px; border-radius: 8px; overflow: hidden; background: #0a1c38; }
.mix span { display: flex; align-items: center; justify-content: center; min-width: 72px; color: #fff; font-weight: 700; font-size: 14px; }
.mix-pending { background: #1a7cff; }
.mix-paid { background: #1fbf7a; }
.mix-empty { align-items: center; justify-content: center; color: #9eb6d8; font-size: 14px; }
.legend { display: flex; gap: 18px; margin-top: 12px; color: #d5e6f8; font-size: 14px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-pending { background: #1a7cff; }
.dot-paid { background: #1fbf7a; }
.shortcut {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-top: 1px solid #1a3d6e;
  color: #e7f1ff;
}
.shortcut svg { width: 18px; height: 18px; color: #8eb6e8; }
.panel .shortcut:first-of-type { border-top: 0; }
.user-app .panel .table-wrap { background: transparent; border: 0; border-radius: 0; }
.user-app .table-wrap { background: #0d2244; }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid #3d6eae; color: #d5e6f8; font-size: 12px; }
.pill-wait { color: #ffc56b; background: rgba(245, 165, 36, 0.14); border-color: rgba(245, 165, 36, 0.5); }
.pill-paid { color: #7df0b8; background: rgba(34, 197, 139, 0.14); border-color: rgba(34, 197, 139, 0.5); }
.note svg { flex: none; }
.account-panel { display: inline-block; min-width: min(360px, 100%); }
.account-panel span { display: block; color: #9eb6d8; font-size: 13px; }
.account-panel strong { font-size: 20px; }
.apply-form { margin-bottom: 16px; }
.apply-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; }
.apply-wide { grid-column: 1 / -1; }
.apply-form label { margin: 0; font-size: 14px; }
.apply-form .auth-error { display: block; margin-top: 4px; }
.apply-form input, .apply-form select { max-width: none; width: 100%; margin-top: 8px; }
.apply-form .is-hidden { display: none; }
.apply-form input[readonly] { background: #07162e; color: #d7e6f8; }
.percent-field { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.percent-field input { margin-top: 0; width: auto; flex: 1; min-width: 0; }
.percent-suffix {
  width: 46px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid #24528f;
  border-radius: 8px;
  background: #0a1c3a;
  color: #d5e6f8;
}
.apply-form > button { margin-top: 18px; }
.record-panel { margin-top: 0; }
.user-app .pager { flex-wrap: wrap; align-items: center; margin-top: 14px; }
.user-app .pager a, .user-app .pager span { min-height: 36px; display: inline-flex; align-items: center; color: #d5e6f8; text-decoration: none; }
.user-app .pager a { padding: 0 12px; border: 1px solid #24528f; border-radius: 8px; background: #0a1c3a; }
.user-app .pager .pager-disabled { color: #6d86a8; }
.detail-filter { margin-bottom: 16px; }
.detail-filter h2, .record-panel h2 { display: inline-flex; align-items: center; gap: 8px; }
.detail-filter h2 svg, .record-panel h2 svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.quick-row > span { color: #9eb6d8; font-size: 13px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border: 1px solid #24528f; border-radius: 8px; background: #0a1c3a; color: #d5e6f8; text-decoration: none; }
.chip.is-on { background: #1a73ff; border-color: #1a73ff; color: #fff; }
.filter-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; grid-column: 1 / -1; }
.filter-summary div { min-width: 0; padding: 12px 14px; border: 1px solid #24528f; border-radius: 10px; background: #0a1c3a; }
.filter-summary span, .filter-summary em { display: block; color: #9eb6d8; font-style: normal; font-size: 12px; }
.filter-summary strong { display: block; margin: 4px 0; color: #fff; font-size: 22px; font-variant-numeric: tabular-nums; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; align-items: end; }
.detail-filter label { margin: 0; font-size: 13px; color: #9eb6d8; }
.detail-filter input, .detail-filter select { max-width: none; width: 100%; margin-top: 8px; }
.date-field { position: relative; display: block; }
.date-field .date-display { padding-right: 42px; cursor: pointer; }
.date-open {
  position: absolute; right: 4px; top: 12px; width: 32px; height: 32px; min-height: 32px;
  padding: 0; border: 0; background: transparent; color: #9eb6d8;
}
.date-open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.date-pop {
  display: none; position: fixed; z-index: 40; padding: 12px;
  border: 1px solid #24528f; border-radius: 12px; background: #10284d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.date-field.is-open .date-pop { display: block; }
.date-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.date-nav strong { font-size: 14px; color: #f4f8ff; }
.date-nav button, .date-clear {
  min-height: 32px; background: #0a1c3a; color: #d5e6f8; border: 1px solid #24528f;
}
.date-nav button { width: 32px; padding: 0; }
.date-week, .date-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.date-week { margin-bottom: 4px; }
.date-week span, .date-empty { min-height: 32px; display: grid; place-items: center; color: #8eb4e0; font-size: 12px; }
.date-day {
  min-height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: #f4f8ff;
}
.date-day.is-today { box-shadow: inset 0 0 0 1px #3d6eae; }
.date-day.is-on { background: #1a73ff; color: #fff; }
.date-clear { width: 100%; margin-top: 8px; }
.filter-actions { display: flex; gap: 8px; grid-column: 2 / -1; justify-content: flex-end; }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; color: #8eb4e0; font-size: 13px; }
.user-app .pager .current { min-width: 36px; padding: 0 10px; border-radius: 8px; background: #1a73ff; color: #fff; justify-content: center; }
.remark-input { width: 100%; max-width: 280px; min-height: 36px; }
.reject-reason { display: block; margin-top: 4px; color: #ffb4b4; font-size: 12px; }
.pill-ok { color: #7df0b8; background: rgba(34, 197, 139, 0.14); border-color: rgba(34, 197, 139, 0.5); }
.pill-review { color: #ffd56b; background: rgba(214, 168, 40, 0.16); border-color: rgba(214, 168, 40, 0.55); }
.pill-no { color: #ffb4b4; background: rgba(180, 60, 60, 0.2); border-color: rgba(196, 90, 90, 0.55); }
@media (max-width: 1100px) {
  .metric-row { grid-template-columns: 1fr 1fr; }
  .dash-split { grid-template-columns: 1fr; }
  .user-app .detail-grid { grid-template-columns: 1fr 1fr; }
  .user-app .filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .user-main { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .user-app .side-brand, .user-app .side-foot { display: none !important; }
  .user-app .side {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex !important;
    flex-direction: row !important;
    width: auto;
    min-height: 0;
    border-right: 0;
    border-top: 1px solid rgba(80, 140, 210, 0.28);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  }
  .user-app .side-nav {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: row !important;
    width: 100% !important;
    min-width: 0;
    margin: 0;
    gap: 2px;
  }
  .user-app .side-nav a {
    flex: 1 1 0 !important;
    width: auto !important;
    min-height: 54px;
    flex-direction: column !important;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: 11px;
    text-align: center;
  }
  .side-nav a svg { width: 20px; height: 20px; }
  .topbar { position: sticky; top: 0; z-index: 20; align-items: flex-start; flex-wrap: wrap; padding: 12px 16px; }
  .top-account, .top-logout { display: block; }
  .usd { display: none; }
  .crumb { min-width: 0; }
  .user-content { padding: 16px 16px 20px; }
  .page-head h1 { font-size: 24px; }
  .metric-row { grid-template-columns: 1fr 1fr; }
  .metric { padding: 12px; gap: 8px; min-height: 0; }
  .metric-icon { width: 34px; height: 34px; }
  .metric strong { font-size: 18px; }
  .note { align-items: flex-start; }
  .panel { padding: 14px; }
  .mix span { min-width: 0; padding: 0 6px; font-size: 13px; }
  .legend { flex-wrap: wrap; gap: 8px 14px; }
  .user-app .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
  .user-app .filters label, .user-app .filters input, .user-app .filters select { max-width: none; width: 100%; min-width: 0; }
  .user-app .filters label:nth-of-type(n+3), .user-app .filters button { grid-column: 1 / -1; }
  .user-app .table-wrap { overflow: visible; background: transparent; border: 0; }
  .user-app table, .user-app tbody, .user-app tr { display: block; width: 100%; }
  .user-app thead { display: none; }
  .user-app tbody tr {
    margin: 0 0 12px;
    padding: 4px 12px;
    border: 1px solid #1d4b86;
    border-radius: 12px;
    background: #0d2244;
  }
  .user-app td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: auto;
    padding: 8px 0;
    text-align: right;
    border-bottom: 1px solid #16345f;
  }
  .user-app td::before {
    content: attr(data-label);
    color: #9eb6d8;
    font-size: 13px;
    text-align: left;
    flex: none;
  }
  .user-app td[colspan] { display: block; text-align: center; }
  .user-app td[colspan]::before { content: none; }
  .user-app tr td:last-child { border-bottom: 0; }
  .user-app td form { display: flex; flex: 1; gap: 8px; min-width: 0; justify-content: flex-end; }
  .user-app td form input { width: auto; max-width: none; flex: 1; min-width: 0; }
  .user-app .stack input, .user-app .stack select, .user-app .stack textarea { max-width: none; }
  .apply-grid { grid-template-columns: 1fr; }
  .apply-wide { grid-column: auto; }
  .remark-input { max-width: none; flex: 1; min-width: 0; width: auto; }
  .user-app .detail-grid { grid-template-columns: 1fr; }
  .filter-summary strong { font-size: 18px; }
  .user-app .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .user-app .list-foot { align-items: flex-start; }
}
