:root {
  color-scheme: light;
  --cream: #fffdf1;
  --sky: #eef9ff;
  --sky-deep: #dff1ff;
  --coconut: #fff1a8;
  --ink: #102047;
  --muted: #4d638a;
  --primary: #102f8f;
  --line: #cfdaea;
  --error: #9c2929;
  --success: #1e684d;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--sky);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; scroll-padding-top: 24px; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 3% 0, #fff1a8a1, transparent 45%), radial-gradient(ellipse at 100% 30%, #bfe6ff8c, transparent 50%), linear-gradient(145deg, var(--cream), #f8fdff 55%, var(--sky-deep)); }
a { color: var(--primary); text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, a, summary, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 2px; }
::selection { background: var(--coconut); color: var(--ink); }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(44px, 5.8vw, 72px); line-height: 1.2; letter-spacing: -.055em; margin-bottom: 24px; }
h2 { font-size: 28px; line-height: 1.35; letter-spacing: -.035em; margin-bottom: 10px; }
p { line-height: 1.75; }
.page-shell { width: min(1120px, 100%); padding: 28px 32px 20px; margin: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 28px; }
.site-brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; min-width: 0; }
.brand-badge { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 16px; color: #fff; background: var(--primary); font-size: 20px; font-weight: 850; letter-spacing: -.08em; box-shadow: 0 5px 18px #102f8f15; }
.brand-word { font: 700 11px/1.4 ui-monospace, monospace; letter-spacing: .15em; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; font-size: 14px; font-weight: 650; text-decoration: none; flex-shrink: 0; }
.back-link:hover { text-decoration: underline; }
.contact-layout { display: grid; grid-template-columns: .8fr 1.2fr; align-items: start; gap: clamp(32px, 5vw, 72px); padding: 34px 0 24px; }
.intro { padding: 20px 0 0; }
.eyebrow { font: 700 11px/1.6 ui-monospace, "SFMono-Regular", monospace; letter-spacing: .16em; color: var(--muted); margin-bottom: 24px; }
.title-accent { color: var(--primary); }
.intro-copy { color: var(--muted); font-size: 17px; line-height: 1.9; }
.privacy-note { font-size: 13px; color: var(--muted); padding-left: 20px; position: relative; margin: 0; }
.note-dot { width: 7px; height: 7px; border-radius: 100%; position: absolute; top: 8px; left: 0; background: var(--primary); }
.letter-art { width: 218px; height: 166px; position: relative; margin: 42px 0 32px 10px; transform: rotate(-5deg); }
.letter-sheet { position: absolute; width: 165px; height: 140px; left: 25px; top: 0; background: #fffefa; border: 1px solid var(--line); border-radius: 10px; padding: 20px; transform: rotate(8deg); }
.letter-sheet span { font: 700 11px/1 ui-monospace, monospace; letter-spacing: .12em; }
.letter-sheet i { display: block; height: 1px; background: var(--line); margin-top: 14px; }
.letter-sheet i:last-child { width: 60%; }
.envelope-front { position: absolute; inset: 58px 0 0; border: 1px solid #bfcfe7; border-radius: 7px 7px 18px 18px; background: linear-gradient(149deg, transparent 49.5%, #bdcfe4 50%, transparent 50.5%) left/50% 100%, linear-gradient(211deg, transparent 49.5%, #bdcfe4 50%, transparent 50.5%) right/50% 100%, linear-gradient(130deg, #f5fbff, #dff1ff); background-repeat: no-repeat; box-shadow: 0 12px 25px #10204709; }
.letter-seal { position: absolute; right: 22px; bottom: 22px; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; color: var(--primary); background: var(--coconut); font-size: 11px; font-weight: 800; transform: rotate(12deg); }
.paper-panel { border: 1px solid #ffffff; border-radius: 26px; background: #ffffffdb; box-shadow: 0 12px 50px #1230640a, 0 0 0 1px #10204706; }
.form-panel { padding: clamp(24px, 3vw, 36px); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.panel-heading .eyebrow { margin-bottom: 22px; }
.small-stamp { padding: 3px 6px; border: 1px solid #bac8da; border-radius: 4px; font: 10px/1.4 ui-monospace, monospace; letter-spacing: .06em; color: var(--muted); transform: rotate(5deg); }
.muted { color: var(--muted); }
.form-intro { font-size: 14px; margin-bottom: 28px; }
.field { margin: 0 0 22px; min-width: 0; }
.field-heading { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
label { display: block; font-size: 14px; font-weight: 650; }
.field > label { margin-bottom: 9px; }
.required-note { font-size: 12px; color: var(--muted); font-weight: 400; }
.counter { font: 11px/1.5 ui-monospace, monospace; color: var(--muted); white-space: nowrap; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid #b5c4d9; border-radius: 12px; background: #fcfdff; color: var(--ink); font-size: 16px; padding: 12px 14px; line-height: 1.5; }
input, select { min-height: 48px; }
textarea { display: block; min-height: 200px; resize: vertical; line-height: 1.75; overflow-wrap: anywhere; }
input::placeholder, textarea::placeholder { color: #65738c; opacity: 1; }
input[readonly], textarea[readonly] { background: #f1f5fa; }
.field-help { font-size: 12px; color: var(--muted); margin: -6px 0 24px; }
.form-footer { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.draft-note { font-size: 12px; color: var(--muted); }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 20px; border: 1px solid transparent; border-radius: 12px; padding: 11px 18px; font-size: 14px; font-weight: 650; line-height: 1.5; text-decoration: none; transition: background .15s ease, transform .15s ease; }
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:not(:disabled):hover { background: #1d449e; }
.button-secondary { color: var(--ink); background: var(--sky); border-color: var(--line); }
.button-secondary:not(:disabled):hover { background: var(--sky-deep); }
.button-quiet { color: var(--muted); background: transparent; border-color: var(--line); }
.button-quiet:not(:disabled):hover { background: var(--cream); }
.status { padding: 13px 16px; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--primary); background: var(--sky); overflow-wrap: anywhere; }
.status[data-kind="error"] { color: var(--error); border-color: #ecc6c6; background: #fff4f2; }
.status[data-kind="success"] { color: var(--success); border-color: #bbdacb; background: #edf8f1; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); margin-top: 42px; padding: 22px 0 8px; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 12px 18px; background: #fff; border: 2px solid var(--primary); border-radius: 8px; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.admin-shell { max-width: 1040px; }
.inbox-heading { padding: 26px 0 18px; }
.inbox-heading .eyebrow { margin-bottom: 14px; }
.inbox-heading h1 { font-size: clamp(30px, 5vw, 48px); margin-bottom: 12px; }
.login-panel { max-width: 460px; padding: 30px; }
.login-panel .eyebrow { margin-bottom: 16px; }
.login-panel .muted { font-size: 14px; margin-bottom: 24px; }
.inbox-toolbar { display: flex; gap: 24px; align-items: center; justify-content: space-between; padding: 24px; flex-wrap: wrap; }
.inbox-counts { display: flex; gap: 32px; }
.inbox-counts > div { display: flex; flex-direction: column; gap: 4px; }
.metric-label { font-size: 12px; color: var(--muted); }
.inbox-counts strong { font-size: 30px; line-height: 1.2; font-weight: 750; }
.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.filter-label select { width: auto; padding: 10px 28px 10px 12px; font-size: 14px; }
.inbox-tip { margin: 22px 4px 16px; font-size: 12px; }
.message-list { display: grid; gap: 14px; }
.message-card { min-width: 0; border-radius: 18px; border: 1px solid var(--line); background: #ffffffde; overflow-wrap: anywhere; }
.message-card.is-unread { border-left: 4px solid var(--primary); }
.message-card summary { cursor: pointer; padding: 20px 22px; border-radius: 17px; list-style: none; }
.message-card summary::-webkit-details-marker { display: none; }
.message-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; padding-right: 4px; }
.sender-name { font-size: 16px; font-weight: 750; min-width: 0; }
.message-time { color: var(--muted); font-size: 12px; }
.read-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #edf1f6; color: var(--muted); white-space: nowrap; }
.is-unread .read-badge { background: var(--sky-deep); color: var(--primary); }
.message-preview { margin: 12px 0 8px; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: pre-wrap; }
.expand-hint { color: var(--primary); font-size: 12px; }
.expand-hint::after { content: "展开全文 ＋"; }
.message-card[open] .expand-hint::after { content: "收起全文 −"; }
.message-card[open] .message-preview { display: none; }
.message-card[open] .expand-hint { display: block; margin-top: 10px; }
.message-body { padding: 0 22px 22px; }
.message-content { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.85; border-top: 1px solid var(--line); padding-top: 18px; margin: 0 0 18px; }
.empty-state { text-align: center; color: var(--muted); padding: 48px 20px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 24px; }
.pagination > span { color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 760px) {
  .page-shell { padding: 20px 20px 16px; }
  .site-header { padding-bottom: 18px; }
  .contact-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 12px; }
  .intro { padding-top: 8px; }
  .intro .eyebrow { margin-bottom: 16px; }
  .intro h1 { font-size: 42px; margin-bottom: 16px; }
  .intro h1 br { display: none; }
  .intro-copy { font-size: 15px; margin-bottom: 12px; }
  .intro-copy br { display: none; }
  .letter-art { display: none; }
  .privacy-note { font-size: 12px; }
  .privacy-note br { display: none; }
  .form-panel { padding: 24px; }
  .site-footer { margin-top: 24px; }
  .inbox-toolbar { padding: 20px; }
}
@media (max-width: 380px) {
  .page-shell { padding-inline: 14px; }
  .brand-word { display: none; }
  .form-panel, .login-panel { padding: 22px 18px; }
  .panel-heading { gap: 6px; }
  .panel-heading .eyebrow { font-size: 10px; letter-spacing: .09em; }
  .form-footer { align-items: stretch; flex-direction: column; gap: 12px; }
  .intro h1 { font-size: 36px; }
  .pagination { gap: 10px; }
  .pagination .button { padding-inline: 12px; }
  .message-card summary { padding: 18px; }
  .message-body { padding: 0 18px 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Compact contact / inbox layout. */
.contact-simple { max-width: 720px; padding-bottom: 32px; }
.simple-title { font-size: clamp(28px, 5vw, 36px); margin: 12px 0 24px; letter-spacing: -.035em; }
.contact-simple .form-footer { justify-content: flex-end; }
.contact-simple textarea { min-height: 220px; }
.admin-shell .message-list { margin-top: 20px; }
.login-panel h2 { margin-bottom: 24px; }
@media (max-width: 760px) {
  .contact-simple .site-header { padding-bottom: 12px; }
  .simple-title { margin-top: 8px; margin-bottom: 20px; }
}
