/* feaOS field — shares the blog palette and type, with a denser news rhythm. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/blog/assets/fonts/fraunces-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/blog/assets/fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/blog/assets/fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
html[data-theme="MATRIX_GREEN"] {
  --paper: #F3F0E7;
  --surface: #E7E1D4;
  --ink: #1F1E1B;
  --muted: #5E5A53;
  --rule: #D5CFC3;
  --yellow: #E2B122;
  --yellow-soft: #F0C94A;
  --serif-display: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", "Songti TC", "Songti SC", "Noto Serif TC", "Noto Serif SC", PMingLiU, serif;
  --serif-text: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", "Songti TC", "Songti SC", "Noto Serif TC", "Noto Serif SC", PMingLiU, serif;
  --sans: "Avenir Next", "PingFang TC", "PingFang SC", "Noto Sans TC", "Noto Sans SC", "Microsoft JhengHei", sans-serif;
  --measure: 40rem;
  color-scheme: light;
}

html[data-theme="PHOSPHOR_AMBER"] {
  --paper: #F6F0E4;
  --surface: #EFE4D0;
  --ink: #2A2118;
  --muted: #6A5A48;
  --rule: #E0D2BC;
  --yellow: #E2A122;
  --yellow-soft: #F0C46A;
}

html[data-theme="SOFT_LIGHT"] {
  --paper: #F7F6F2;
  --surface: #EEECE6;
  --ink: #1C1C1A;
  --muted: #5C5C58;
  --rule: #D9D6CE;
  --yellow: #D6B23A;
  --yellow-soft: #E8D48A;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: clip;
}

img { max-width: 100%; display: block; }

h1, h2, h3, p { overflow-wrap: break-word; }

h1, h2, h3 {
  font-family: var(--serif-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--yellow-soft);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1rem;
  z-index: 40;
  text-decoration: none;
}

.skip:focus { transform: none; }

.thread {
  height: 6px;
  background: var(--yellow);
}

.wrap {
  width: min(76rem, calc(100% - 2rem));
  margin-inline: auto;
}

.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.mast-row {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0.2rem 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  min-height: 44px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 0.62rem;
  height: 0.62rem;
  background: var(--yellow);
  align-self: center;
  flex: none;
}

.brand-name {
  font-family: var(--serif-display);
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand-en {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}

.mast-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.15rem;
}

.nav-desktop a,
.nav-mobile a {
  font-family: var(--sans);
  font-size: 0.92rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
}

.nav-desktop a[aria-current="page"],
.nav-mobile a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--yellow);
}

.nav-mobile { position: relative; }

.nav-mobile summary {
  font-family: var(--sans);
  font-size: 0.92rem;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  cursor: pointer;
  list-style: none;
}

.nav-mobile summary::-webkit-details-marker { display: none; }

.nav-mobile nav {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  background: var(--paper);
  border: 1px solid var(--rule);
  min-width: 9rem;
  display: grid;
  padding: 0.35rem 0;
  z-index: 30;
}

.theme-console {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.theme-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-right: 0.2rem;
}

.theme-btn {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.45rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-btn.is-active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--yellow);
}

.kicker {
  margin: 0 0 0.55rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-link {
  font-family: var(--sans);
  font-size: 0.92rem;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.2rem;
  border-bottom: 1px solid var(--ink);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.section-head h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); }

.lede {
  margin: 0.8rem 0 0;
  max-width: 38rem;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.6;
}

.home-intro { padding: 1.6rem 0 0.4rem; }

.home-intro h1 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 4.4rem);
  max-width: 12em;
}

.home-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin-top: 1.2rem;
}

.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.4rem;
  padding: 1.6rem 0 3rem;
}

.note-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
}

.note-feature > div { order: 1; }
.note-cover { order: 2; }

.note-cover {
  display: block;
  background: var(--surface);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  text-decoration: none;
}

.note-cover img,
.news-lead-image img,
.card-image img,
.hero-image img,
.suggestion-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-feature h3,
.note-list h3 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
}

.note-feature h3 a,
.note-list a,
.card-title a,
.news-item h3 a,
.news-lead h3 a {
  text-decoration: none;
}

.note-feature h3 a:hover,
.note-list a:hover,
.card-title a:hover,
.news-item h3 a:hover,
.news-lead h3 a:hover,
.suggestion-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.summary,
.card-summary,
.note-summary,
.news-lead p {
  color: var(--ink);
}

.meta-line,
.card-meta,
.note-meta,
.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  margin: 0.55rem 0 0;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}

.note-list {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
}

.note-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--rule);
}

.note-list h3 { font-size: 1.25rem; }

.note-index {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-top: 0.35rem;
}

.news-desk {
  background: var(--surface);
  padding: 1.15rem 1rem 1.25rem;
  min-width: 0;
  max-width: 100%;
}

.news-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}

.news-lead-image {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper);
  text-decoration: none;
}

.news-lead h3 { margin: 0; font-size: 1.45rem; }

.news-lead > div > p:not(.news-meta) {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0.45rem 0 0;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}

.news-item h3 {
  margin: 0;
  font-family: var(--serif-text);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
}

.news-summary {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-index {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 0.25rem;
}

.channel-row {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.8rem 0 0.2rem;
  margin: 0;
}

.channel-row a {
  flex: none;
  font-family: var(--sans);
  font-size: 0.82rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.15rem;
  border-bottom: 1px solid transparent;
}

.channel-row a:hover { border-bottom-color: var(--ink); }

.empty-note {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.6rem 0 2.4rem;
}

.site-footer-copy,
.site-footer-meta {
  margin: 0;
  max-width: 46rem;
}

.site-footer-copy { font-size: 0.98rem; }

.site-footer-meta {
  margin-top: 0.8rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 1rem;
}

.footer-links a {
  font-family: var(--sans);
  font-size: 0.88rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.feed-page { padding-bottom: 3rem; }

.feed-intro { padding: 1.5rem 0 0.5rem; }

.feed-intro h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  max-width: 14em;
}

.feed-meta,
.status-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin: 1rem 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sys-pill strong,
.stat-card b {
  color: var(--ink);
  font-weight: 600;
}

.stat-card {
  min-width: 5.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--rule);
}

.stat-card span { display: block; }

.stat-card b {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--serif-display);
  font-size: 1.35rem;
  font-weight: 500;
}

.category-console { margin: 0.4rem 0 0.2rem; }

.category-title {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.categories {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.category-btn {
  flex: none;
  font-family: var(--sans);
  font-size: 0.88rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.65rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}

.category-btn.is-active {
  color: var(--ink);
  border-bottom-color: var(--yellow);
}

.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.6rem;
}

.feed-head h2 { margin: 0; font-size: 1.4rem; }

.feed-grid { display: flex; flex-direction: column; }

.intel-card {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: 0.75rem 0.85rem;
  align-items: start;
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
}

.intel-card:first-child { grid-template-columns: minmax(0, 1fr); }

.card-image {
  display: block;
  background: var(--surface);
  aspect-ratio: 1;
  overflow: hidden;
  text-decoration: none;
}

.intel-card:first-child .card-image { aspect-ratio: 16 / 10; }

.image-empty {
  display: grid;
  place-items: center;
  min-height: 6rem;
  height: 100%;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.card-title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

.card-summary {
  margin: 0.45rem 0 0;
  font-size: 1.02rem;
  line-height: 1.6;
}

.intel-card:not(:first-child) .card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.category-tag,
.keyword {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--yellow-soft);
  padding: 0.2rem 0.45rem;
}

.card-actions,
.action-row,
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.action-btn,
.submit-btn {
  font-family: var(--sans);
  font-size: 0.88rem;
  min-height: 44px;
  padding: 0 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.action-btn.primary,
.submit-btn {
  background: var(--yellow);
  border-color: var(--yellow);
}

.action-btn:disabled,
.action-btn.is-disabled,
.submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.empty-state,
.state-panel {
  display: none;
  margin: 1rem 0;
  font-family: var(--sans);
  color: var(--muted);
}

.empty-state.is-visible,
.state-panel.is-visible { display: block; }

.date-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.5rem 0 1rem;
}

.date-nav:empty { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%) translateY(0.4rem);
  max-width: min(28rem, calc(100% - 2rem));
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

.toast.is-visible { opacity: 1; }

.optimize-panel {
  display: none;
  width: min(76rem, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--rule);
}

.optimize-panel.is-open { display: grid; gap: 0.7rem; }

.optimize-panel textarea,
.prompt-panel textarea {
  width: 100%;
  min-height: 7rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  padding: 0.75rem;
  resize: vertical;
}

.reading {
  width: min(46rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 3rem;
}

.reading-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.8rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}

.reading-kicker a { color: var(--ink); }

.hero-image {
  margin: 1rem 0 0;
  background: var(--surface);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
}

.hero-image:empty,
.hero-image:not(:has(img)) { aspect-ratio: auto; min-height: 0; }

.reading h1 {
  margin: 0.2rem 0 0.8rem;
  font-size: clamp(2rem, 6vw, 3.35rem);
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.2rem 0 0.9rem;
}

.keyword-row:empty { display: none; }

.summary {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.75;
  max-width: 65ch;
}

.entry-id {
  display: block;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detail-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-top: 1.1rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
}

.side-panel { margin-top: 1.6rem; }

.group-title,
.prompt-title {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.55rem;
}

.prompt-panel {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.feedback-note {
  margin: 0.4rem 0 0.6rem;
  font-family: var(--sans);
  font-size: 0.88rem;
}

.feedback-note.is-error { color: #8C2F2F; }

.suggestion-panel { margin-top: 1.8rem; }

.suggestion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
}

.suggestion-card {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.75rem;
  text-decoration: none;
  align-items: center;
  min-height: 44px;
}

.suggestion-thumb {
  aspect-ratio: 1;
  background: var(--surface);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.68rem;
}

.suggestion-title {
  margin: 0;
  font-family: var(--serif-text);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
}

@media (min-width: 390px) {
  .brand-name { font-size: 1.7rem; }
}

@media (max-width: 389px) {
  .brand-en { display: none; }
}

@media (min-width: 768px) {
  .wrap { width: min(76rem, calc(100% - 3rem)); }
  .nav-desktop { display: flex; }
  .nav-mobile { display: none; }
  .news-desk { padding: 1.4rem 1.25rem 1.5rem; }
  .intel-card {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 1rem 1.25rem;
  }
  .intel-card:first-child {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
  .card-image { aspect-ratio: 4 / 3; }
  .suggestion-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .suggestion-card { grid-template-columns: 4.5rem minmax(0, 1fr); }
}

@media (min-width: 1024px) {
  .home-split {
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.82fr);
    gap: 2.5rem 3rem;
    align-items: start;
  }
  .layout {
    width: min(76rem, calc(100% - 3rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 42rem) minmax(16rem, 22rem);
    gap: 2.5rem 3rem;
    align-items: start;
    padding-bottom: 3rem;
  }
  .reading {
    width: auto;
    margin: 0;
    padding-top: 1.6rem;
  }
  .side-panel .suggestion-grid { grid-template-columns: minmax(0, 1fr); }
  .side-panel {
    margin-top: 0;
    position: sticky;
    top: 5.4rem;
    padding-top: 1.8rem;
  }
}

@media (min-width: 1440px) {
  .home-intro h1 { font-size: 4.6rem; }
}

.layout.is-hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
