:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --line: #dddddd;
  --line-strong: #c1c1c1;
  --text: #222222;
  --muted: #6a6a6a;
  --primary: #ff385c;
  --primary-dark: #e00b41;
  --primary-soft: #fff0f3;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fff7ed;
  --danger: #c13515;
  --danger-soft: #fff4f0;
  --shadow: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px, rgba(0, 0, 0, 0.1) 0 4px 8px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

html.auth-pending body[data-auth-required] {
  visibility: hidden;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, Circular, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 56, 92, 0.08), transparent 24rem),
    radial-gradient(circle at 92% 18%, rgba(255, 209, 218, 0.32), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 18px 24px 24px;
  color: #4f625b;
  font-size: 13px;
  text-align: center;
}

.site-footer a {
  text-decoration: underline;
  text-decoration-color: rgba(79, 98, 91, 0.36);
  text-underline-offset: 3px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #006241;
  text-decoration-color: currentColor;
}

.dark-editorial-login-page .site-footer {
  color: rgba(242, 240, 235, 0.78);
}

.dark-editorial-login-page .site-footer a:hover,
.dark-editorial-login-page .site-footer a:focus-visible {
  color: #f2f0eb;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 80px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(221, 221, 221, 0.72);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  box-shadow: none;
  font-size: 17px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 48px) 56px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-heading h1,
.page-heading h2,
.card h2,
.card h3 {
  margin: 0;
  letter-spacing: -0.025em;
}

.page-heading h1 {
  font-size: clamp(24px, 3vw, 28px);
  font-weight: 700;
}

.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 28px rgba(34, 34, 34, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
}

.card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card-body {
  padding: 0 24px 24px;
}

.stack {
  display: grid;
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(240px, 1fr) minmax(280px, 1.45fr) auto;
  gap: 14px;
  align-items: end;
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.field small {
  display: block;
  min-height: 20px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.control {
  width: 100%;
  height: 56px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  background: #fff;
  transition: border-color 0.18s ease;
}

.control:focus {
  border-width: 2px;
  border-color: var(--text);
  box-shadow: none;
}

.control[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: none;
}

input[type="file"].control {
  padding: 13px 10px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 23px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  text-decoration: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  color: #fff;
  background: var(--primary);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  border-color: var(--text);
  background: #fff;
}

.button-quiet {
  color: var(--text);
  background: transparent;
}

.button-small {
  min-height: 40px;
  padding: 9px 13px;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.badge-neutral {
  color: #555;
  background: #f2f2f2;
}

.badge-success {
  color: #047857;
  background: var(--success-soft);
}

.badge-warning {
  color: #b45309;
  background: var(--warning-soft);
}

.badge-danger {
  color: #b91c1c;
  background: var(--danger-soft);
}

.badge-primary {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.notice {
  display: none;
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 14px;
}

.notice.is-visible {
  display: block;
}

.notice-success {
  color: #047857;
  background: var(--success-soft);
}

.notice-error {
  color: #b91c1c;
  background: var(--danger-soft);
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  scrollbar-color: #94a3b8 #eef2f7;
}

.data-table {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 600;
}

.data-table td {
  font-size: 14px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fbfdff;
}

.cell-main {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.cell-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.muted {
  color: var(--muted);
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  background: #fff;
}

.login-intro {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(34px, 6vw, 78px);
  color: var(--text);
  background: #fff;
}

.login-intro::after {
  position: absolute;
  right: -12%;
  bottom: -14%;
  width: min(520px, 55vw);
  height: min(520px, 55vw);
  border: 1px solid #ffd1da;
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 56, 92, 0.055), 0 0 0 145px rgba(255, 56, 92, 0.03);
  content: "";
}

.login-intro .brand {
  position: relative;
  z-index: 1;
}

.login-intro .brand-mark {
  color: #fff;
  background: var(--primary);
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.login-copy h1 {
  max-width: 540px;
  margin: 0;
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.login-copy p {
  max-width: 520px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.login-points {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-point {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  font-size: 13px;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 36px clamp(24px, 7vw, 100px);
  border-left: 1px solid rgba(221, 221, 221, 0.66);
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 56, 92, 0.15), transparent 18rem),
    radial-gradient(circle at 88% 78%, rgba(255, 209, 218, 0.48), transparent 22rem),
    linear-gradient(145deg, #f9f9f9 0%, #f2f2f2 100%);
}

.auth-box {
  width: min(430px, 100%);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 54px rgba(34, 34, 34, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
}

.auth-box h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.auth-box > p {
  margin: 8px 0 24px;
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 22px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(242, 242, 242, 0.66);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tab-button {
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  font-weight: 500;
}

.tab-button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.auth-form {
  display: none;
  gap: 15px;
}

.auth-form.is-active {
  display: grid;
}

.auth-form .button {
  width: 100%;
  margin-top: 5px;
}

.prototype-note {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed #ffb4c2;
  border-radius: 8px;
  color: #92174d;
  background: rgba(255, 240, 243, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
}

.report-shell {
  width: min(1800px, 100%);
  margin: 0 auto;
  padding: 22px clamp(12px, 2vw, 30px) 34px;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.report-frame-card {
  overflow: hidden;
  min-height: 680px;
}

.report-loading {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
}

.report-frame {
  display: none;
  width: 100%;
  height: calc(100vh - 208px);
  min-height: 680px;
  border: 0;
  background: #fff;
}

.report-frame.is-ready {
  display: block;
}

@media (max-width: 980px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid .button {
    width: 100%;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-intro {
    min-height: auto;
    gap: 54px;
    padding: 34px 28px 44px;
  }

  .login-intro .login-points {
    display: none;
  }

  .login-panel {
    min-height: auto;
    padding: 44px 24px 64px;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 64px;
    padding: 10px 14px;
  }

  .brand {
    gap: 9px;
    font-size: 16px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .topbar .badge,
  .topbar .user-label {
    display: none;
  }

  .page {
    padding: 20px 12px 40px;
  }

  .page-heading {
    display: block;
    margin-bottom: 16px;
  }

  .page-heading .button {
    width: 100%;
    margin-top: 14px;
  }

  .card {
    border-radius: 14px;
  }

  .card-header {
    padding: 18px 16px 14px;
  }

  .card-body {
    padding: 0 16px 18px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 860px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 13px;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 154px;
    background: #fff;
    box-shadow: 7px 0 12px rgba(15, 23, 42, 0.05);
  }

  .data-table th:first-child {
    z-index: 3;
    background: var(--surface-soft);
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .pagination {
    width: 100%;
  }

  .pagination .button {
    flex: 1;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-copy p {
    font-size: 15px;
  }

  .report-shell {
    padding: 14px 8px 24px;
  }

  .report-frame-card {
    border-radius: 14px;
  }

  .report-frame {
    height: calc(100vh - 174px);
    min-height: 620px;
  }
}
