:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", Inter, system-ui, sans-serif;
  color: #173b3a;
  background: #eef4f2;
  letter-spacing: 0;
  --ink: #173b3a;
  --muted: #6c8280;
  --line: #d8e3df;
  --paper: #ffffff;
  --primary: #0b665f;
  --primary-dark: #064b46;
  --mint: #dceee9;
  --amber: #b66b18;
  --danger: #b7473d;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #eef4f2; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.hidden { display: none !important; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(380px, .8fr); }
.auth-scene { padding: clamp(40px, 7vw, 100px); background: #0c504c; color: white; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: #d6f0e8; color: #0b5d57; border-radius: 7px; }
.auth-copy { max-width: 720px; }
.eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; color: #88c8ba; margin-bottom: 18px; }
.auth-copy h1 { font-size: clamp(38px, 5vw, 72px); line-height: 1.08; margin: 0 0 22px; max-width: 760px; }
.auth-copy p { color: #c6ddd8; font-size: 17px; line-height: 1.8; max-width: 620px; }
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; }
.benefit { border-top: 1px solid rgba(255,255,255,.25); padding-top: 16px; }
.benefit strong { display: block; margin-bottom: 6px; }
.benefit span { color: #b5d1cb; font-size: 13px; }
.auth-panel { background: #fbfdfc; display: grid; place-items: center; padding: 32px; }
.auth-form { width: min(420px, 100%); }
.auth-form h2 { font-size: 30px; margin: 12px 0 8px; }
.auth-form > p { color: var(--muted); margin: 0 0 28px; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 6px; padding: 0 13px; background: white; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,102,95,.1); }
.btn { height: 44px; border: 0; border-radius: 6px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.btn-primary { color: white; background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-quiet { color: var(--primary); background: var(--mint); }
.btn-outline { color: var(--ink); background: white; border: 1px solid var(--line); }
.btn-danger { color: var(--danger); background: #fae8e6; }
.btn-block { width: 100%; }
.auth-switch { border: 0; background: none; color: var(--primary); width: 100%; margin-top: 16px; }
.notice { min-height: 22px; color: var(--danger); font-size: 13px; margin: 10px 0; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.sidebar { background: #0d3938; color: white; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 2px 8px 20px; }
.nav { display: grid; gap: 5px; }
.nav button { height: 42px; border: 0; border-radius: 6px; padding: 0 12px; display: flex; gap: 12px; align-items: center; background: transparent; color: #d7e8e4; text-align: left; }
.nav button.active, .nav button:hover { background: #1b504e; color: white; }
.nav-label { color: #7fa8a2; font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 20px 12px 7px; }
.main { min-width: 0; }
.topbar { height: 66px; padding: 0 28px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; }
.topbar h2 { font-size: 18px; margin: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: var(--primary); font-weight: 800; }
.content { max-width: 1380px; padding: 28px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 7px; font-size: 30px; }
.page-head p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 20px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 8px; font-size: 29px; }
.grid-2 { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); gap: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.hint { padding: 13px; border-left: 3px solid var(--primary); background: #eef8f5; color: #4d6e69; font-size: 13px; line-height: 1.7; margin: 14px 0; }
.hint code { white-space: normal; overflow-wrap: anywhere; word-break: break-all; }
.dns-table, .data-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.dns-table th, .dns-table td, .data-table th, .data-table td { text-align: left; border-bottom: 1px solid #e8efec; padding: 11px 9px; vertical-align: top; }
.dns-table td, .data-table td { overflow-wrap: anywhere; }
.dns-table th, .data-table th { color: var(--muted); font-weight: 700; background: #f5f8f7; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 4px; background: var(--mint); color: var(--primary); font-size: 12px; }
.tag.pending { background: #fff1d9; color: var(--amber); }
.dns-detail { display: block; margin-top: 5px; color: var(--muted); line-height: 1.45; }
.dns-input-preview { margin: -2px 0 14px; padding: 13px; color: #315f5b; background: #e8f4f1; border: 1px solid #c5ddd7; border-radius: 6px; font-size: 12px; }
.dns-input-preview-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 11px; }
.dns-input-preview-head strong, .dns-input-preview-head span { display: block; }
.dns-input-preview-head span { margin-top: 3px; color: var(--muted); line-height: 1.5; }
.preview-record { padding: 8px 0; display: grid; grid-template-columns: 38px 92px minmax(0,1fr); gap: 7px; border-top: 1px solid #cddfd9; line-height: 1.55; overflow-wrap: anywhere; }
.dns-input-preview > small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.5; }
.dns-checklist-panel { margin-top: 18px; }
.dns-checklist-panel .panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.dns-domain-block + .dns-domain-block { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.dns-domain-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.dns-domain-head small { display: block; margin-top: 7px; color: var(--muted); }
.dns-domain-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.dns-routing-note { margin-bottom: 14px; padding: 14px 16px; display: flex; gap: 11px; align-items: flex-start; color: #315f5b; background: #e8f4f1; border: 1px solid #c5ddd7; border-radius: 6px; }
.dns-routing-note strong, .dns-routing-note span { display: block; }
.dns-routing-note span { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dns-record-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.dns-record-table { width: 100%; min-width: 860px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.dns-record-table th, .dns-record-table td { padding: 11px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #e8efec; overflow-wrap: anywhere; }
.dns-record-table th { color: var(--muted); background: #f3f7f5; }
.dns-record-table th:nth-child(1) { width: 70px; }
.dns-record-table th:nth-child(2) { width: 100px; }
.dns-record-table th:nth-child(3), .dns-record-table th:nth-child(4) { width: 300px; }
.dns-record-table th:nth-child(5) { width: 90px; }
.dns-record-table tr:last-child td { border-bottom: 0; }
.dns-value { display: flex; align-items: flex-start; gap: 7px; }
.dns-value span, .dns-actual { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.dns-value span { flex: 1; }
.dns-value span small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.45; }
.dns-actual { color: #55706d; }
.dns-actual.missing { color: var(--amber); }
.icon-btn-small { flex: 0 0 auto; width: 28px; height: 28px; }
.dns-empty-note { padding: 18px; display: flex; align-items: center; gap: 10px; color: var(--amber); background: #fff7e8; border: 1px solid #f0d5aa; border-radius: 6px; }
.mailbox-warning { display: block; width: max-content; margin-top: 5px; padding: 2px 6px; border-radius: 4px; background: #fff1d9; color: var(--amber); font-size: 11px; font-weight: 700; }
.btn:disabled, .icon-btn:disabled, select:disabled { cursor: not-allowed; opacity: .55; }
.generator { display: grid; grid-template-columns: 1.2fr .55fr .8fr 1fr auto; align-items: end; gap: 12px; }
.generator .field { margin: 0; }
.mailbox-list { display: grid; gap: 8px; margin-top: 16px; }
.mailbox-row { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(180px, .8fr) minmax(220px, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.mailbox-row strong, .mailbox-row code, .mailbox-row a { overflow-wrap: anywhere; }
.mailbox-row code { color: #5c5141; font-size: 12px; }
.mailbox-row a { color: var(--primary); font-size: 12px; }
.row-actions { display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); display: grid; place-items: center; }
.empty { padding: 52px 20px; color: var(--muted); text-align: center; }
.inbox-layout { display: grid; grid-template-columns: 360px minmax(0,1fr); min-height: calc(100vh - 66px); }
.message-list { border-right: 1px solid var(--line); background: white; }
.message-item { padding: 15px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.message-item:hover, .message-item.active { background: #eef8f5; }
.message-item strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-item p { margin: 7px 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-item time { color: #8ca09d; font-size: 11px; }
.message-view { padding: 28px; min-width: 0; }
.message-view h2 { margin: 0 0 18px; }
.message-meta { display: grid; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.detected-codes { margin: 18px 0; padding: 16px; background: #f2f8f6; border: 1px solid var(--line); border-radius: 6px; }
.detected-codes > strong { display: block; font-size: 13px; }
.detected-codes > small { color: var(--muted); }
.code-strip { display: flex; gap: 9px; flex-wrap: wrap; margin: 12px 0 8px; }
.code { min-height: 48px; border: 1px solid #b6d6cf; background: #eaf7f3; color: var(--primary-dark); border-radius: 5px; padding: 8px 13px; display: inline-flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 800; }
.code:hover { border-color: var(--primary); background: #dff2ec; }
.mail-body { padding-top: 20px; border-top: 1px solid var(--line); line-height: 1.7; overflow-wrap: anywhere; }
.public-shell { min-height: 100vh; background: #f1f6f4; padding: 28px; }
.public-wrap { max-width: 1120px; margin: 0 auto; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.public-inbox-banner { margin-top: 38px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: white; border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: 7px; }
.public-inbox-banner .eyebrow { margin-bottom: 10px; }
.public-inbox-banner h1 { margin: 0; font-size: 27px; overflow-wrap: anywhere; }
.public-inbox-banner p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.public-copy-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.public-link-copy { height: 44px; width: 44px; }
.latest-code { background: #0d3938; color: white; padding: 25px; border-radius: 7px; margin: 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.latest-code-button { min-width: 190px; min-height: 72px; padding: 4px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; color: white; background: rgba(255,255,255,.08); }
.latest-code-button:not(:disabled):hover { background: rgba(255,255,255,.15); }
.latest-code-button strong { font-size: clamp(34px, 7vw, 58px); }
.toast { position: fixed; right: 22px; bottom: 22px; padding: 12px 16px; border-radius: 6px; color: white; background: #173b3a; z-index: 20; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-scene { min-height: 410px; }
  .benefits { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 72px 1fr; }
  .sidebar .brand span, .nav button span, .nav-label { display: none; }
  .sidebar .brand { justify-content: center; }
  .nav button { justify-content: center; padding: 0; }
  .content, .grid-2, .grid-2 > *, .panel, .inbox-layout { min-width: 0; }
  .grid-2, .inbox-layout { grid-template-columns: minmax(0, 1fr); }
  .message-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 420px; overflow: auto; }
  .generator { grid-template-columns: 1fr 1fr; }
  .generator .btn { width: 100%; }
  .stats { grid-template-columns: 1fr; }
  .mailbox-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .auth-scene { padding: 32px 24px; }
  .auth-panel { padding: 28px 20px; }
  .content, .message-view { padding: 20px 14px; }
  .topbar { padding: 0 14px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-head .field { min-width: 0 !important; width: 100%; }
  .generator { grid-template-columns: 1fr; }
  .user-chip span { display: none; }
  .dns-domain-head { align-items: stretch; flex-direction: column; }
  .dns-domain-head .btn { width: 100%; }
  .preview-record { grid-template-columns: 36px minmax(0,1fr); }
  .preview-record > span:last-child { grid-column: 1 / -1; }
  .public-shell { padding: 18px 14px; }
  .public-inbox-banner, .latest-code { align-items: stretch; flex-direction: column; }
  .public-inbox-banner { margin-top: 24px; padding: 19px; }
  .public-inbox-banner h1 { font-size: 21px; }
  .public-copy-actions { width: 100%; }
  .public-copy-actions .btn { flex: 1; }
  .latest-code-button { width: 100%; }
}
