:root {
  color-scheme: light;
  --paper: #f4f1e7;
  --ink: #1b3330;
  --subtle: #4e645e;
  --line: #c7cfc0;
  --green: #204f49;
  --green-dark: #153c37;
  --serif: "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, Georgia, serif;
  --sans: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.65 var(--sans); }
button, input { font: inherit; }
a { color: inherit; text-underline-offset: .22em; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .66; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }

.shell { width: min(1176px, calc(100% - 88px)); margin: auto; }
.masthead {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; letter-spacing: .11em; font-weight: 650; }
.tide-mark {
  position: relative;
  width: 21px;
  height: 21px;
  border: 1px solid var(--green);
  border-radius: 50%;
}
.tide-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 8px;
  height: 3px;
  border: solid var(--green);
  border-width: 1px 0;
  border-radius: 50%;
  transform: rotate(-18deg);
}
.masthead time { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--subtle); }

.spread {
  margin: 42px 0 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.43fr) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 90px);
  align-items: center;
}
.plate { min-width: 0; margin: 0; }
.frame { aspect-ratio: 1.22; overflow: hidden; background: #c2d5cb; }
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.copy { padding: 12px 0 29px; }
.context { font-size: 13px; letter-spacing: .1em; color: var(--subtle); margin: 0 0 14px; }
h1 { font: 650 clamp(40px, 4.9vw, 72px)/1.13 var(--serif); letter-spacing: -.045em; margin: 0 0 18px; }
.card-view h1 { font-size: clamp(36px, 4.3vw, 60px); margin-bottom: 12px; }
.lead, .observation { max-width: 28em; color: var(--subtle); margin: 0; }
.card-details blockquote {
  padding-top: 19px;
  border-top: 1px solid var(--line);
  margin: 20px 0 0;
  font: 650 clamp(24px, 3vw, 37px)/1.34 var(--serif);
  letter-spacing: -.02em;
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 46px;
  padding: 9px 17px;
  border: 1px solid var(--green);
  border-radius: 3px;
  font-weight: 570;
  font-size: 14px;
  text-decoration: none;
}
.primary { background: var(--green); color: #fffaf1; }
.primary:hover:enabled, a.primary:hover { background: var(--green-dark); }
.secondary { color: var(--green-dark); border-color: #a4b5a6; background: transparent; }
.secondary:hover { background: #e6ece0; }
.status, .storage, .manual-copy { font-size: 13px; margin: 11px 0 0; color: var(--subtle); }
.status:empty { margin: 0; }
.manual-copy input { display: block; width: 100%; margin-top: 5px; padding: 8px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.enter { animation: enter .42s ease-out both; }
@keyframes enter {
  from { opacity: .28; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

#history { margin: 0 0 44px; padding: 12px 0; color: var(--subtle); border-block: 1px solid var(--line); font-size: 14px; }
#historyList { display: flex; flex-wrap: wrap; gap: 5px 24px; list-style: none; padding: 0; margin: 12px 0 2px; }

#posterDialog {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px 16px 18px;
  width: min(420px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
}
#posterDialog::backdrop { background: #102c28ba; }
.poster-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.poster-head h2 { margin: 0; font-size: 16px; }
.poster-head button { border: 0; background: transparent; padding: 0; width: 42px; min-height: 36px; color: var(--ink); font-size: 24px; }
#posterImage { width: 100%; display: block; height: auto; background: #e4e9db; }
#posterDialog p { font-size: 13px; color: var(--subtle); margin: 9px 0; }

@media (max-width: 720px) {
  .shell { width: min(500px, calc(100% - 36px)); }
  .masthead { min-height: 58px; }
  .spread { margin-top: 17px; grid-template-columns: 1fr; gap: 0; }
  .frame { aspect-ratio: 1.2; }
  .copy { padding: 24px 1px 7px; }
  .context { margin-bottom: 7px; }
  h1 { font-size: clamp(33px, 9vw, 48px); margin-bottom: 10px; }
  .card-view h1 { font-size: clamp(33px, 8.8vw, 46px); margin-bottom: 7px; }
  .lead, .observation { font-size: 15px; }
  .card-details blockquote { margin-top: 13px; padding-top: 13px; }
  .actions { margin-top: 20px; }
  .actions .primary { flex: 1 0 100%; justify-content: space-between; }
  .actions .secondary { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .enter { animation: none; }
}
