:root {
  color-scheme: light;
  --paper: #fffaee;
  --card: #fffdf7;
  --ink: #24221f;
  --muted: #736e67;
  --line: #ded8c9;
  --soft: #eee6d7;
  --coral: #c96550;
  --focus: #a73b28;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(#eee7d8 0.7px, transparent 0.7px);
  background-size: 26px 26px;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 12px; z-index: 20; }
.skip-link:focus { left: 12px; }
.site-shell { max-width: 1600px; height: 100vh; height: 100dvh; min-height: 420px; margin: auto; border-top: 9px solid var(--ink); border-left: 9px solid var(--ink); display: flex; flex-direction: column; overflow: hidden; }
.site-header { min-height: 82px; margin: 0 40px; display: flex; align-items: center; gap: 26px; border-bottom: 3px solid var(--ink); flex: none; }
.brand { font-size: 30px; font-weight: 700; text-decoration: none; letter-spacing: -0.05em; white-space: nowrap; }
.brand-dot { color: var(--coral); }
.brand-en { color: var(--muted); font: 14px Menlo, Consolas, monospace; letter-spacing: 0.06em; }
.update-note { margin-left: auto; color: var(--muted); font-size: 15px; white-space: nowrap; }
.about-link { border: 2px solid var(--ink); min-width: 96px; padding: 8px 14px; text-align: center; text-decoration: none; font-size: 16px; background: var(--card); }
.about-link:hover { background: var(--soft); }
.body-layout { display: grid; grid-template-columns: 162px minmax(0, 1fr); gap: 24px; padding: 18px 40px 0; flex: 1; min-height: 0; }
.date-rail { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.rail-heading { display: flex; align-items: center; gap: 5px; min-height: 42px; padding: 0 16px 8px 6px; flex: none; }
.rail-label { color: var(--muted); font-size: 16px; }
.rail-month { margin-left: auto; white-space: nowrap; color: var(--ink); font: 14px Menlo, Consolas, monospace; }
.calendar-toggle { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 2px solid transparent; color: var(--ink); background: transparent; cursor: pointer; }
.calendar-toggle:hover, .calendar-toggle[aria-expanded="true"] { border-color: var(--ink); background: var(--soft); }
.date-list { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 10px; overflow-y: auto; padding: 0 16px 4px 2px; border-right: 2px solid var(--line); scrollbar-width: thin; }
.calendar-popover { position: absolute; top: 43px; left: 0; z-index: 10; width: 304px; max-width: calc(100vw - 28px); padding: 15px; border: 2px solid var(--ink); background: var(--card); box-shadow: 6px 6px 0 var(--soft); }
.calendar-popover[hidden] { display: none; }
.picker-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 16px; }
.picker-nav { width: 32px; height: 32px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 25px; line-height: 1; cursor: pointer; }
.picker-nav:hover:not(:disabled) { background: var(--soft); }
.picker-nav:disabled { opacity: .35; cursor: not-allowed; }
.picker-weekdays, .picker-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 3px; }
.picker-weekdays { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.picker-days button { aspect-ratio: 1; min-width: 0; border: 1px solid transparent; background: transparent; color: var(--ink); font: 14px Menlo, Consolas, monospace; cursor: pointer; }
.picker-days button:hover:not(:disabled) { border-color: var(--ink); background: var(--soft); }
.picker-days button[aria-current="date"] { background: var(--ink); color: var(--paper); }
.picker-days button:disabled { color: #aaa49a; cursor: not-allowed; }
.picker-days .has-edition:not([aria-current="date"]) { color: var(--coral); font-weight: 700; }
.date-button { display: grid; grid-template-columns: 1fr; justify-items: center; border: 0; background: transparent; color: var(--ink); min-height: 78px; width: 108px; padding: 6px 10px; font: inherit; text-align: center; cursor: pointer; }
.date-button:hover { background: var(--soft); }
.date-button[aria-current="date"] { background: var(--ink); color: var(--paper); }
.day-number { font: 27px Menlo, Consolas, monospace; line-height: 1.3; }
.day-label { font-size: 13px; color: var(--muted); }
.date-button[aria-current="date"] .day-label { color: var(--paper); }
.rail-end { color: var(--muted); margin: 10px 0 12px 6px; font-size: 13px; flex: none; }
.main-content { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.edition-overview { flex: none; }
.edition-kicker { color: var(--coral); font: 16px Menlo, Consolas, monospace; letter-spacing: 0.04em; margin: 2px 0 10px; }
.heading-line { display: flex; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
h1 { font-size: clamp(30px, 3vw, 44px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.2; margin: 0; }
.intro { color: var(--muted); font-size: 16px; margin: 8px 0 0; }
.count-stamp { flex: none; background: #ead1bf; border: 2px solid var(--ink); padding: 9px 16px; font: 16px Menlo, Consolas, monospace; white-space: nowrap; }
.news-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.edition-status { color: var(--muted); min-height: 35px; padding: 17px 0 0; font-size: 15px; }
.edition-status:empty { display: none; }
.edition-status.is-alert { color: #a43b29; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 26px; padding: 20px 8px 36px 0; }
.news-card { min-width: 0; background: var(--card); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--soft); padding: 13px; display: flex; flex-direction: column; }
.card-image { display: block; width: 100%; aspect-ratio: 2.8 / 1; object-fit: cover; background: var(--soft); }
.card-body { padding: 12px 6px 4px; display: flex; flex: 1; flex-direction: column; }
.card-category { display: inline-block; align-self: start; color: var(--ink); background: var(--soft); padding: 5px 10px; font-size: 13px; margin-bottom: 12px; }
.news-card h2 { font-size: clamp(18px, 1.55vw, 23px); font-weight: 600; line-height: 1.5; margin: 0 0 10px; overflow-wrap: anywhere; }
.card-summary { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-source { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.original-link { color: var(--coral); font-size: 15px; text-decoration: none; flex: none; }
.original-link:hover { text-decoration: underline; }
.extra-sources { margin-top: 12px; color: var(--muted); font-size: 13px; }
.extra-sources summary { cursor: pointer; }
.extra-sources ul { margin: 7px 0 0; padding-left: 20px; }
.extra-sources li { margin: 5px 0; overflow-wrap: anywhere; }
.extra-sources a:hover { color: var(--coral); }
.empty-box { grid-column: 1 / -1; background: var(--card); border: 2px dashed var(--line); min-height: 200px; display: grid; place-content: center; text-align: center; padding: 26px; margin-top: 20px; }
.empty-box strong { font-size: 22px; font-weight: 600; }
.empty-box span { color: var(--muted); margin-top: 10px; line-height: 1.6; }
.pagination { text-align: center; margin: 0 0 40px; }
.page-button { font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--ink); padding: 11px 23px; cursor: pointer; }
.page-button:hover { background: var(--soft); }
.site-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 10px; border-top: 1px solid var(--line); padding: 18px 8px 28px 0; color: var(--muted); font-size: 13px; }

@media (max-width: 1120px) {
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-en { display: none; }
}
@media (max-width: 700px) {
  .site-shell { border-left-width: 5px; border-top-width: 5px; }
  .site-header { min-height: 66px; margin: 0 15px; gap: 10px; }
  .brand { font-size: 24px; }
  .update-note { font-size: 11px; }
  .about-link { min-width: auto; padding: 7px 9px; font-size: 13px; }
  .body-layout { grid-template-columns: 57px minmax(0, 1fr); gap: 11px; padding: 14px 14px 0; }
  .rail-heading { display: flex; flex-direction: column; justify-content: center; gap: 0; padding: 0 4px 8px 0; text-align: center; min-height: 69px; }
  .rail-label { display: none; }
  .rail-month { margin-left: 0; font-size: 12px; }
  .calendar-toggle { width: 34px; height: 34px; margin: auto; }
  .calendar-popover { top: 69px; }
  .date-list { padding: 0 5px 0 0; gap: 5px; }
  .date-button { width: 45px; min-height: 58px; padding: 4px 0; }
  .day-number { font-size: 19px; }
  .day-label { font-size: 10px; }
  .rail-end { display: none; }
  .edition-kicker { font-size: 12px; margin: 2px 0 8px; }
  .heading-line { align-items: start; flex-direction: column; gap: 8px; padding-bottom: 12px; }
  h1 { font-size: clamp(24px, 6vw, 34px); }
  .intro { font-size: 13px; line-height: 1.5; margin-top: 6px; }
  .count-stamp { padding: 6px 10px; font-size: 12px; }
  .news-grid { grid-template-columns: 1fr; gap: 18px; padding-top: 16px; }
  .news-card { border-width: 2px; box-shadow: 4px 4px 0 var(--soft); }
  .news-card h2 { font-size: 19px; }
  .site-footer { display: block; line-height: 1.7; }
  .site-footer span { display: block; }
}
@media (max-width: 360px) {
  .update-note { display: none; }
  .body-layout { grid-template-columns: 49px minmax(0, 1fr); gap: 8px; padding-left: 9px; padding-right: 9px; }
  .date-button { width: 41px; }
}
.rss-preview-note {
  margin: 0 0 10px;
  padding: .5rem .8rem;
  border: 1px solid #b8c8d9;
  border-radius: 8px;
  background: #edf4fb;
  color: #284b70;
  font-size: .9rem;
}

/* Compact edition header */
[hidden] { display: none !important; }
.heading-line { padding: 4px 0 12px; }
.heading-line h1 { line-height: 1.15; }
.count-stamp { padding: 8px 16px; }
.site-footer { flex-wrap: wrap; gap: 12px 20px; }
.site-footer #rss-preview-note:not([hidden]) { flex-basis: 100%; }
@media (max-width: 700px) {
  .heading-line { align-items: center; flex-direction: row; gap: 6px; padding: 0 0 10px; }
  .heading-line h1 { font-size: clamp(19px, 5.5vw, 30px); }
  .heading-line .intro { font-size: 12px; line-height: 1.4; margin-top: 5px; }
  .heading-line .count-stamp { padding: 6px; font-size: 11px; }
}

/* UI proportion polish */
.heading-line { align-items: flex-start; }
.heading-line h1 { font-size: clamp(28px, 2.6vw, 38px); }
.count-stamp { align-self: flex-start; margin-top: 2px; }
.date-list { gap: 8px; scroll-behavior: auto; }
.date-button { min-height: 70px; flex-shrink: 0; }
.news-card h2 { line-height: 1.4; }
@media (max-width: 700px) {
  .heading-line { align-items: center; }
  .heading-line h1 { font-size: clamp(19px, 5.5vw, 30px); }
  .date-list { gap: 5px; }
  .date-button { min-height: 58px; }
}
