:root {
  --paper: #edf4f3;
  --surface: #f9fcfb;
  --white: #ffffff;
  --ink: #153230;
  --muted: #627875;
  --line: #cdddda;
  --short: #ee6b4d;
  --short-soft: #fbe3dc;
  --long: #177b70;
  --long-soft: #d7ece8;
  --shadow: 0 18px 60px rgba(26, 66, 62, 0.09);
  --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 82% 4%, rgba(151, 208, 200, 0.25), transparent 26rem),
    linear-gradient(180deg, #f5f9f8 0, var(--paper) 24rem);
  color: var(--ink);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 20px;
  -webkit-font-smoothing: antialiased;
}

button, output { font: inherit; }
button { color: inherit; }

button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(23, 123, 112, 0.28);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(21, 50, 48, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark { display: flex; align-items: flex-end; gap: 2px; width: 24px; height: 24px; padding: 4px; border-radius: 7px; background: var(--ink); }
.brand-mark i { display: block; width: 4px; border-radius: 2px 2px 0 0; background: var(--paper); }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 10px; background: #75cfc2; }

.topbar-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 20px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--long); box-shadow: 0 0 0 5px rgba(23, 123, 112, 0.1); }

.section-label {
  display: block;
  margin: 0 0 16px;
  color: var(--long);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.launchpad {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(500px, 1.45fr) auto;
  align-items: stretch;
  gap: 12px;
  margin-top: 48px;
  padding: 12px;
  border: 1px solid rgba(21, 50, 48, 0.13);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.69);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.launch-copy { padding: 22px 22px 18px; display: flex; flex-direction: column; justify-content: space-between; }
.launch-copy .section-label { margin-bottom: 26px; }
.launch-copy h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.04em; }
.launch-copy p { max-width: 310px; margin: 0; color: var(--muted); font-size: 20px; line-height: 1.65; }

.duration-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.duration-picker {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 146px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.duration-meta { display: flex; align-items: center; gap: 12px; }
.duration-meta strong, .duration-meta span { display: block; }
.duration-meta strong { margin-bottom: 4px; font-size: 20px; }
.duration-meta div span { color: var(--muted); font-size: 20px; }

.stepper { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.stepper button { width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 20px; }
.stepper button:hover { background: var(--paper); }
.stepper output { text-align: center; font: 700 20px/1 "Microsoft YaHei", sans-serif; }

.create-button {
  min-width: 166px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px;
  border: 0;
  border-radius: 18px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 20px;
  text-align: left;
  transition: transform 180ms ease, background 180ms ease;
}

.create-button:hover { transform: translateY(-2px); background: #214844; }
.create-button:disabled { cursor: wait; opacity: 0.68; transform: none; }
.create-button b { color: #8de1d5; }
.create-button svg { align-self: flex-end; width: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }

.inbox-section { padding: 68px 0 84px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading .section-label { margin-bottom: 8px; }
.section-heading h2 { margin: 0; font-size: 31px; letter-spacing: -0.055em; }
.workspace-actions { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 20px; }

.quiet-button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.5); cursor: pointer; font-size: 20px; }
.quiet-button:disabled { opacity: .45; cursor: default; }
.quiet-button svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.quiet-button.is-loading svg { animation: rotate .8s linear infinite; }

.mailbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }

.mailbox-card {
  --accent: var(--short);
  --accent-soft: var(--short-soft);
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(21, 50, 48, .14);
  border-radius: var(--radius);
  background: rgba(255,255,255,.82);
  box-shadow: 0 12px 40px rgba(35, 74, 70, .06);
  animation: card-in 420ms cubic-bezier(.2,.75,.25,1) both;
}
.mailbox-card[data-lifetime="1h"] { --accent: var(--long); --accent-soft: var(--long-soft); }

.life-track { height: 5px; background: var(--accent-soft); }
.life-track span { display: block; width: var(--life, 100%); height: 100%; background: var(--accent); transition: width 1s linear; }
.mailbox-header, .address-row, .mailbox-stats { margin-inline: 20px; }
.mailbox-header { display: flex; justify-content: space-between; align-items: center; padding: 17px 0 12px; }
.mailbox-kind { display: flex; align-items: center; gap: 8px; font-size: 20px; letter-spacing: .03em; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.menu-button, .copy-button, .icon-button { display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; }
.menu-button { width: 30px; height: 30px; border-radius: 8px; color: #8ba09d; }
.menu-button:hover { background: #fce8e4; color: var(--short); }
.menu-button svg, .copy-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.address-row { display: flex; align-items: center; gap: 6px; }
.email-address { min-width: 0; overflow: hidden; padding: 0; border: 0; background: transparent; cursor: copy; font: 650 20px/1.4 "Microsoft YaHei", sans-serif; letter-spacing: -0.025em; text-overflow: ellipsis; white-space: nowrap; }
.copy-button { flex: 0 0 auto; width: 29px; height: 29px; border-radius: 8px; color: var(--muted); }
.copy-button:hover { background: var(--accent-soft); color: var(--accent); }

.mailbox-stats { display: flex; justify-content: space-between; padding: 10px 0 16px; color: var(--muted); font: 20px/1.3 "Microsoft YaHei", sans-serif; border-bottom: 1px solid var(--line); }
.countdown { color: var(--accent); }

.message-list { max-height: 280px; overflow: auto; }
.message-item { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: start; padding: 15px 20px; border: 0; border-bottom: 1px solid #e3ecea; background: transparent; cursor: pointer; text-align: left; }
.message-item:hover { background: #f3f8f7; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font: 700 20px/1 "Microsoft YaHei", sans-serif; }
.message-main { min-width: 0; }
.message-main strong, .message-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-main strong { margin-bottom: 5px; font-size: 20px; }
.message-main span { color: var(--muted); font-size: 20px; }
.message-time { color: var(--muted); font: 20px/1 "Microsoft YaHei", sans-serif; }

.mail-empty { min-height: 215px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.mail-empty strong { margin: 15px 0 5px; font-size: 20px; }
.mail-empty small { color: var(--muted); font-size: 20px; }
.radar { position: relative; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; }
.radar::before, .radar::after { content: ""; position: absolute; inset: 7px; border: 1px solid var(--line); border-radius: 50%; }
.radar::after { inset: 15px; background: var(--accent); border: 0; }
.radar i { position: absolute; z-index: 2; inset: 3px; border-top: 1px solid var(--accent); border-radius: 50%; animation: radar 2.4s linear infinite; }

.mailbox-loading { position: absolute; inset: 5px 0 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px; background: rgba(249,252,251,.94); color: var(--muted); font-size: 20px; text-align: center; }
.mailbox-loading[hidden] { display: none; }
.mailbox-loading span { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: rotate .75s linear infinite; }
.mailbox-card.is-error .mailbox-loading { color: #a34834; background: #fff8f6; }

.empty-state { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #b8cdca; border-radius: var(--radius); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state h3 { margin: 20px 0 8px; font-size: 20px; }
.empty-state p { max-width: 620px; margin: 0; color: var(--muted); font-size: 20px; line-height: 1.7; }
.empty-illustration { display: flex; align-items: flex-end; gap: 5px; width: 66px; height: 48px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; transform: rotate(-4deg); }
.empty-illustration span { flex: 1; border-radius: 3px; background: var(--long-soft); }
.empty-illustration span:nth-child(1) { height: 38%; }
.empty-illustration span:nth-child(2) { height: 82%; background: var(--long); }
.empty-illustration span:nth-child(3) { height: 57%; background: var(--short-soft); }

footer { display: flex; justify-content: space-between; gap: 40px; padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 20px; line-height: 1.7; }
footer p { max-width: 650px; margin: 0; }
footer span { white-space: nowrap; font-family: "Microsoft YaHei", sans-serif; }

.message-dialog { width: min(720px, calc(100% - 28px)); max-height: min(780px, calc(100vh - 28px)); padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 100px rgba(10,35,33,.28); }
.message-dialog::backdrop { background: rgba(15, 41, 39, .48); backdrop-filter: blur(5px); }
.dialog-shell { min-height: 420px; }
.dialog-header { display: flex; justify-content: space-between; gap: 20px; padding: 26px 28px 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 5px 0 8px; font-size: 23px; letter-spacing: -.04em; }
.dialog-header p, .dialog-sender { margin: 0; color: var(--muted); font-size: 20px; }
.dialog-sender { font-family: "Microsoft YaHei", sans-serif; }
.icon-button { width: 34px; height: 34px; border-radius: 50%; background: var(--paper); font-size: 22px; }
.dialog-body { padding: 28px; color: #253d3a; font-size: 20px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-body iframe { width: 100%; min-height: 430px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.dialog-loading { color: var(--muted); }

.confirm-overlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 41, 39, .52);
  backdrop-filter: blur(6px);
  animation: toast-in 180ms ease both;
}

.confirm-overlay[hidden] { display: none; }

.confirm-modal {
  width: min(520px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(10, 35, 33, .3);
}

.confirm-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  border-radius: 17px;
  background: var(--short-soft);
  color: var(--short);
}

.confirm-mark svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.confirm-modal .section-label { margin-bottom: 10px; color: var(--short); }
.confirm-modal h2 { margin: 0 0 12px; font-size: 26px; line-height: 1.35; }
.confirm-modal p { overflow-wrap: anywhere; }
#confirm-description { margin: 0; color: var(--muted); font-size: 20px; line-height: 1.7; }

.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.confirm-actions button { min-height: 52px; padding: 10px 16px; border-radius: 12px; cursor: pointer; font-size: 20px; }
.confirm-cancel { border: 1px solid var(--line); background: var(--white); }
.confirm-delete { border: 1px solid var(--short); background: var(--short); color: white; font-weight: 700; }
.confirm-cancel:hover { background: var(--paper); }
.confirm-delete:hover { background: #d8583c; }

.toast-region { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { width: max-content; max-width: min(720px, calc(100vw - 40px)); padding: 14px 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: var(--ink); color: white; box-shadow: 0 10px 35px rgba(12,40,37,.25); font-size: 20px; line-height: 1.6; overflow-wrap: anywhere; word-break: break-word; animation: toast-in 250ms ease both; }
.toast.error { background: #9d4634; }

@keyframes radar { to { transform: rotate(360deg); } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
  .launchpad { grid-template-columns: 1fr; }
  .launch-copy { flex-direction: row; gap: 24px; }
  .launch-copy .section-label { margin-bottom: 0; }
  .create-button { min-height: 66px; flex-direction: row; align-items: center; }
  .create-button svg { align-self: center; }
  .mailbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 1440px); }
  .topbar { height: 68px; }
  .launchpad { margin-top: 28px; }
  .launch-copy { flex-direction: column; }
  .duration-pickers { grid-template-columns: 1fr; }
  .mailbox-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .workspace-actions { flex-direction: column; align-items: flex-end; gap: 8px; }
  footer { flex-direction: column; gap: 12px; }
  .topbar-status span:last-child { display: none; }
  .confirm-modal { padding: 24px; }
  .confirm-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
