:root {
  color-scheme: light;
  --ink: #182126;
  --muted: #68757c;
  --line: #d7dee1;
  --surface: #ffffff;
  --canvas: #f4f6f5;
  --teal: #087b73;
  --teal-dark: #05645e;
  --teal-pale: #e4f3f0;
  --amber: #a66000;
  --danger: #ae3746;
  --danger-pale: #fbeaec;
  --shadow: 0 12px 28px rgba(21, 41, 45, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.55;
}
button, input, textarea { font: inherit; }
button, .primary-link {
  min-height: 42px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  padding: 9px 15px;
  text-align: center;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
button:hover, .primary-link:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #f3bd61; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: 0.62; }
button.secondary { background: transparent; color: var(--teal-dark); border-color: #9bc3be; }
button.secondary:hover { background: var(--teal-pale); }
button.danger, button.table-button.danger { background: transparent; color: var(--danger); border-color: #e5a7ae; }
button.danger:hover, button.table-button.danger:hover { background: var(--danger-pale); }
input, textarea {
  width: 100%;
  border: 1px solid #b8c4c9;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
}
textarea { min-height: 142px; resize: vertical; }
label { color: #34444b; font-size: 14px; font-weight: 650; }
.site-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  padding: 0 max(24px, calc((100% - 1120px) / 2));
}
.brand { color: var(--ink); font-size: 18px; font-weight: 750; letter-spacing: 0; text-decoration: none; }
.brand-mark { display: inline-grid; width: 24px; height: 24px; place-items: center; margin-right: 8px; border-radius: 5px; background: var(--teal); color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; font-weight: 750; vertical-align: -2px; }
.quiet-link { color: var(--teal-dark); font-size: 14px; text-decoration: none; }
.quiet-link:hover { text-decoration: underline; }
.header-actions { display: flex; align-items: center; gap: 16px; }
button.header-button { min-height: 0; border: 0; background: transparent; color: var(--teal-dark); padding: 3px 0; font-size: 14px; }
button.header-button:hover { border: 0; background: transparent; color: var(--teal); text-decoration: underline; }
.page-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 64px; }
.public-shell { width: min(880px, calc(100% - 48px)); }
.intro { max-width: 680px; margin-bottom: 31px; }
.eyebrow { margin: 0 0 8px; color: var(--teal-dark); font-size: 13px; font-weight: 750; letter-spacing: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 31px; line-height: 1.25; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 18px; line-height: 1.35; letter-spacing: 0; }
h3 { margin-bottom: 0; font-size: 15px; letter-spacing: 0; }
.lede { max-width: 620px; margin-bottom: 0; color: var(--muted); font-size: 16px; }
.service-panel, .account-panel, .auth-panel, .admin-section, .account-section, .message-list-wrap, .message-detail {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.service-panel, .account-panel { display: grid; grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.1fr); overflow: hidden; }
.service-meta { padding: 30px; background: #edf5f4; }
.service-meta h2 { margin-bottom: 22px; }
.service-meta dl { margin: 0; }
.service-meta dl div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid #d0e2de; }
.service-meta dt, .service-meta dd { margin: 0; font-size: 14px; }
.service-meta dt { color: #55716e; }
.service-meta dd { color: #173e3a; font-weight: 700; text-align: right; }
.account-workspace { padding: 30px; }
.auth-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
button.auth-tab { min-height: 38px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); padding: 7px 13px; }
button.auth-tab:hover { border-color: transparent; background: #f1f6f5; color: var(--teal-dark); }
button.auth-tab.active { border-bottom-color: var(--teal); background: transparent; color: var(--teal-dark); font-weight: 750; }
.auth-form { padding-top: 22px; }
.redeem-form { padding: 30px; }
.field-row { display: flex; gap: 10px; margin-top: 7px; }
.field-row input { min-width: 0; }
.field-row button { flex: 0 0 auto; }
.form-note { min-height: 22px; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.form-note.success { color: #087342; }
.form-note.warning { color: var(--amber); }
.form-note.error { color: var(--danger); }
.result-panel { grid-column: 2; margin: 0 30px 30px; padding: 19px; border-left: 4px solid var(--teal); background: #f4faf8; }
.result-label { margin-bottom: 3px; color: var(--muted); font-size: 13px; }
.mail-address { margin-bottom: 4px; overflow-wrap: anywhere; color: #123a36; font-size: 20px; font-weight: 750; }
.result-detail { margin-bottom: 15px; color: var(--muted); font-size: 13px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.notice-strip { margin-top: 20px; padding: 0 4px; color: var(--muted); font-size: 13px; }
.notice-strip p { margin: 0; }
.inbox-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.inbox-heading .eyebrow { margin-bottom: 5px; }
.inbox-heading h1 { margin-bottom: 0; overflow-wrap: anywhere; }
.storage-status { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.inbox-tools { display: flex; align-items: center; justify-content: end; gap: 12px; }
.inbox-tools .form-note { margin: 0; max-width: 360px; text-align: right; }
.inbox-layout { display: grid; grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.65fr); gap: 16px; min-height: 510px; }
.message-list-wrap { overflow: hidden; }
.list-heading, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.list-heading { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.count-badge { min-width: 25px; padding: 1px 7px; border-radius: 999px; background: var(--teal-pale); color: var(--teal-dark); font-size: 13px; font-weight: 700; text-align: center; }
.message-list { max-height: 570px; overflow: auto; }
.message-row { width: 100%; min-height: 0; display: grid; gap: 4px; border: 0; border-bottom: 1px solid #e5eaec; border-radius: 0; background: #fff; color: var(--ink); padding: 14px 20px; text-align: left; }
.message-row:hover, .message-row.selected { background: #edf7f5; color: var(--ink); }
.message-subject { overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.message-meta { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.verification-chip { width: fit-content; max-width: 100%; margin-top: 2px; padding: 1px 6px; border: 1px solid #acd2ca; border-radius: 4px; color: var(--teal-dark); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.message-detail { min-width: 0; padding: 26px; }
.message-detail h2 { margin-bottom: 9px; overflow-wrap: anywhere; }
.message-detail-meta { white-space: pre-line; color: var(--muted); font-size: 13px; }
.message-body { margin: 24px 0 0; padding-top: 19px; border-top: 1px solid var(--line); color: #233236; font-family: inherit; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-detail-actions { display: flex; justify-content: end; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.empty-state { margin: 0; color: var(--muted); font-size: 14px; }
.list-empty { padding: 22px 20px; }
.code-panel { width: fit-content; min-width: 180px; display: grid; gap: 3px; margin-top: 19px; border: 1px solid #b8dcd5; border-radius: 5px; background: #f1faf7; cursor: copy; padding: 10px 13px; }
.code-panel span { color: var(--muted); font-size: 12px; }
.code-panel strong { color: var(--teal-dark); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 21px; letter-spacing: 1px; }
.admin-shell { max-width: 1120px; }
.auth-panel { width: min(410px, 100%); margin: 26px auto 0; padding: 30px; }
.auth-panel h1 { margin-bottom: 24px; }
.stack-form, .compact-form { display: grid; gap: 8px; }
.stack-form button { margin-top: 9px; }
.admin-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.admin-heading h1 { margin-bottom: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-section { padding: 23px; }
.admin-section .section-title { margin-bottom: 20px; }
.account-section { margin-top: 16px; padding: 23px; }
.account-section .section-title { margin-bottom: 20px; }
.password-form { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px minmax(0, 1fr) 150px minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.password-form label { padding-bottom: 10px; }
.password-form button { white-space: nowrap; }
.password-form .form-note { grid-column: 1 / -1; }
.compact-form button { justify-self: start; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-weight: 500; }
.check-row input { width: 16px; min-height: 16px; margin: 0; }
.generated-cards { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.generated-cards .section-title { margin-bottom: 10px; }
.generated-cards textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.wide-section { margin-top: 16px; }
.subtle { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid #e1e7e9; border-radius: 5px; }
table { width: 100%; min-width: 690px; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid #e1e7e9; padding: 11px 12px; text-align: left; vertical-align: middle; white-space: nowrap; }
th { background: #f2f6f6; color: #496065; font-size: 12px; font-weight: 750; }
tbody tr:last-child td { border-bottom: 0; }
.table-button { min-height: 31px; border-radius: 4px; padding: 4px 8px; font-size: 12px; }
.user-actions { display: flex; align-items: center; gap: 6px; }
.quota-input { width: 62px; min-height: 31px; padding: 4px 6px; font-size: 12px; }
.hidden { display: none !important; }
@media (max-width: 760px) {
  .site-header { padding: 0 20px; }
  .page-shell, .public-shell { width: min(100% - 32px, 1120px); padding: 34px 0 44px; }
  h1 { font-size: 26px; }
  .service-panel, .account-panel, .admin-grid, .inbox-layout { grid-template-columns: 1fr; }
  .service-meta, .redeem-form, .account-workspace { padding: 23px; }
  .result-panel { grid-column: 1; margin: 0 23px 23px; }
  .field-row { align-items: stretch; flex-direction: column; }
  .field-row button { width: 100%; }
  .inbox-heading { align-items: start; flex-direction: column; }
  .inbox-tools { width: 100%; align-items: start; justify-content: space-between; }
  .inbox-tools .form-note { max-width: none; text-align: left; }
  .inbox-layout { min-height: 0; }
  .message-list { max-height: 300px; }
  .message-detail { min-height: 310px; }
  .admin-heading { align-items: start; }
  .admin-heading > button { flex: 0 0 auto; }
  .admin-section { padding: 18px; }
  .account-section { padding: 18px; }
  .password-form { grid-template-columns: 1fr; }
  .password-form label { padding-bottom: 0; }
  .password-form button { justify-self: start; margin-top: 8px; }
}
