@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;800;900&display=swap");

:root {
  --canvas: #f2f3f1;
  --surface: #fff;
  --ink: #121212;
  --ink-soft: #5f625f;
  --muted: #858985;
  --line: #dedfdd;
  --line-soft: #e9eae8;
  --accent: #5c63ef;
  --accent-2: #b84df3;
  --cyan: #4ec7ee;
  --lime: #caff62;
  --content: min(1280px, calc(100vw - 48px));
  --shadow-soft: 0 14px 38px rgba(25, 28, 25, .06);
  --shadow-card: 0 7px 20px rgba(25, 28, 25, .055);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

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

.site-header {
  position: sticky; top: 16px; z-index: 50;
  width: var(--content); min-height: 72px; margin: 16px auto 0;
  padding: 8px 10px 8px 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 24px rgba(24, 26, 24, .07);
  backdrop-filter: blur(18px);
}
.brand {
  width: fit-content; font-size: 23px; font-weight: 900;
  letter-spacing: -.055em; text-decoration: none;
}
.brand::after { content: "."; color: var(--accent); }
.desktop-nav {
  padding: 4px 16px; display: flex; gap: 28px; align-items: center;
  border: 1px solid var(--line-soft); border-radius: 999px;
  background: rgba(250, 250, 250, .9);
}
.desktop-nav a, .site-footer nav a {
  min-height: 40px; display: inline-flex; align-items: center;
  color: #4d504d; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: color 180ms ease;
}
.desktop-nav a:hover, .site-footer nav a:hover { color: var(--ink); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.search-toggle, .menu-toggle {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--ink); background: white; cursor: pointer;
}
.search-toggle svg {
  width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round;
}
.menu-toggle { display: none; padding: 10px; }
.menu-toggle span {
  width: 20px; height: 1.5px; display: block; margin: 2.5px auto;
  background: currentColor; transition: transform 180ms ease, opacity 180ms ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }
.search-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: min(430px, calc(100vw - 32px)); padding: 20px;
  border: 1px solid var(--line); border-radius: 20px;
  background: white; box-shadow: var(--shadow-soft);
}
.search-panel label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.search-panel div { display: flex; }
.search-panel input {
  min-width: 0; flex: 1; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px 0 0 10px; background: #fafafa;
}
.search-panel button {
  min-height: 48px; padding: 0 20px; border: 1px solid var(--ink);
  border-radius: 0 10px 10px 0; color: white; background: var(--ink); cursor: pointer;
}
.mobile-nav { display: none; }

.archive-main { min-height: 70vh; }
.archive-intro {
  position: relative; width: var(--content); min-height: 690px;
  margin: 42px auto 0; padding: clamp(62px, 7vw, 96px) 48px 0;
  overflow: hidden; border: 1px solid var(--line); border-radius: 34px;
  background: radial-gradient(circle at 50% 34%, rgba(111, 91, 245, .13), transparent 29%), var(--surface);
  box-shadow: var(--shadow-soft);
}
.archive-title-row {
  position: relative; z-index: 2; max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.archive-kicker {
  margin: 0 0 26px; display: inline-flex; align-items: center; gap: 9px;
  color: #555855; font-size: 11px; font-weight: 800; letter-spacing: .12em;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #54c87b;
  box-shadow: 0 0 0 4px rgba(84, 200, 123, .14);
}
.archive-intro h1 {
  margin: 0; max-width: 820px; font-size: clamp(46px, 5.8vw, 78px);
  font-weight: 800; line-height: 1.12; letter-spacing: -.055em; text-wrap: balance;
}
.archive-intro h1 span { display: inline; }
.archive-intro .title-accent { color: var(--accent); white-space: nowrap; }
.archive-description {
  max-width: 620px; margin: 27px 0 0; color: var(--ink-soft);
  font-size: 16px; line-height: 1.8;
}
.hero-read-link {
  min-height: 52px; margin-top: 30px; padding: 0 22px 0 25px;
  display: inline-flex; align-items: center; gap: 16px; border-radius: 999px;
  color: white; background: linear-gradient(100deg, #5365ee, #b54cf1);
  box-shadow: 0 9px 20px rgba(84, 83, 226, .2); text-decoration: none; font-weight: 700;
}
.hero-read-link span {
  width: 28px; height: 28px; display: grid !important; place-items: center;
  border-radius: 50%; color: var(--accent); background: white;
}
.archive-mark {
  position: absolute; left: 50%; top: 40%; width: min(620px, 62vw); height: 110px;
  opacity: .55; transform: translate(-50%, -50%) rotate(-3deg); pointer-events: none;
}
.archive-mark svg { width: 100%; height: 100%; }
.archive-mark path {
  fill: none; stroke: var(--cyan); stroke-width: 4; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.story-shelf {
  position: absolute; left: -36px; right: -36px; bottom: -64px; z-index: 3;
  display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 14px;
  transform: rotate(-1deg);
}
.shelf-card {
  min-height: 225px; padding: 20px; display: flex; flex-direction: column;
  justify-content: space-between; border: 5px solid white; border-radius: 20px;
  box-shadow: 0 12px 28px rgba(22, 24, 22, .14); color: var(--ink);
  text-decoration: none; transition: transform 180ms ease;
}
.shelf-card:nth-child(even) { transform: translateY(18px) rotate(1.5deg); }
.shelf-number {
  width: fit-content; padding: 5px 9px; border: 1px solid currentColor;
  border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .08em;
}
.shelf-card strong { max-width: 9em; font-size: 19px; line-height: 1.25; }
.shelf-card-ai { background: var(--lime); }
.shelf-card-prompt { color: white; background: #575fe4; }
.shelf-card:nth-child(3) { background: #f5d056; }
.shelf-card:nth-child(4) { color: white; background: #c24de0; }
.shelf-card-html { background: #ff8f68; }

.archive-controls, .archive-featured, .archive-list { width: var(--content); margin-inline: auto; }
.archive-controls { padding: 38px 0 112px; }
.article-filters {
  min-height: 82px; padding: 14px 16px 14px 24px;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  border: 1px solid var(--line); border-radius: 24px; background: white;
  box-shadow: var(--shadow-card);
}
.article-filters > p { margin: 0; }
.article-filters > p:first-child { font-size: 13px; font-weight: 700; white-space: nowrap; }
.filter-list { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-button {
  min-height: 44px; padding: 0 15px; border: 1px solid var(--line);
  border-radius: 999px; color: #4f524f; background: #fafafa;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.filter-button.is-active { border-color: var(--ink); color: white; background: var(--ink); }
.filter-status { color: var(--muted); font-size: 12px; white-space: nowrap; }

.section-heading-row, .archive-list-heading {
  margin-bottom: 34px; padding-bottom: 16px; display: flex;
  align-items: end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line);
}
.section-index {
  margin: 0 0 8px; color: var(--accent); font-size: 11px;
  font-weight: 800; letter-spacing: .12em;
}
.section-heading-row h2, .archive-list-heading h2 {
  margin: 0; font-size: clamp(30px, 3.2vw, 45px);
  line-height: 1.18; letter-spacing: -.04em;
}
.section-count {
  padding-bottom: 5px; color: var(--muted); font-size: 10px;
  font-weight: 800; letter-spacing: .1em;
}

.archive-featured { padding-bottom: 118px; }
.featured-entry {
  padding: 16px; display: grid; grid-template-columns: 1.08fr .92fr;
  align-items: stretch; border: 1px solid var(--line); border-radius: 28px;
  background: white; box-shadow: var(--shadow-card);
}
.featured-art {
  min-height: 500px; position: relative; display: block; overflow: hidden;
  border-radius: 19px; color: var(--ink);
  background: linear-gradient(rgba(18,18,18,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18,18,18,.08) 1px, transparent 1px), var(--lime);
  background-size: 32px 32px; text-decoration: none;
}
.orbit {
  position: absolute; left: 50%; top: 50%; border: 1.5px solid var(--ink);
  border-radius: 50%; transform: translate(-50%, -50%);
}
.orbit-one { width: 380px; height: 380px; }
.orbit-two { width: 270px; height: 270px; }
.orbit-three { width: 150px; height: 150px; background: rgba(255,255,255,.72); }
.core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 36px; font-weight: 900;
}
.node {
  position: absolute; padding: 6px 12px; border: 1px solid var(--ink);
  border-radius: 999px; background: white; font-size: 12px; font-weight: 700;
}
.node-a { left: 18%; top: 27%; }
.node-b { right: 17%; top: 37%; }
.node-c { left: 33%; bottom: 20%; }
.featured-art p { position: absolute; left: 26px; bottom: 14px; font-size: 12px; }
.featured-copy { padding: clamp(34px, 5vw, 68px); align-self: center; }
.entry-state {
  margin: 0 0 14px; padding-bottom: 10px; display: flex;
  justify-content: space-between; gap: 16px; color: var(--muted);
  border-bottom: 1px solid var(--line-soft); font-size: 10px;
  font-weight: 800; letter-spacing: .08em;
}
.entry-state span:first-child { color: var(--ink); }
.tag-list {
  margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; list-style: none;
}
.tag-list button, .tag-list span {
  min-height: 34px; padding: 6px 11px; display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; color: #555855;
  background: #f8f8f7; font-size: 11px; font-weight: 600;
}
.tag-list button { cursor: pointer; }
.featured-copy h2 {
  margin: 0; font-size: clamp(30px, 3.1vw, 44px);
  line-height: 1.25; letter-spacing: -.045em;
}
.featured-copy > p { margin: 22px 0 26px; color: var(--ink-soft); font-size: 16px; }
.text-link {
  min-height: 44px; display: inline-flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 700; text-underline-offset: 5px;
}

.archive-list { padding: 0 0 120px; }
.article-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
}
.article-card {
  min-width: 0; padding: 12px 12px 24px; border: 1px solid var(--line);
  border-radius: 21px; background: white; box-shadow: var(--shadow-card);
  animation: article-enter 260ms ease both;
}
@keyframes article-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.article-index-meta { margin: 0 4px 10px; border-bottom: 0; }
.article-index-meta span { padding: 5px 9px; border: 1px solid currentColor; border-radius: 999px; }
.thumbnail {
  aspect-ratio: 1.24 / 1; margin-bottom: 17px; position: relative;
  display: flex; overflow: hidden; border-radius: 14px; color: inherit;
  background: #eeeeeb; text-decoration: none; transition: transform 180ms ease;
}
.article-card:nth-child(1) .thumbnail { background: #5e65e8; }
.article-card:nth-child(2) .thumbnail { background: #f4d052; }
.article-card:nth-child(3) .thumbnail { background: #c24de0; }
.article-card:nth-child(4) .thumbnail { background: #ff926b; }
.article-card .tag-list { margin-inline: 4px; }
.article-card h3 {
  margin: 0 4px; font-size: clamp(23px, 2vw, 29px);
  line-height: 1.28; letter-spacing: -.035em;
}
.article-card h3 a { text-decoration: none; }
.article-card > p:last-child {
  margin: 11px 4px 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7;
}
.thumb-prompt { align-items: center; justify-content: center; gap: 6px; color: white; }
.prompt-line {
  padding: 7px 9px; border: 1px solid currentColor; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.thumb-prompt i { width: 16px; height: 1px; background: currentColor; }
.tool-window {
  position: absolute; width: 58%; height: 58%; border: 1px solid var(--ink);
  border-radius: 9px; background: white;
}
.window-a { left: 13%; top: 12%; transform: rotate(-5deg); }
.window-b { right: 10%; bottom: 10%; transform: rotate(4deg); background: var(--lime); }
.tool-cursor {
  position: absolute; left: 50%; top: 44%; width: 26px; height: 34px;
  background: var(--ink); clip-path: polygon(0 0, 100% 65%, 58% 67%, 48% 100%);
}
.thumb-skill { align-items: center; justify-content: center; }
.skill-sheet {
  position: absolute; width: 52%; height: 64%; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 9px; font-size: 18px; font-weight: 800;
}
.sheet-a { transform: translate(-20px, 8px) rotate(-7deg); background: #d7e1ff; }
.sheet-b { transform: translate(18px, -4px) rotate(4deg); background: white; }
.thumb-html {
  padding: 22px; flex-direction: column; justify-content: center; gap: 10px;
  font-family: ui-monospace, monospace;
}
.html-tag { color: #71351f; font-size: 12px; }
.html-box {
  padding: 13px; border: 1px solid var(--ink); border-radius: 8px;
  background: white; font-family: "Noto Sans TC", sans-serif; font-size: 12px;
}
.archive-empty {
  margin: 0; padding: 70px 20px; border: 1px dashed var(--line);
  border-radius: 20px; color: var(--muted); text-align: center;
}
.site-footer {
  width: var(--content); min-height: 180px; margin: 0 auto 28px; padding: 40px;
  display: flex; align-items: end; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 26px; background: white;
}
.site-footer p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 24px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
@media (hover: hover) {
  .shelf-card:hover { transform: translateY(-7px) rotate(0); }
  .thumbnail:hover { transform: scale(.985); }
  .article-card h3 a:hover { text-decoration: underline; text-underline-offset: 5px; }
  .tag-list button:hover { border-color: var(--ink); color: var(--ink); }
}

@media (max-width: 1050px) {
  :root { --content: min(100% - 32px, 940px); }
  .site-header { grid-template-columns: auto 1fr auto; }
  .desktop-nav { gap: 18px; }
  .desktop-nav a { font-size: 12px; }
  .archive-intro { padding-inline: 30px; }
  .story-shelf { grid-template-columns: repeat(5, minmax(165px, 1fr)); }
  .article-filters { grid-template-columns: 1fr auto; }
  .article-filters > p:first-child { grid-column: 1; }
  .filter-list { grid-column: 1 / -1; grid-row: 2; }
  .filter-status { grid-column: 2; grid-row: 1; }
  .featured-entry { grid-template-columns: 1fr; }
  .featured-art { min-height: 470px; }
  .featured-copy { padding: 42px 30px 48px; }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --content: calc(100% - 24px); }
  .site-header {
    top: 8px; min-height: 64px; margin-top: 8px; padding: 7px 7px 7px 18px;
    grid-template-columns: 1fr auto;
  }
  .brand { font-size: 21px; }
  .desktop-nav { display: none; }
  .header-actions { gap: 5px; }
  .search-toggle, .menu-toggle { width: 44px; height: 44px; }
  .menu-toggle { display: block; }
  .mobile-nav {
    position: absolute; left: 0; right: 0; top: calc(100% + 9px);
    padding: 12px 18px 18px; display: grid; border: 1px solid var(--line);
    border-radius: 22px; background: white; box-shadow: var(--shadow-soft);
  }
  .mobile-nav a {
    min-height: 48px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--line-soft); font-size: 14px; text-decoration: none;
  }
  .mobile-nav a:last-child { border-bottom: 0; }
  .mobile-nav a::after { content: "→"; }
  .search-panel { right: -1px; }
  .archive-intro {
    min-height: 630px; margin-top: 22px; padding: 54px 22px 0; border-radius: 26px;
  }
  .archive-intro h1 {
    max-width: 10em; font-size: clamp(39px, 11.8vw, 55px);
    line-height: 1.15; letter-spacing: -.05em;
  }
  .archive-description { font-size: 14px; }
  .hero-read-link { margin-top: 24px; }
  .archive-mark { width: 110vw; opacity: .35; }
  .story-shelf {
    left: 0; right: 0; bottom: -80px;
    padding: 10px 22px 82px; display: flex; gap: 10px;
    overflow-x: auto; transform: none; scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .story-shelf::-webkit-scrollbar { display: none; }
  .shelf-card { min-height: 205px; padding: 16px; flex: 0 0 160px; scroll-snap-align: start; }
  .shelf-card strong { font-size: 16px; }
  .archive-controls { padding: 28px 0 82px; }
  .article-filters { padding: 18px; display: block; border-radius: 20px; }
  .filter-list {
    margin-top: 14px; flex-wrap: nowrap; overflow-x: auto;
    padding-bottom: 5px; scrollbar-width: none;
  }
  .filter-list::-webkit-scrollbar { display: none; }
  .filter-button { flex: 0 0 auto; }
  .filter-status { display: block; margin-top: 12px !important; }
  .section-heading-row, .archive-list-heading { margin-bottom: 24px; align-items: end; }
  .section-heading-row h2, .archive-list-heading h2 { font-size: 31px; }
  .section-count { font-size: 9px; white-space: nowrap; }
  .archive-featured { padding-bottom: 84px; }
  .featured-entry { padding: 10px; border-radius: 22px; }
  .featured-art { min-height: 335px; border-radius: 15px; }
  .orbit-one { width: 270px; height: 270px; }
  .orbit-two { width: 190px; height: 190px; }
  .orbit-three { width: 108px; height: 108px; }
  .featured-copy { padding: 30px 12px 34px; }
  .featured-copy h2 { font-size: 29px; }
  .featured-copy > p { font-size: 15px; }
  .tag-list button, .tag-list span { min-height: 38px; }
  .archive-list { padding-bottom: 82px; }
  .article-grid { grid-template-columns: 1fr; gap: 18px; }
  .article-card { padding: 10px 10px 25px; }
  .article-card h3 { font-size: 25px; }
  .thumbnail { aspect-ratio: 1.32 / 1; }
  .article-index-meta { margin-top: 2px; }
  .article-card .tag-list button { min-height: 44px; }
  .site-footer { min-height: 0; padding: 30px 24px; display: block; }
  .site-footer nav { margin-top: 30px; justify-content: start; }
}

@media (max-width: 390px) {
  .archive-intro { min-height: 620px; }
  .archive-intro h1 { font-size: 39px; }
  .hero-read-link { min-height: 50px; }
  .section-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .shelf-card:hover, .thumbnail:hover { transform: none; }
}
