:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --paper: #ffffff;
  --ink: #26221f;
  --muted: #70665f;
  --line: #e6ddd5;
  --accent: #8b5e4c;
  --accent-soft: #efe1d9;
  --green: #62745f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-bottom: 82px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  line-height: 1.7;
}

.is-locked body {
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(251, 250, 247, 0.96);
  backdrop-filter: blur(14px);
}

.password-gate[hidden] {
  display: none;
}

.password-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 22px 60px rgba(38, 34, 31, 0.16);
}

.password-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.password-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

.password-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.password-card label {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

.password-card input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.password-card input:focus {
  outline: 2px solid rgba(139, 94, 76, 0.28);
  border-color: var(--accent);
}

.password-card button {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.password-error {
  margin-top: 12px !important;
  color: #b3261e !important;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(251, 250, 247, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  color: var(--ink);
  font-weight: 750;
}

nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(420px, calc(100% - 28px));
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(38, 34, 31, 0.12);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.bottom-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
}

.bottom-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.bottom-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(139, 94, 76, 0.18);
}

.is-share-view .article-side,
.is-share-view .bottom-nav,
.is-share-view .share-tools {
  display: none;
}

.is-share-view body {
  padding-bottom: 24px;
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.layout,
.article-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.article-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.article-heading > div {
  min-width: 0;
  flex: 1 1 auto;
}

.article-heading h1 {
  margin-bottom: 8px;
}

.share-toggle {
  flex: 0 0 auto;
  min-height: 42px;
  margin-top: 6px;
  padding: 0 16px;
  border: 1px solid rgba(139, 94, 76, 0.22);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.is-share-view .share-toggle {
  display: none;
}

.share-tools {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.share-tools[hidden] {
  display: none;
}

.share-tools h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.share-tools p {
  margin: 0;
  color: var(--muted);
}

.share-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  margin-top: 14px;
}

.share-link-row input {
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
}

.share-link-row button,
.download-qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}

.share-link-row button + button,
.download-qr {
  background: var(--green);
}

.download-qr:hover {
  text-decoration: none;
}

.qr-box {
  width: fit-content;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.qr-box svg {
  display: block;
  width: 180px;
  height: 180px;
}

.share-status {
  margin-top: 10px !important;
  color: var(--green) !important;
  font-weight: 750;
}

@media (max-width: 680px) {
  .article-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .share-toggle {
    min-height: 36px;
    margin-top: 2px;
    padding: 0 12px;
    font-size: 14px;
  }

  .share-link-row {
    grid-template-columns: 1fr;
  }

  .share-link-row button,
  .download-qr {
    width: 100%;
  }
}

.hero {
  padding: 56px 0 34px;
}

.hero h1,
.article h1,
.narrow h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.1;
  letter-spacing: 0;
}

.hero p,
.lead {
  max-width: 820px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0 22px;
}

input[type="search"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

input[type="search"] {
  max-width: 680px;
  padding: 12px 14px;
}

.search-wrap {
  position: relative;
  width: min(680px, 100%);
}

.search-wrap input[type="search"] {
  max-width: none;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 2px 0 4px;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 64px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.category-tab strong {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
}

.category-tab.active {
  border-color: rgba(139, 94, 76, 0.32);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(139, 94, 76, 0.16);
}

.category-tab.active strong {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.layout-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.list-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-icon {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  grid-template-rows: repeat(2, 5px);
  gap: 2px;
}

.toggle-icon::before,
.toggle-icon::after {
  content: "";
  grid-column: 1 / -1;
}

.toggle-icon,
.toggle-icon::before,
.toggle-icon::after {
  border-radius: 1px;
}

.toggle-icon {
  background:
    linear-gradient(currentColor 0 0) 0 0 / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 7px 0 / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 0 7px / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 7px 7px / 5px 5px no-repeat;
  width: 12px;
  height: 12px;
}

#count {
  color: var(--muted);
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  padding-bottom: 36px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.card a {
  display: grid;
  color: inherit;
  text-decoration: none;
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--accent-soft);
}

.card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 18px;
  background: linear-gradient(135deg, #f7ebe4, #fffaf6);
  color: var(--accent);
  font-size: 24px;
  font-weight: 850;
  text-align: center;
}

.card-body {
  padding: 13px 14px 15px;
}

.card h2 {
  margin: 6px 0 0;
  font-size: 22px;
  line-height: 1.25;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.shape-tag {
  background: #eef3ec;
  color: var(--green);
}

.card p {
  margin: 0;
  color: var(--muted);
}

.original-title {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.source-note {
  margin: 0 0 48px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.article-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 36px;
  padding: 34px 0 64px;
}

.article-side {
  position: sticky;
  top: 74px;
  align-self: start;
}

.back {
  display: inline-block;
  margin-bottom: 16px;
}

.meta-box,
.glossary,
.quick-card,
.intro-block,
.note-panel,
.article section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.meta-box {
  padding: 16px;
}

.glossary {
  margin-top: 14px;
  padding: 16px;
}

.glossary dl {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px 10px;
  margin: 0;
}

.glossary dt {
  color: var(--accent);
  font-weight: 750;
}

.glossary dd {
  margin: 0;
  color: var(--muted);
}

.meta-box p {
  margin: 0 0 14px;
}

.article,
.narrow {
  padding-bottom: 64px;
}

.article h2,
.narrow h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.article h3 {
  margin: 24px 0 8px;
  color: var(--accent);
}

.article section,
.note-panel {
  margin-top: 24px;
  padding: clamp(18px, 3vw, 28px);
}

.quick-card {
  margin-top: 24px;
  padding: clamp(18px, 3vw, 28px);
  background: var(--paper);
}

.intro-block {
  margin-top: 24px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--paper);
}

.intro-block p {
  color: #4f4944;
  font-size: 20px;
  line-height: 1.95;
}

.intro-heading {
  margin: 28px 0 10px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.35;
}

.intro-block .color-note {
  margin: 18px 0 22px;
  padding: 18px 20px 18px 24px;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #f7ebe4;
  color: var(--ink);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.85;
}

.color-note span {
  display: inline-block;
  margin-right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  vertical-align: 2px;
}

.intro-block details {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.intro-block summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.intro-block details p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.section-note {
  color: var(--muted);
  font-size: 15px;
}

.original-article h3 {
  margin: 30px 0 12px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 800;
}

.original-article p {
  color: #4f4944;
  font-size: 19px;
  line-height: 1.9;
}

.original-figure {
  margin: 22px 0;
}

.original-figure img {
  width: min(100%, 760px);
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 22px 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--accent-soft);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quick-grid div {
  padding: 14px;
  border-radius: 8px;
  background: var(--accent-soft);
}

.quick-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.quick-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.hero-image {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

textarea {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

ol,
ul {
  padding-left: 1.4em;
}

li + li {
  margin-top: 6px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

figure {
  margin: 0;
}

figure img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--accent-soft);
}

figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.narrow {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 42px;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 8px;
  background: #2d2926;
  color: #fffaf2;
}

@media (max-width: 760px) {
  body {
    line-height: 1.65;
  }

  .topbar,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 10px;
    padding: 12px 16px;
  }

  nav {
    gap: 12px;
    font-size: 13px;
  }

  .layout,
  .article-layout,
  .narrow {
    width: min(100% - 24px, 680px);
  }

  .hero {
    padding: 34px 0 22px;
  }

  .hero h1,
  .article h1,
  .narrow h1 {
    font-size: 36px;
    line-height: 1.12;
  }

  .eyebrow {
    font-size: 11px;
  }

  input[type="search"] {
    max-width: none;
    padding: 13px 14px;
    font-size: 16px;
  }

  .search-wrap {
    width: 100%;
  }

  .category-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 2px 0 4px;
  }

  .category-tab {
    min-width: 0;
    width: 100%;
    padding: 0 8px;
  }

  #count {
    font-size: 14px;
  }

  .list-tools {
    width: 100%;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .grid[data-mobile-columns="one"] {
    grid-template-columns: 1fr;
  }

  .card img {
    aspect-ratio: 1 / 1;
  }

  .card-placeholder {
    aspect-ratio: 1 / 1;
    font-size: 20px;
  }

  .grid[data-mobile-columns="one"] .card img {
    aspect-ratio: 16 / 10;
  }

  .grid[data-mobile-columns="one"] .card-placeholder {
    aspect-ratio: 16 / 10;
  }

  .card-body {
    padding: 10px 11px 12px;
  }

  .card h2 {
    margin-top: 5px;
    font-size: 17px;
    line-height: 1.18;
  }

  .card-tag {
    height: 20px;
    padding: 0 7px;
    font-size: 11px;
  }

  .grid[data-mobile-columns="one"] .card-body {
    padding: 14px;
  }

  .grid[data-mobile-columns="one"] .card h2 {
    font-size: 21px;
  }

  .article-layout {
    display: block;
    padding: 20px 0 48px;
  }

  .article-side {
    position: static;
    margin-bottom: 18px;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .article section,
  .note-panel,
  .intro-block,
  .quick-card {
    margin-top: 16px;
    padding: 16px;
  }

  .original-article p {
    font-size: 17px;
    line-height: 1.8;
  }

  .original-article h3,
  .intro-heading {
    font-size: 22px;
  }

  .original-figure {
    margin: 18px 0;
  }

  .original-figure img {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .topbar {
    position: static;
  }

  .brand {
    font-size: 15px;
  }

  .hero {
    padding-top: 24px;
  }

  .hero h1,
  .article h1,
  .narrow h1 {
    font-size: 30px;
  }

  .toolbar {
    margin-top: 4px;
  }

  .card img {
    aspect-ratio: 1 / 1;
  }

  .card h2 {
    font-size: 17px;
  }

  .card-placeholder {
    font-size: 18px;
  }

  .grid[data-mobile-columns="one"] .card img {
    aspect-ratio: 4 / 3;
  }

  .grid[data-mobile-columns="one"] .card h2 {
    font-size: 20px;
  }
  }

  .meta-box {
    padding: 14px;
  }

  .original-article p {
    font-size: 16px;
  }

  .bottom-nav {
    bottom: 10px;
    width: calc(100% - 20px);
    border-radius: 16px;
  }

  .bottom-nav a {
    flex-direction: column;
    gap: 2px;
    min-height: 48px;
    font-size: 12px;
  }

  .bottom-nav svg {
    width: 21px;
    height: 21px;
  }
}
