:root {
  color-scheme: dark;
  --ink: #070b12;
  --ink-2: #101722;
  --paper: #f4ece0;
  --gold: #e2c48a;
  --gold-2: #c9a25a;
  --teal: #7ee0d6;
  --muted: #9aa4b5;
  --line: rgba(244, 236, 224, 0.14);
  --serif: "Songti SC", "STSong", "SimSun", serif;
  --display: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --nav-bg: rgba(7, 11, 18, 0.78);
  --card-bg: rgba(16, 23, 34, 0.7);
  --lede: #d7d0c4;
  --cta-bg: linear-gradient(90deg, #16110a, #0c1b22);
  --admin-side: #0b1018;
  --cover-fade: linear-gradient(180deg, transparent 20%, rgba(7, 11, 18, 0.88));
  --on-gold: #070b12;
  --cover-text: #f4ece0;
  --hero-bg: transparent;
  --grain: 0.07;
  --danger: #ff8b7b;
}

html[data-theme="day"] {
  color-scheme: light;
  --ink: #eef4fb;
  --ink-2: #e3eef8;
  --paper: #102033;
  --gold: #1d6fe9;
  --gold-2: #1557c0;
  --teal: #0f9aa8;
  --muted: #5b6b80;
  --line: rgba(16, 32, 51, 0.12);
  --nav-bg: rgba(238, 244, 251, 0.92);
  --card-bg: #ffffff;
  --lede: #334155;
  --cta-bg: linear-gradient(90deg, #d6e6fb, #cfeaf0);
  --admin-side: #dce8f6;
  --cover-fade: linear-gradient(180deg, transparent 20%, rgba(12, 28, 52, 0.82));
  --on-gold: #ffffff;
  --cover-text: #f4ece0;
  --hero-bg: radial-gradient(circle at 78% 8%, rgba(56, 140, 255, 0.28), transparent 38%), linear-gradient(180deg, #f3f8ff 0%, #e4eef8 100%);
  --grain: 0.03;
  --danger: #c24738;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 7vw;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 20px;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text strong { font-family: var(--display); letter-spacing: 0.08em; font-size: 14px; }
.logo-text small { color: var(--muted); font-size: 10px; letter-spacing: 0.22em; }
.nav-links { display: flex; gap: 28px; align-items: center; font-size: 14px; }
.nav-links a { color: var(--muted); letter-spacing: 0.08em; }
.nav-links a.is-active, .nav-links a:hover { color: var(--gold); }
.nav-login {
  border: 1px solid var(--gold);
  padding: 6px 12px;
  color: var(--gold) !important;
}
.nav-tools { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 64px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(226, 196, 138, 0.38);
  border-radius: 999px;
  background: linear-gradient(180deg, #171e2c, #0c111a);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.theme-toggle:hover { border-color: #e2c48a; }
.theme-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.theme-toggle-moon,
.theme-toggle-sun {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.theme-toggle-moon {
  left: 9px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e2c48a;
  box-shadow: inset -3px -1px 0 0 #121826;
}
.theme-toggle-sun {
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 243, 176, 0.28);
  box-shadow: 0 -5px 0 -2.5px rgba(255, 243, 176, 0.28), 0 5px 0 -2.5px rgba(255, 243, 176, 0.28), 5px 0 0 -2.5px rgba(255, 243, 176, 0.28), -5px 0 0 -2.5px rgba(255, 243, 176, 0.28);
}
.theme-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #f7f0e4, #e2c48a);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
}
.theme-toggle[aria-checked="true"],
html[data-theme="day"] .theme-toggle {
  background: linear-gradient(180deg, #d7e8ff, #8eb6f5);
  border-color: #1d6fe9;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.55);
}
html[data-theme="day"] .theme-toggle:hover { border-color: #1d6fe9; }
.theme-toggle[aria-checked="true"] .theme-toggle-knob,
html[data-theme="day"] .theme-toggle-knob {
  transform: translateX(32px);
  background: radial-gradient(circle at 32% 30%, #ffffff, #ffe27a);
}
.theme-toggle[aria-checked="true"] .theme-toggle-moon,
html[data-theme="day"] .theme-toggle-moon {
  opacity: 0.22;
}
.theme-toggle[aria-checked="true"] .theme-toggle-sun,
html[data-theme="day"] .theme-toggle-sun {
  background: #fff4c4;
  box-shadow: 0 -5px 0 -2.5px #fff4c4, 0 5px 0 -2.5px #fff4c4, 5px 0 0 -2.5px #fff4c4, -5px 0 0 -2.5px #fff4c4;
}
html:not(.theme-ready) .theme-toggle,
html:not(.theme-ready) .theme-toggle-knob {
  transition: none;
}
.nav-toggle { display: none; background: none; color: var(--paper); border: 1px solid var(--line); padding: 6px 10px; }

.hero {
  position: relative;
  min-height: 92vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 12vh 7vw 10vh;
  background: var(--hero-bg);
}
#starfield { position: absolute; inset: 0; width: 100%; height: 100%; }
html[data-theme="day"] #starfield { opacity: 0.4; }
.hero-copy { position: relative; z-index: 2; max-width: 780px; }
.eyebrow {
  color: var(--gold);
  letter-spacing: 0.32em;
  font-size: 12px;
  margin: 0 0 18px;
}
.hero h1, .page-hero h1, .article h1, .login-card h1, .admin-main h1 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 20px;
}
.hero h1 { font-size: clamp(42px, 7vw, 88px); }
.lede { font-size: 18px; color: var(--lede); max-width: 640px; }
.hero-actions { display: flex; gap: 16px; margin-top: 36px; }
.hero-rail {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--gold);
  writing-mode: vertical-rl;
  letter-spacing: 0.4em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--display);
  letter-spacing: 0.08em;
}
.btn.gold { background: var(--gold); color: var(--on-gold); }
.btn.ghost { border-color: var(--paper); color: var(--paper); background: transparent; }
.text-link { color: var(--gold); letter-spacing: 0.12em; font-size: 14px; }

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.ticker-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: drift 28s linear infinite;
  color: var(--muted);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 13px;
}
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.manifesto, .home-cases, .home-news, .page-hero, .about-story, .value-grid, .biz-lines, .news-archive, .case-board, .article, .more-block, .contact-layout, .cta-band {
  padding: 90px 7vw;
}
.manifesto {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: center;
}
.manifesto-num p { margin: 0 0 28px; }
.manifesto-num strong {
  display: block;
  font-family: var(--display);
  font-size: 52px;
  color: var(--gold);
}
.manifesto-num span { color: var(--muted); }
.manifesto-text h2, .section-head h2, .biz-lines h2, .more-block h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  margin: 8px 0 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 36px;
}
.case-mosaic {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-auto-rows: 280px;
  gap: 16px;
}
.case-tile { position: relative; overflow: hidden; min-height: 240px; }
.case-tile a, .case-poster {
  display: flex;
  flex-direction: column;
  justify-content: end;
  height: 100%;
  padding: 24px;
  background: var(--cover-fade);
  color: var(--cover-text);
}
.case-tile:first-child { grid-row: span 2; }
.case-index { position: absolute; top: 20px; left: 20px; color: var(--gold); letter-spacing: 0.2em; }
.case-tile h3, .case-poster h2 { font-family: var(--serif); margin: 0 0 8px; }
.case-tile strong, .case-poster strong, .result-chip { color: var(--teal); }

.cover-nebula { background: radial-gradient(circle at 20% 20%, #6d4aff 0%, transparent 42%), linear-gradient(135deg, #1a1030, #071018); }
.cover-aurora { background: radial-gradient(circle at 80% 10%, #47e0c4 0%, transparent 40%), linear-gradient(135deg, #10261f, #071018); }
.cover-forge { background: radial-gradient(circle at 30% 80%, #ff7a3c 0%, transparent 45%), linear-gradient(135deg, #2a140c, #071018); }
.cover-harbor { background: radial-gradient(circle at 70% 30%, #3d7dff 0%, transparent 42%), linear-gradient(135deg, #0c1c33, #071018); }
.cover-grid {
  background-image: linear-gradient(rgba(226,196,138,0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(226,196,138,0.18) 1px, transparent 1px), linear-gradient(135deg, #16120b, #071018);
  background-size: 28px 28px, 28px 28px, auto;
}

.news-stack { display: flex; flex-direction: column; }
.news-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.news-row time, .archive-body time { color: var(--gold); letter-spacing: 0.12em; }
.news-row h3 { font-family: var(--serif); margin: 0 0 8px; }
.news-row p, .archive-body p { margin: 0; color: var(--muted); }
.arrow { color: var(--gold); }

.cta-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: var(--cta-bg);
  border-top: 1px solid var(--line);
}
.cta-band h2 { font-family: var(--serif); font-size: 36px; margin: 0; }

.page-hero { padding-bottom: 20px; }
.page-hero h1 { font-size: clamp(36px, 6vw, 68px); }

.about-story { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; padding-top: 20px; }
.story-col p { color: var(--lede); font-size: 17px; }
.story-panel, .contact-card, .login-card {
  border: 1px solid var(--line);
  padding: 28px;
  background: var(--card-bg);
}
.story-panel ol { padding-left: 18px; }
.value-grid, .biz-table, .news-archive, .case-board {
  display: grid;
  gap: 18px;
}
.value-grid { grid-template-columns: repeat(3, 1fr); }
.value-grid article, .biz-table > div {
  border-top: 1px solid var(--gold);
  padding-top: 18px;
}
.biz-table { grid-template-columns: 1fr 1fr; }
.biz-table span { color: var(--gold); display: block; margin-bottom: 8px; }

.scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 36px;
}
.scope-list span {
  border: 1px solid var(--line);
  padding: 8px 14px;
  letter-spacing: 0.04em;
  font-size: 14px;
}
.scope-note { max-width: 720px; }

.fact-list { list-style: none; margin: 12px 0 0; padding: 0; }
.fact-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.fact-list span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; }
.fact-list strong { font-weight: 500; }
.project-timeline article {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.project-timeline time { color: var(--gold); letter-spacing: 0.06em; }
.project-timeline strong { font-family: var(--serif); display: block; margin-bottom: 4px; }
.project-timeline p { margin: 0; color: var(--muted); }

.news-archive { grid-template-columns: 1fr; }
.archive-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 220px;
  border: 1px solid var(--line);
}
.archive-cover { min-height: 180px; }
.archive-body { padding: 28px; }
.archive-body h2 { font-family: var(--serif); margin: 10px 0; }

.case-board { grid-template-columns: 1fr 1fr; }
.case-poster { min-height: 340px; border: 1px solid var(--line); }

.article { max-width: 860px; margin: 0 auto; }
.article-cover { height: 280px; margin: 28px 0 36px; }
.article-body { font-size: 17px; color: var(--lede); }
.article-body h3 { font-family: var(--serif); }
.byline { color: var(--muted); }
.page-toolbar {
  display: flex;
  align-items: center;
  margin: 0 0 18px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.16em;
  font-size: 13px;
}
.back-link::before { content: "← "; }
.more-block { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); }

.contact-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; }
.contact-form, .login-card form, .admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
label { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; }
input, textarea, select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--paper);
  padding: 10px 0;
  font: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-bottom-color: var(--gold); }
.form-ok { color: var(--teal); }
.form-error { color: var(--danger); }
.muted { color: var(--muted); }

.login-wrap { min-height: 70vh; display: grid; place-items: center; padding: 80px 7vw; }
.login-card { width: min(460px, 100%); }

.site-footer {
  padding: 48px 7vw 32px;
  border-top: 1px solid var(--line);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
}
.footer-brand { font-family: var(--serif); font-size: 22px; margin: 0 0 6px; }
.footer-en, .footer-copy { color: var(--muted); }
.footer-links { display: flex; flex-direction: column; gap: 8px; }

.admin-body { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side {
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--admin-side);
}
.admin-side nav { display: flex; flex-direction: column; gap: 14px; }
.admin-side a { color: var(--muted); }
.admin-side a.is-active { color: var(--gold); }
.admin-side .theme-toggle { align-self: flex-start; }
.admin-side form button {
  background: none;
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 8px 12px;
  cursor: pointer;
}
.admin-main { padding: 40px 48px 80px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0 48px; }
.stat-row a, .stat-row div {
  border: 1px solid var(--line);
  padding: 24px;
}
.stat-row strong { display: block; font-size: 40px; font-family: var(--display); color: var(--gold); }
.grid-table { width: 100%; border-collapse: collapse; }
.grid-table th, .grid-table td { text-align: left; padding: 14px 8px; border-bottom: 1px solid var(--line); }
.row-actions, .row-actions form { display: inline-flex; gap: 12px; align-items: center; }
.row-actions button { background: none; border: 0; color: var(--danger); cursor: pointer; }
.admin-form { max-width: 720px; }
.check { flex-direction: row; align-items: center; }
.admin-table article {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.status-wait { color: var(--gold); letter-spacing: 0.08em; }
.status-done { color: var(--teal); letter-spacing: 0.08em; }
.inquiry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 28px;
  list-style: none;
  margin: 8px 0 28px;
  padding: 0;
}
.inquiry-grid li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.inquiry-grid span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; margin-bottom: 4px; }
.inquiry-grid strong { font-weight: 500; word-break: break-all; }
.inquiry-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 40px;
  align-items: start;
  margin-bottom: 8px;
}
.inquiry-split h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 12px; }
.inquiry-message { margin: 0; color: var(--lede); white-space: pre-wrap; }
.inquiry-record { margin: 0; }
.admin-form.inquiry-handle { max-width: none; }
.inquiry-actions { display: flex; gap: 16px; align-items: center; margin-top: 28px; }
.inquiry-actions > button:not(.btn) { background: none; border: 1px solid var(--line); color: var(--danger); padding: 8px 12px; cursor: pointer; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: var(--ink);
    padding: 20px 7vw 28px;
  }
  .nav-links.open { display: flex; }
  .hero, .manifesto, .about-story, .contact-layout, .archive-card, .footer-grid, .admin-body, .news-row, .case-mosaic, .case-board, .value-grid, .biz-table, .stat-row, .project-timeline article {
    grid-template-columns: 1fr;
  }
  .hero-rail { display: none; }
  .cta-band, .section-head, .admin-head { flex-direction: column; align-items: flex-start; }
  .admin-body { display: block; }
  .inquiry-grid, .inquiry-split { grid-template-columns: 1fr; }
}
