:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ec;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --accent: #176b4d;
  --accent-hover: #11583e;
  --accent-soft: #eaf5f0;
  --focus: #267e61;
  --danger: #a43b32;
  --danger-soft: #fff2f0;
  --success: #176b4d;
  --success-soft: #edf8f3;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface-soft); color: var(--ink); }
body { min-height: 100vh; margin: 0; background: linear-gradient(180deg, #fff 0, #f6f8fb 460px); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { letter-spacing: 0; }
a { color: inherit; }
.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(223, 229, 236, 0.94);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(22px) saturate(150%);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.home-link { padding: 8px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.home-link:hover { color: var(--accent); }
.service-status { color: var(--muted); font-size: 13px; white-space: nowrap; }

.workspace { width: min(1440px, 100%); min-height: calc(100vh - 250px); margin: 0 auto; padding: 42px clamp(18px, 4vw, 52px) 72px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 700; }
.muted { color: var(--muted); }

.auth-layout { min-height: calc(100vh - 250px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 480px); align-items: center; gap: clamp(44px, 8vw, 120px); }
.auth-intro { max-width: 700px; }
.auth-intro h1 { max-width: 650px; margin: 0; font-size: clamp(38px, 5vw, 66px); line-height: 1.12; font-weight: 650; }
.auth-intro > p:not(.eyebrow) { max-width: 620px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.9; }
.auth-points { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 32px; }
.auth-points span { position: relative; padding-left: 18px; color: #39445a; font-size: 13px; font-weight: 650; }
.auth-points span::before { position: absolute; left: 0; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); content: ""; }
.auth-panel { padding: 34px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 22px 60px rgba(28, 42, 59, .10); }
.auth-panel h2 { margin: 28px 0 0; font-size: 28px; }
.auth-panel > .muted { margin: 8px 0 0; font-size: 13px; line-height: 1.65; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border: 1px solid #d4dae2; border-radius: 9px; background: #eef1f5; }
.segmented button { min-height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 650; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(30, 40, 55, .12); }
.auth-form { display: grid; gap: 17px; margin-top: 26px; }

.field { min-width: 0; display: grid; gap: 8px; color: #39445a; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #bec8d4; border-radius: 8px; outline: none; background: #fff; color: var(--ink); transition: border-color .14s ease, box-shadow .14s ease; }
input, select { min-height: 44px; padding: 9px 12px; }
textarea { min-height: 88px; padding: 11px 12px; resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(23,107,77,.13); }
input::placeholder, textarea::placeholder { color: #98a2b3; }

.button { min-height: 39px; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 650; transition: background-color .14s ease, border-color .14s ease, color .14s ease; }
.button:disabled { cursor: wait; opacity: .62; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: var(--surface-soft); }
.button.quiet { background: transparent; color: var(--muted); }
.button.quiet:hover:not(:disabled) { background: #eef1f5; color: var(--ink); }
.button.full { width: 100%; min-height: 46px; margin-top: 2px; }

.message { margin: 0 0 20px; padding: 12px 14px; border: 1px solid #b7d9ca; border-radius: 8px; background: var(--success-soft); color: var(--success); font-size: 13px; line-height: 1.6; }
.message.error { border-color: #ebc0bb; background: var(--danger-soft); color: var(--danger); }
.message.success { border-color: #b7d9ca; background: var(--success-soft); color: var(--success); }
.auth-panel .message { margin: 0; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.page-heading h1 { margin: 0; font-size: 34px; line-height: 1.2; }
.page-heading .muted { margin: 9px 0 0; font-size: 13px; }
.process { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.process i { width: 34px; height: 1px; background: #cbd3dc; }

.business-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 410px); align-items: start; gap: 24px; }
.business-form, .history-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 32px rgba(27, 39, 55, .05); }
.business-form { padding: clamp(22px, 3vw, 36px); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading > div { display: flex; align-items: center; gap: 11px; }
.section-heading span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 750; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.section-divider { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 18px; }
.span-two { grid-column: 1 / -1; }
.privacy-note { margin: 21px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.submit-button { width: 100%; min-height: 48px; margin-top: 17px; font-size: 14px; }

.history-panel { position: sticky; top: 92px; overflow: hidden; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 23px 24px 20px; border-bottom: 1px solid var(--line); }
.history-heading h2 { margin: 0; font-size: 20px; }
.count-badge { min-width: 29px; height: 29px; display: grid; place-items: center; padding: 0 8px; border-radius: 15px; background: #eef1f5; color: #4f5b6f; font-size: 12px; font-weight: 700; }
.history-list { max-height: calc(100vh - 190px); overflow: auto; padding: 16px; }
.empty-state { padding: 46px 22px; text-align: center; }
.empty-state strong { font-size: 14px; }
.empty-state p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.history-card { padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.history-card + .history-card { margin-top: 12px; }
.history-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.history-card h3 { margin: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.history-card time { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.status { flex: 0 0 auto; padding: 4px 8px; border-radius: 6px; background: #fff3dd; color: #875a10; font-size: 11px; font-weight: 700; }
.status.in_progress { background: #e9f3ff; color: #255e96; }
.status.resolved { background: var(--success-soft); color: var(--success); }
.status.closed { background: #eef1f5; color: #596579; }
.history-details { margin-top: 14px; padding-top: 12px; border-top: 1px solid #edf0f4; }
.history-detail { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; padding: 3px 0; font-size: 11px; line-height: 1.55; }
.history-detail span { color: var(--muted); }
.history-detail strong { overflow-wrap: anywhere; font-weight: 600; }
.admin-reply { margin-top: 13px; padding: 12px; border-left: 3px solid var(--accent); border-radius: 4px 7px 7px 4px; background: var(--accent-soft); }
.admin-reply span { color: var(--accent); font-size: 11px; font-weight: 750; }
.admin-reply p { margin: 5px 0 0; white-space: pre-wrap; color: #244537; font-size: 12px; line-height: 1.65; }

.compliance-footer { padding: 28px clamp(18px, 4vw, 52px) 34px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); text-align: center; }
.footer-main { width: min(1200px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto 18px; }
.footer-main strong { color: var(--ink); font-size: 14px; }
.footer-main nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; }
.compliance-footer p { margin: 5px 0; font-size: 12px; line-height: 1.7; }
.compliance-footer a { color: var(--muted); font-size: 12px; text-decoration: none; }
.compliance-footer a:hover { color: var(--ink); text-decoration: underline; }
.filing { margin-top: 17px !important; padding-top: 14px; border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .auth-layout { grid-template-columns: 1fr; gap: 38px; padding-top: 20px; }
  .auth-intro { max-width: 760px; }
  .auth-panel { width: min(540px, 100%); }
  .business-layout { grid-template-columns: 1fr; }
  .history-panel { position: static; }
  .history-list { max-height: none; }
}

@media (max-width: 680px) {
  .topbar { min-height: 62px; }
  .service-status, .home-link { display: none; }
  .workspace { padding-top: 28px; padding-bottom: 48px; }
  .auth-layout { min-height: auto; }
  .auth-intro h1 { font-size: 38px; }
  .auth-panel { padding: 24px 20px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 28px; }
  .process { width: 100%; justify-content: space-between; }
  .process i { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .business-form { padding: 22px 18px; }
  .section-heading p { display: none; }
  .footer-main { align-items: flex-start; flex-direction: column; }
  .footer-main nav { justify-content: flex-start; }
  .filing span { display: block; margin-top: 3px; }
}
