:root {
  color-scheme: dark;
  --bg: #0d0e0d;
  --panel: #161815;
  --panel-strong: #1d201c;
  --line: rgba(231, 225, 204, 0.14);
  --text: #f0eee6;
  --muted: #aaa99f;
  --accent: #d5a65b;
  --accent-strong: #f0c97f;
  --danger: #dd796d;
  --success: #83bd84;
  --radius: 18px;
  --account-drawer-width: min(380px, 32vw);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f0e7;
  --panel: #fffaf0;
  --panel-strong: #ebe4d7;
  --line: rgba(45, 42, 35, .16);
  --text: #22211d;
  --muted: #6f6b62;
  --accent: #a66d1d;
  --accent-strong: #80500d;
  --danger: #ae4139;
  --success: #397b45;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; color: var(--text); background:
  radial-gradient(circle at 15% -10%, rgba(213,166,91,.15), transparent 32rem),
  var(--bg); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.app-header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
  min-height: 72px; padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line); background: rgba(13,14,13,.88);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { display: block; width: 38px; height: 38px; padding: 6px; object-fit: contain; border-radius: 10px; background: #fbf3d3; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .12em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.main-nav { display: flex; gap: 6px; }
.main-nav a { padding: 9px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); background: var(--panel-strong); }
.header-actions, .account-actions { display: flex; align-items: center; gap: 10px; }
.header-product-link { color: var(--muted); font-size: 13px; white-space: nowrap; }
.header-product-link:hover, .header-product-link:focus-visible { color: var(--text); }
.locale-toggle {
  min-width: 38px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(22,24,21,.72);
  cursor: pointer;
}
.locale-toggle:hover, .locale-toggle:focus-visible { border-color: rgba(213,166,91,.5); outline: none; }
.theme-toggle { font-size: 18px; line-height: 1; }
.account-copy { display: grid; text-align: right; }
.account-copy small { color: var(--muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; }

.app-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 0; min-height: calc(100vh - 72px); transition: grid-template-columns .22s ease; }
.account-drawer-open .app-workspace { grid-template-columns: minmax(0, 1fr) var(--account-drawer-width); }
.app-main { width: min(1180px, calc(100% - 36px)); min-height: calc(100vh - 72px); margin: 0 auto; padding: 50px 0 90px; }
.app-main:has(> .login-experience) { display: grid; align-items: center; padding: 20px 0; }
.loading-state { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.spinner { width: 32px; height: 32px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.route-home { overflow-x: hidden; background: #0d1512; }
.route-home .app-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  border-bottom-color: rgba(239, 239, 232, .08);
  background: linear-gradient(180deg, rgba(10, 18, 15, .94), rgba(10, 18, 15, .42) 72%, transparent);
  backdrop-filter: none;
}
.route-home .app-main { width: 100%; min-height: 100svh; padding: 0; }
.route-discover .app-main { width: min(1640px, calc(100% - clamp(36px, 6vw, 104px))); }
.home-hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 88%, rgba(137, 93, 54, .24), transparent 38%),
    radial-gradient(ellipse at 14% 40%, rgba(38, 76, 65, .24), transparent 39%),
    radial-gradient(ellipse at 86% 28%, rgba(75, 68, 57, .18), transparent 34%),
    radial-gradient(ellipse at 50% 48%, rgba(230, 225, 205, .07), transparent 42%),
    linear-gradient(155deg, #0a1210 0%, #111a16 48%, #191611 100%);
}
.home-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .62;
  background-image:
    radial-gradient(circle at 50% 76%, rgba(213,166,91,.12), transparent 28%),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: auto, 92px 92px, 92px 92px;
  mask-image: linear-gradient(transparent 5%, #000 50%, transparent 100%);
}
.home-copy {
  position: relative;
  z-index: 12;
  align-self: start;
  width: min(820px, calc(100% - 36px));
  margin: clamp(118px, 14vh, 154px) auto 0;
  text-align: center;
  pointer-events: none;
}
.home-copy > p:first-child { margin-bottom: 13px; color: #d7b64a; font-size: 12px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.home-copy h1 { margin-bottom: 14px; font-family: "Songti SC", SimSun, STSong, serif; font-size: clamp(42px, 5.6vw, 82px); font-weight: 650; line-height: 1.02; letter-spacing: -.035em; text-shadow: 0 4px 28px rgba(0,0,0,.62); }
.home-copy > p:not(:first-child) { max-width: 620px; margin: 0 auto; color: rgba(240,238,230,.7); font-size: 16px; line-height: 1.7; }
.home-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; pointer-events: auto; }
.home-library-cta { position: absolute; left: 50%; bottom: 30px; z-index: 14; min-width: 150px; transform: translateX(-50%); box-shadow: 0 12px 42px rgba(0,0,0,.42), 0 0 24px rgba(213,166,91,.12); }
.home-orbit { position: absolute; inset: 0; z-index: 2; }
.home-text-figure {
  position: absolute;
  left: 50%;
  top: 47%;
  z-index: 5;
  width: clamp(420px, 42vw, 600px);
  aspect-ratio: 4 / 3.8;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 34px rgba(239,239,232,.1));
  pointer-events: auto;
}
.home-art-card {
  position: absolute;
  left: 0;
  top: 0;
  z-index: var(--orbit-z, 3);
  width: clamp(104px, calc(13vw * var(--card-size, 1)), 220px);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(239,239,232,.2);
  border-radius: 12px;
  opacity: var(--orbit-opacity, .36);
  background: rgba(14,18,16,.32);
  box-shadow: 0 18px 45px rgba(0,0,0,.38), 0 0 24px rgba(175,214,197,.12), inset 0 0 18px rgba(233,239,225,.05);
  filter: blur(var(--orbit-blur, 0)) saturate(.72) contrast(.96) brightness(.9);
  cursor: pointer;
  transform: translate3d(var(--orbit-x, 0), var(--orbit-y, 0), 0) scale(var(--orbit-scale, 1));
  will-change: transform, opacity;
  transition: opacity .25s ease, filter .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.home-art-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.home-art-like { position: absolute; right: 8px; bottom: 7px; z-index: 2; color: rgba(247,245,237,.9); font-size: 11px; font-weight: 700; line-height: 1; text-shadow: 0 1px 5px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.72); }
.home-art-card:hover, .home-art-card:focus-visible {
  z-index: 20;
  opacity: 1;
  filter: brightness(1.04) saturate(.96);
  border-color: rgba(215,182,74,.78);
  box-shadow: 0 24px 70px rgba(0,0,0,.72), 0 0 0 1px rgba(215,182,74,.14);
  outline: none;
}
.home-feature-note { position: absolute; right: 30px; bottom: 22px; z-index: 13; margin: 0; color: rgba(240,238,230,.46); font-size: 11px; letter-spacing: .04em; }

.home-login-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.home-login-backdrop { position: absolute; inset: 0; background: rgba(5,7,6,.5); backdrop-filter: blur(16px); }
.home-login-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
}
.home-login-close { position: absolute; top: 13px; right: 16px; z-index: 4; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: rgba(23,33,31,.66); font-size: 27px; line-height: 1; }
.home-login-close:hover, .home-login-close:focus-visible { color: var(--login-deep); background: rgba(23,33,31,.08); outline: none; }
.home-login-shell .login-experience { box-shadow: 0 32px 100px rgba(0,0,0,.58); }
.app-main:focus { outline: none; }

.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 28px; align-items: end; margin-bottom: 42px; }
.eyebrow { margin: 0 0 10px; color: var(--accent-strong); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(34px, 6vw, 70px); line-height: 1.02; letter-spacing: -.04em; }
h2 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -.025em; }
.hero p, .lede { color: var(--muted); font-size: 17px; line-height: 1.75; }
.hero-panel, .panel, .state-card, .prompt-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(29,32,28,.92), rgba(18,20,17,.94)); box-shadow: 0 22px 80px rgba(0,0,0,.18); }
.hero-panel { padding: 24px; border-radius: var(--radius); }
.hero-panel strong { display: block; margin-bottom: 7px; font-size: 24px; }
.hero-panel span { color: var(--muted); line-height: 1.6; }

.library-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  margin-bottom: 38px;
}
.library-intro h1 { max-width: 780px; margin-bottom: 14px; font-size: clamp(38px, 5.4vw, 68px); }
.library-intro > div > p:last-child { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.library-count { display: grid; min-width: 170px; padding: 18px 20px; border-left: 1px solid var(--line); }
.library-count strong { color: var(--accent-strong); font-size: 42px; line-height: 1; }
.library-count span { margin-top: 8px; color: var(--muted); font-size: 13px; }
.library-browser { padding-top: 28px; border-top: 1px solid var(--line); }
.library-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 28px; align-items: end; }
.library-toolbar h2 { margin-bottom: 5px; }
.library-toolbar p { margin: 0; color: var(--muted); }
.library-search { display: grid; gap: 8px; }
.library-search span { color: #d5d2c8; font-size: 13px; font-weight: 650; }
.library-search input { height: 46px; }
.category-tabs { display: flex; gap: 8px; margin: 22px 0; overflow-x: auto; scrollbar-width: thin; }
.category-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.category-tabs button:hover { color: var(--text); border-color: rgba(213,166,91,.45); }
.category-tabs button[aria-pressed="true"] { color: #1b150d; border-color: var(--accent); background: var(--accent-strong); font-weight: 750; }
.category-tabs button:focus-visible, .resource-card a:focus-visible, .resource-save-button:focus-visible, .back-link:focus-visible { outline: 3px solid rgba(213,166,91,.28); outline-offset: 3px; }
.resource-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 4px; grid-auto-flow: row dense; gap: 16px; align-items: start; }
.resource-card { position: relative; width: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(22,24,21,.76); transition: border-color .18s ease, transform .18s ease; }
.resource-card:hover { border-color: rgba(213,166,91,.42); transform: translateY(-2px); }
.resource-card-link { position: relative; display: grid; height: 100%; min-height: 220px; }
.resource-card-copy { display: grid; align-content: start; padding: 14px 15px 15px; }
.resource-card-image { position: relative; margin: 0; overflow: hidden; background: #111310; }
.resource-card-image::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 26px rgba(225,236,226,.08); pointer-events: none; }
.resource-card-image img { display: block; width: 100%; height: auto; transition: transform .28s ease, filter .28s ease; }
.resource-card:hover .resource-card-image img { transform: scale(1.018); filter: brightness(1.04); }
.resource-card.has-image .resource-card-link { display: block; min-height: 0; }
.resource-card.has-image .resource-card-image { width: 100%; }
.resource-category-badge { position: absolute; top: 10px; left: 10px; z-index: 5; padding: 5px 9px; border: 1px solid rgba(240,238,230,.2); border-radius: 999px; color: #f6f2e8; background: rgba(13,14,13,.58); font-size: 12px; backdrop-filter: blur(8px); }
.resource-like { position: absolute; top: 10px; right: 10px; z-index: 5; display: inline-grid; grid-auto-flow: column; place-items: center; gap: 4px; min-width: 38px; height: 34px; padding: 0 9px; border: 1px solid rgba(240,238,230,.24); border-radius: 999px; color: #f6f2e8; background: rgba(13,14,13,.58); cursor: pointer; backdrop-filter: blur(8px); }
.resource-like:hover, .resource-like.is-liked { color: #19140d; border-color: var(--accent); background: var(--accent-strong); }
.resource-hover-tools { position: absolute; right: 0; bottom: 0; left: 0; z-index: 4; display: flex; gap: 7px; align-items: center; min-height: 62px; padding: 16px 10px 10px; opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; background: linear-gradient(0deg, rgba(8,10,9,.88), rgba(8,10,9,.58) 62%, transparent); }
.resource-card:hover .resource-hover-tools, .resource-card:focus-within .resource-hover-tools { opacity: 1; transform: none; pointer-events: auto; }
.resource-author { min-width: 0; margin-right: auto; overflow: hidden; color: #f6f2e8; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.resource-hover-tools button { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 7px; border: 1px solid rgba(240,238,230,.24); border-radius: 999px; color: #f6f2e8; background: rgba(13,14,13,.72); cursor: pointer; backdrop-filter: blur(8px); }
.resource-hover-tools button:hover { color: #19140d; border-color: var(--accent); background: var(--accent-strong); }
.resource-hover-tools button:disabled { opacity: .68; cursor: default; }
.resource-card-meta, .resource-card footer { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.resource-card-meta span:last-child { text-align: right; }
.resource-card h3 { margin: 10px 0 6px; font-size: 19px; }
.resource-card.has-image h3 { margin-top: 9px; }
.resource-card p { display: -webkit-box; min-height: 42px; margin: 0 0 12px; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.resource-card footer { align-self: end; align-items: end; }
.resource-card footer span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-save-button { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(213,166,91,.38); border-radius: 50%; color: var(--accent-strong); background: rgba(18,20,17,.9); cursor: pointer; }
.resource-save-button:hover { border-color: rgba(213,166,91,.62); background: rgba(213,166,91,.12); }
.resource-save-button:disabled { opacity: .62; cursor: default; }
.library-empty { grid-column: 1 / -1; padding: 64px 24px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; }
.library-empty p { margin: 0; color: var(--muted); }
.community-shelf { margin-top: 54px; padding-top: 30px; border-top: 1px solid var(--line); }
.community-detail-media .publication-media { display: grid; gap: 10px; }
.community-detail-media .publication-media figure { margin: 0; }
.community-detail-media .publication-media img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(74vh, 760px); margin: 0 auto; border: 1px solid var(--line); border-radius: 22px; object-fit: contain; }

:root[data-theme="light"] body {
  background: radial-gradient(circle at 15% -10%, rgba(166,109,29,.10), transparent 32rem), var(--bg);
}
:root[data-theme="light"] .app-header,
:root[data-theme="light"] .account-drawer-head { background: rgba(244,240,231,.92); }
:root[data-theme="light"] .account-drawer,
:root[data-theme="light"] .resource-card,
:root[data-theme="light"] .resource-variable-panel,
:root[data-theme="light"] .prompt-stage,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .state-card,
:root[data-theme="light"] .table-row { background: rgba(255,250,240,.9); }
:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select,
:root[data-theme="light"] .prompt-output { color: var(--text); background: #fffdf7; }
:root[data-theme="light"] .field > span,
:root[data-theme="light"] .resource-variable span { color: var(--text); }
:root[data-theme="light"] .route-home .app-header { background: linear-gradient(180deg, rgba(244,240,231,.95), rgba(244,240,231,.65) 72%, transparent); }
:root[data-theme="light"] .home-hero { background: radial-gradient(ellipse at 50% 88%, rgba(166,109,29,.16), transparent 38%), linear-gradient(155deg, #e9efe8 0%, #f7f2e8 55%, #efe5d6 100%); }
:root[data-theme="light"] .home-copy h1 { color: #24251f; text-shadow: none; }
:root[data-theme="light"] .home-copy > p:not(:first-child) { color: rgba(36,37,31,.68); }

.account-drawer { position: sticky; top: 72px; z-index: 25; width: var(--account-drawer-width); height: calc(100vh - 72px); align-self: start; overflow-y: auto; border-left: 1px solid var(--line); background: rgba(14,16,14,.98); box-shadow: -22px 0 52px rgba(0,0,0,.24); }
.account-drawer[hidden] { display: none; }
.account-drawer-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; min-height: 58px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: rgba(14,16,14,.96); }
.account-drawer-head strong { letter-spacing: .08em; }
.account-drawer-body { display: grid; gap: 22px; padding: 24px 20px 30px; }
.account-drawer-profile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.account-drawer-profile h2 { margin: 0 0 4px; font-size: 25px; }
.account-drawer-profile p { margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; }
.account-drawer-edit { width: 100%; }
.account-drawer-nav { display: grid; gap: 9px; }
.account-drawer-nav a { display: grid; gap: 6px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(29,32,28,.62); }
.account-drawer-nav a:hover, .account-drawer-nav a:focus-visible { border-color: rgba(213,166,91,.48); outline: none; }
.account-drawer-nav span { color: var(--accent-strong); font-size: 11px; letter-spacing: .08em; }
.account-drawer-nav strong { font-size: 17px; }
.account-drawer-footer { padding-top: 8px; border-top: 1px solid var(--line); }
.account-drawer-footer .button { width: 100%; }

.resource-detail-head { margin-bottom: 32px; }
.resource-detail-overview { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(420px, 1.1fr); gap: clamp(28px, 4vw, 60px); align-items: start; }
.resource-detail-left, .resource-detail-right { display: grid; min-width: 0; gap: 20px; align-content: start; }
.resource-featured-image { display: flex; align-items: flex-start; justify-content: center; align-self: start; margin: 0; }
.resource-featured-image img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(74vh, 760px); object-fit: contain; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); }
.resource-detail-copy { min-width: 0; padding-top: 6px; }
.back-link { display: inline-flex; margin-bottom: 20px; color: var(--accent-strong); font-size: 14px; }
.resource-detail-head h1 { max-width: 900px; margin-bottom: 12px; font-size: clamp(30px, 3vw, 46px); }
.resource-detail-copy > p { max-width: 760px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.resource-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 26px 0 0; }
.resource-facts div { min-width: 0; padding-top: 13px; border-top: 1px solid var(--line); }
.resource-facts dt { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.resource-facts dd { margin: 0; line-height: 1.55; }
.resource-variable-panel, .prompt-stage { padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: rgba(22,24,21,.82); }
.resource-variable-panel, .prompt-stage { min-width: 0; }
.tool-heading { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 20px; }
.tool-heading h2 { margin-bottom: 6px; font-size: 26px; }
.tool-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.prompt-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.resource-variable-list { display: grid; gap: 14px; padding-right: 4px; }
.resource-variable { display: grid; gap: 7px; }
.resource-variable span { color: #d5d2c8; font-size: 13px; font-weight: 650; }
.resource-prompt-output { min-height: 240px; max-height: none; overflow: visible; }
.resource-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.resource-tags span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin: 0 0 18px; }
.section-head h2 { margin-bottom: 0; }
.section-head p { margin: 0; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.prompt-card { display: flex; min-height: 230px; padding: 22px; border-radius: var(--radius); transition: transform .2s, border-color .2s; }
.prompt-card:hover { transform: translateY(-3px); border-color: rgba(213,166,91,.45); }
.prompt-card > a { display: flex; flex: 1; flex-direction: column; }
.card-meta, .tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.pill, .tag { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.pill.accent { color: var(--accent-strong); border-color: rgba(213,166,91,.34); }
.prompt-card h3 { margin: 22px 0 9px; font-size: 22px; }
.prompt-card p { flex: 1; color: var(--muted); line-height: 1.6; }
.card-footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }

.panel, .state-card { padding: clamp(22px, 4vw, 40px); border-radius: var(--radius); }
.narrow { width: min(640px, 100%); margin: 0 auto; }
.login-provider-icon.is-recent { border-color: rgba(215, 182, 74, .82); box-shadow: inset 0 0 0 1px rgba(215, 182, 74, .18); }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr); gap: 22px; align-items: start; }
.sticky-panel { position: sticky; top: 96px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field > span { color: #d5d2c8; font-size: 13px; font-weight: 650; }
.field small { color: var(--muted); line-height: 1.45; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; outline: none;
  padding: 12px 13px; color: var(--text); background: #10120f;
}
textarea { min-height: 118px; resize: vertical; line-height: 1.65; }
textarea.prompt-input { min-height: 260px; font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; }
input:focus, textarea:focus, select:focus { border-color: rgba(213,166,91,.65); box-shadow: 0 0 0 3px rgba(213,166,91,.1); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; color: var(--text); background: transparent; }
.button:hover { border-color: rgba(213,166,91,.55); }
.button.primary { color: #1b150d; border-color: transparent; background: linear-gradient(145deg, var(--accent-strong), #b9873e); font-weight: 750; }
.button.danger { color: #ffd7d2; border-color: rgba(221,121,109,.4); }
.button:disabled { opacity: .45; cursor: not-allowed; }

.variable-list { display: grid; gap: 10px; }
.variable-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; }
.prompt-output { min-height: 190px; margin: 0; padding: 18px; overflow: auto; border: 1px solid rgba(239,235,223,.72); border-radius: 14px; white-space: pre-wrap; word-break: break-word; color: #17211f; background: #efebe0; box-shadow: 0 16px 38px rgba(0,0,0,.12); font-family: "Cascadia Code", Consolas, monospace; line-height: 1.7; }
.prompt-output.compact { min-height: 90px; }
.handoff-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 24px; align-items: start; }
.handoff-preview { display: grid; gap: 18px; }
.handoff-preview h1 { font-size: clamp(32px, 5vw, 56px); }
.handoff-preview h2 { margin-top: 12px; }
.handoff-choice { display: grid; gap: 14px; }
.handoff-option { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.handoff-option:has(input:checked) { border-color: rgba(213,166,91,.65); background: rgba(213,166,91,.08); }
.handoff-option input { width: auto; margin-top: 4px; }
.handoff-option span { display: grid; gap: 4px; }
.handoff-option small, .handoff-status { color: var(--muted); line-height: 1.5; }
.handoff-option.is-disabled { opacity: .5; cursor: not-allowed; }
.handoff-status.error { color: #ffd7d2; }
.handoff-media-warning { padding: 14px; border: 1px solid rgba(213,166,91,.42); border-radius: 13px; background: rgba(213,166,91,.08); }
.handoff-media-warning p { margin: 7px 0 11px; color: var(--muted); line-height: 1.5; }
.handoff-media-warning label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.handoff-media-warning input { width: auto; margin-top: 4px; }
.handoff-back-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.handoff-back-nav a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent-strong); }
.handoff-back-nav a:hover { border-color: rgba(213,166,91,.55); background: rgba(213,166,91,.08); }
.publication-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; margin: 0 0 22px; }
.publication-media figure { min-height: 180px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #090b09; }
.publication-media img { display: block; width: 100%; height: 100%; max-height: 520px; object-fit: contain; }
.detail-header { margin-bottom: 28px; }
.detail-header h1 { font-size: clamp(32px, 5vw, 58px); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.data-list { display: grid; gap: 13px; margin: 0; }
.data-list div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; word-break: break-word; }

.table-list { display: grid; gap: 12px; }
.table-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.table-row h3 { margin-bottom: 6px; }
.table-row p { margin: 0; color: var(--muted); }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 12px; color: var(--accent-strong); background: rgba(213,166,91,.11); }
.review-snapshot { display: grid; gap: 18px; }
.review-copy { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #10120f; white-space: pre-wrap; word-break: break-word; }
.confirm-box { display: flex; align-items: flex-start; gap: 10px; padding: 15px; border: 1px solid rgba(213,166,91,.32); border-radius: 12px; background: rgba(213,166,91,.07); }
.confirm-box input { width: auto; margin-top: 4px; }
.setup-note { margin: 18px 0; padding: 16px; border: 1px solid rgba(221,121,109,.35); border-radius: 12px; color: #ffd7d2; background: rgba(221,121,109,.08); line-height: 1.6; }
.empty-state { padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 150; max-width: min(420px, calc(100vw - 48px)); padding: 13px 17px; border: 1px solid var(--line); border-radius: 12px; background: #252820; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.error-card { width: min(680px, 100%); margin: 60px auto; }
.error-card h1 { font-size: 38px; }

.ai-service-page { display: grid; gap: clamp(54px, 8vw, 96px); }
.ai-service-page h1, .ai-service-page h2, .ai-service-page h3 { font-family: "Songti SC", SimSun, STSong, serif; }
.ai-service-page h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; }
.ai-service-page p, .ai-service-page li { color: var(--muted); line-height: 1.75; }
.ai-service-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, .5fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: end;
  padding: clamp(44px, 8vw, 88px) 0 28px;
  border-bottom: 1px solid var(--line);
}
.ai-service-intro { max-width: 760px; }
.ai-kicker { margin: 0 0 14px; color: var(--accent-strong) !important; font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.ai-service-intro h1 { margin: 0; font-size: clamp(43px, 6vw, 78px); line-height: 1.03; letter-spacing: -.035em; }
.ai-service-intro > p:last-child { max-width: 660px; margin: 22px 0 0; font-size: 17px; }
.ai-service-state { padding: 22px 0 8px 24px; border-left: 1px solid rgba(213,166,91,.45); }
.ai-service-state span, .ai-service-state strong, .ai-service-state p { display: block; }
.ai-service-state span { color: var(--muted); font-size: 12px; }
.ai-service-state strong { margin-top: 20px; color: var(--accent-strong); font-size: 28px; }
.ai-service-state p { margin: 7px 0 0; }

.ai-billing-rule { display: grid; grid-template-columns: minmax(0, .85fr) minmax(420px, 1.15fr); gap: clamp(30px, 7vw, 90px); align-items: start; }
.ai-billing-rule h2 { margin-top: 0; }
.ai-multiplier-list { display: grid; border-top: 1px solid var(--line); }
.ai-multiplier-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 20px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.ai-multiplier-list span { color: #dcd9cf; font-weight: 700; }
.ai-multiplier-list strong { grid-row: 1 / span 2; grid-column: 2; color: var(--accent-strong); font-size: 36px; }
.ai-multiplier-list small { color: var(--muted); }

.ai-section-copy { max-width: 650px; margin-bottom: 28px; }
.ai-section-copy h2 { margin-bottom: 12px; }
.ai-plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ai-plan { display: flex; min-height: 280px; flex-direction: column; padding: 24px; border-right: 1px solid var(--line); background: rgba(22,24,21,.58); }
.ai-plan:last-child { border-right: 0; }
.ai-plan.is-emphasized { background: linear-gradient(160deg, rgba(213,166,91,.12), rgba(22,24,21,.58) 60%); }
.ai-plan h3 { margin: 0 0 22px; font-size: 22px; }
.ai-plan-price { min-height: 62px; font-size: clamp(25px, 3vw, 40px); line-height: 1.1; }
.ai-plan p { margin: auto 0 4px; color: #dcd9cf; }
.ai-plan small { color: var(--muted); }
.ai-plan-status { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--accent-strong); font-size: 12px; }

.ai-byok { display: grid; grid-template-columns: 1.2fr .8fr; border-radius: var(--radius); overflow: hidden; background: #f0eee6; color: #18211e; }
.ai-byok > div { padding: clamp(26px, 5vw, 54px); }
.ai-byok > div + div { border-left: 1px solid rgba(24,33,30,.15); background: #dfe6dd; }
.ai-byok h2, .ai-byok h3 { margin-top: 0; color: #18211e; }
.ai-byok p { color: #4f5a55; }

.ai-explain-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 20px; }
.ai-explain-grid article { padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--radius); }
.ai-explain-grid article:last-child { background: radial-gradient(circle at 90% 0, rgba(213,166,91,.13), transparent 42%), var(--panel); }
.ai-explain-grid h2 { margin-top: 0; }
.ai-explain-grid small { display: block; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: #d6c5a5; line-height: 1.65; }

.ai-policy-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 6vw, 72px); align-items: start; }
.ai-policy-layout h2 { margin-top: 0; }
.ai-refund ul { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.ai-refund li { padding: 16px; border-left: 2px solid rgba(213,166,91,.48); background: rgba(22,24,21,.62); }
.ai-safety { padding: clamp(24px, 4vw, 38px); border-radius: var(--radius); background: var(--panel-strong); }

.ai-readiness { padding: clamp(28px, 5vw, 52px); border-radius: var(--radius); background: linear-gradient(145deg, #17231f, #131815); }
.ai-readiness h2 { margin-top: 0; }
.ai-readiness-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 26px 0; }
.ai-readiness-items span { padding: 14px; border: 1px solid rgba(240,238,230,.12); border-radius: 12px; color: #ddd9cc; }

.ai-sources { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .75fr); gap: clamp(30px, 7vw, 90px); align-items: start; padding-top: 42px; border-top: 1px solid var(--line); }
.ai-sources h2 { margin-top: 0; }
.ai-sources nav { display: grid; border-top: 1px solid var(--line); }
.ai-sources a { padding: 16px 4px; border-bottom: 1px solid var(--line); color: #dcd9cf; }
.ai-sources a:hover, .ai-sources a:focus-visible { color: var(--accent-strong); outline: none; }

@media (max-width: 860px) {
  .app-header { grid-template-columns: auto auto; gap: 12px; }
  .main-nav { grid-column: 1 / -1; order: 3; overflow-x: auto; }
  .header-actions { justify-self: end; }
  .header-product-link { display: none; }
  .hero, .split-layout, .handoff-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-intro, .library-toolbar { grid-template-columns: 1fr; }
  .resource-detail-overview { display: flex; flex-direction: column; gap: 24px; }
  .resource-detail-left, .resource-detail-right { display: contents; }
  .resource-featured-image { order: 1; }
  .resource-detail-copy { order: 2; }
  .resource-variable-panel { order: 3; }
  .prompt-stage { order: 4; }
  .resource-featured-image { position: static; }
  .library-count { grid-template-columns: auto 1fr; align-items: end; gap: 12px; border-left: 0; border-top: 1px solid var(--line); }
  .home-copy { margin-top: 116px; }
  .home-copy h1 { font-size: clamp(42px, 9vw, 62px); }
  .home-text-figure { top: 48%; bottom: auto; width: min(68vw, 500px); }
  .home-art-card { width: clamp(92px, calc(18vw * var(--card-size, 1)), 150px); }
  .home-art-card:nth-of-type(7), .home-art-card:nth-of-type(8) { display: none; }
  .ai-service-hero, .ai-billing-rule, .ai-byok, .ai-explain-grid, .ai-policy-layout, .ai-sources { grid-template-columns: 1fr; }
  .ai-service-state { padding-left: 0; border-left: 0; border-top: 1px solid rgba(213,166,91,.45); }
  .ai-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-plan:nth-child(2) { border-right: 0; }
  .ai-plan:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ai-byok > div + div { border-left: 0; border-top: 1px solid rgba(24,33,30,.15); }
}

@media (max-width: 1450px) {
  .resource-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .app-main { width: min(100% - 24px, 1180px); padding-top: 30px; }
  .route-discover .app-main { width: calc(100% - 24px); }
  .brand small { display: none; }
  .card-grid, .form-grid { grid-template-columns: 1fr; }
  .resource-facts { grid-template-columns: 1fr; }
  .library-intro { gap: 24px; }
  .library-intro h1 { font-size: 39px; }
  .library-toolbar { gap: 18px; }
  .resource-card-link { min-height: 200px; }
  .resource-card-copy { padding: 19px 19px 12px; }
  .resource-variable-panel, .prompt-stage { padding: 20px; }
  .tool-heading { align-items: stretch; flex-direction: column; }
  .tool-heading .button { width: 100%; }
  .field.full { grid-column: auto; }
  .prompt-card { min-height: 210px; }
  .variable-row { grid-template-columns: 1fr; }
  .variable-row .icon-button { width: 100%; }
  .table-row { grid-template-columns: 1fr; }
  .data-list div { grid-template-columns: 1fr; gap: 5px; }
  .route-home .app-header { min-height: 64px; padding: 10px 14px; }
  .route-home .main-nav { display: none; }
  .route-home .header-actions { margin-left: auto; }
  .home-hero { min-height: max(100svh, 700px); }
  .home-copy { width: calc(100% - 28px); margin-top: 100px; }
  .home-copy h1 { font-size: 39px; }
  .home-copy > p:not(:first-child) { font-size: 14px; }
  .home-actions { margin-top: 17px; }
  .home-actions .button { min-height: 40px; padding: 8px 13px; }
  .home-text-figure { top: 51%; bottom: auto; width: min(92vw, 430px); opacity: .9; }
  .home-art-card { width: clamp(82px, calc(25vw * var(--card-size, 1)), 112px); border-radius: 9px; }
  .home-art-card footer { padding: 6px 7px; font-size: 9px; }
  .home-art-card:nth-of-type(3), .home-art-card:nth-of-type(6) { display: none; }
  .home-feature-note { right: 14px; bottom: 12px; max-width: 180px; text-align: right; }
  .home-login-layer { padding: 12px; }
  .home-login-shell { max-height: calc(100svh - 24px); overflow: auto; border-radius: 16px; }
  .ai-service-page { gap: 52px; }
  .ai-service-hero { padding-top: 34px; }
  .ai-service-intro h1 { font-size: 42px; }
  .ai-billing-rule { gap: 20px; }
  .ai-plan-grid, .ai-refund ul, .ai-readiness-items { grid-template-columns: 1fr; }
  .ai-plan { min-height: 230px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ai-plan:nth-child(3) { border-bottom: 1px solid var(--line); }
  .ai-plan:last-child { border-bottom: 0; }
}

@media (max-width: 780px) {
  .account-drawer-open .app-workspace { grid-template-columns: minmax(0, 1fr); }
  .account-drawer { position: fixed; top: 64px; right: 0; bottom: 0; width: min(390px, 92vw); height: auto; }
}

@media (max-width: 420px) {
  .resource-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .home-art-card { transition: opacity .25s ease, filter .25s ease, border-color .25s ease, box-shadow .25s ease; }
}
