:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --danger: #dc2626;
  --warn: #f59e0b;
  --ok: #16a34a;
  --active-tab-text: #1d4ed8;
  --active-tab-bg: rgba(37, 99, 235, 0.14);
  --interactive-hover: rgba(148, 163, 184, 0.1);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --card: #0f172a;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.2);
    --active-tab-text: #dbeafe;
    --active-tab-bg: rgba(37, 99, 235, 0.32);
    --interactive-hover: rgba(148, 163, 184, 0.14);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 16px 0;
  background: transparent;
  color: var(--text);
}

.link-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 10px;
}

.main {
  padding: 12px 12px 140px;
  max-width: 640px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.card__title {
  margin: 0 0 12px;
  font-size: 16px;
}

.card__sub {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.notice__title {
  font-weight: 800;
  margin-bottom: 8px;
}

.notice__list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.field {
  margin-bottom: 12px;
}

.field__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.field__value {
  font-weight: 700;
  margin-top: 6px;
}

.field__help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.input {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px;
  outline: none;
}

.input:focus {
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.captcha-row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.captcha-image {
  display: block;
  width: 132px;
  height: 44px;
  flex: 0 0 132px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  object-fit: cover;
  cursor: pointer;
}

.row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.row--between {
  justify-content: space-between;
}

.row--center {
  align-items: center;
}

.row--compact {
  gap: 6px;
}

.agreement-consent {
  margin: -2px 0 14px;
}

.agreement-consent__label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.agreement-consent__checkbox {
  margin: 2px 0 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.agreement-consent__link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.agreement-consent__link:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mt-8 {
  margin-top: 8px;
}

.mt-10 {
  margin-top: 10px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  font-size: 13px;
  touch-action: manipulation;
  white-space: nowrap;
}

.tab.active {
  background: var(--active-tab-bg);
  border-color: rgba(37, 99, 235, 0.55);
  color: var(--active-tab-text);
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2px;
  touch-action: manipulation;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-2);
}

.btn.ghost {
  background: transparent;
}

.radio {
  display: flex;
  gap: 10px;
}

.radio__item {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.radio input {
  transform: scale(1.1);
}

@media (max-width: 480px) {
  .captcha-image {
    width: 120px;
    flex-basis: 120px;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.vol-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.vol-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.vol-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vol-item__title {
  font-weight: 900;
}

.vol-item__name {
  margin-top: 8px;
  font-weight: 800;
}

.tag {
  font-size: 12px;
  font-weight: 900;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.tag.ok {
  color: var(--ok);
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.08);
}

.tag.warn {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.tag.fav {
  color: var(--primary-2);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
}

.tag.bad {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
}

.tag.na {
  opacity: 0.7;
}

.vol-item__meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

@media (prefers-color-scheme: dark) {
  .bottombar {
    background: rgba(15, 23, 42, 0.85);
  }
}

.bottombar__actions {
  display: flex;
  gap: 10px;
  padding: 10px 12px 12px;
  max-width: 640px;
  margin: 0 auto;
}

.bottombar__actions .btn {
  flex: 1;
}

.safe-area {
  height: env(safe-area-inset-bottom);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px 12px 0;
  max-width: 640px;
  margin: 0 auto;
}

.stepper__item {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  padding: 8px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.stepper__item.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78vh, 720px);
  background: var(--card);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.sheet__title {
  font-weight: 900;
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
}

.sheet__body {
  padding: 12px;
  overflow: auto;
}

.sheet-search {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.sheet-search .input {
  flex: 1;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.select {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 11px 10px;
  font-size: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quota-junior-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quota-junior-option {
  appearance: none;
  display: block;
  width: 100%;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.quota-junior-option:hover,
.quota-junior-option:focus-visible {
  background: var(--interactive-hover);
  border-color: rgba(88, 133, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(88, 133, 255, 0.12);
  outline: none;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.list-item__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.list-item__name {
  font-weight: 900;
  line-height: 1.25;
}

.list-item__meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.list-item__actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn.small {
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 900;
}

.btn.danger {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.06);
}

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 30;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  box-shadow: var(--shadow);
  max-width: 640px;
  margin: 0 auto;
}

.report {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report__title {
  font-weight: 950;
  font-size: 16px;
}

.report__kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.kpi__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi__value {
  margin-top: 6px;
  font-weight: 950;
  font-size: 14px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.report-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.report-card__name {
  font-weight: 950;
}

.report-card__body {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.report-warning {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail__section-title {
  font-weight: 950;
  margin-top: 6px;
}

.mini-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.35;
}

.mini-table th,
.mini-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  white-space: nowrap;
  word-break: keep-all;
  text-align: left;
  vertical-align: top;
}

.mini-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  font-weight: 950;
}

.sparkline {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(148, 163, 184, 0.06);
}

.sparkline svg {
  width: 100%;
  height: 120px;
  display: block;
}

.recos {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recos__group-title {
  font-weight: 950;
}
