:root {
  --bg-paper: #F6F3F7;
  --bg-dark: #271231;
  --text-body: #1F1523;
  --brand: #9E13DD;
  --accent: #ED6EC0;
  --surface-light: #FFFFFF;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --radius-card: 0;
  --radius-btn: 0;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--bg-paper); color: var(--text-body); line-height: 1.75; font-size: 16px; }
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.8rem; }
p { margin-bottom: 1rem; max-width: 38em; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; }

.theme-paper { background: var(--bg-paper); color: var(--text-body); }
.theme-paper a { color: var(--brand); }
.theme-paper .hl { color: var(--brand); }
.theme-dark { background: var(--bg-dark); color: var(--surface-light); }
.theme-dark a { color: var(--accent); }
.theme-dark .hl { color: var(--accent); }

.card { background: var(--surface-light); box-shadow: var(--card-shadow); padding: var(--gap); margin-bottom: var(--gap); border-radius: var(--radius-card); }
.theme-dark .card { background: var(--bg-dark); box-shadow: none; border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-card); }

.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0 1.5rem; height: 52px; font-size: 1rem; font-weight: 600; cursor: pointer; border: none; border-radius: var(--radius-btn); transition: transform 0.2s, background 0.2s; }
.btn-primary { background: var(--accent); color: var(--bg-dark); }
.btn-primary:hover { transform: translateY(-2px); background: #d95aa8; }

.theme-dark .btn-primary { color: #ffffff; }
.btn-secondary { background: transparent; border: 1px solid var(--text-body); color: var(--text-body); border-radius: var(--radius-btn); }
.theme-dark .btn-secondary { border-color: var(--surface-light); color: var(--surface-light); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.svg-responsive { width: 100%; height: auto; }

@keyframes drawLine { 0%, 100% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes slideIn { 0%, 100% { transform: translateX(0); opacity: 0.8; } 50% { transform: translateX(5px); opacity: 1; } }

.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 6s ease-in-out infinite; }
.anim-float { animation: float 6s ease-in-out infinite; }
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-slide { animation: slideIn 5s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .anim-draw, .anim-float, .anim-breathe, .anim-slide { animation: none !important; }
}

.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap); }
.mb-2 { margin-bottom: var(--gap); }

header { position: sticky; top: 0; z-index: 100; background: rgba(246, 243, 247, 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(31, 21, 35, 0.08); }
.theme-dark header { background: rgba(39, 18, 49, 0.95); border-bottom-color: rgba(255,255,255,0.1); }
nav { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text-body); font-weight: 500; }
.theme-dark .nav-links a { color: var(--surface-light); }
.nav-links a[aria-current="page"] { color: var(--accent); font-weight: 700; }

footer { background: var(--bg-dark); color: var(--surface-light); padding: 2rem 0; text-align: center; }
footer a { color: var(--accent); }

table { width: 100%; min-width: 0; border-collapse: collapse; margin-bottom: 1rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(31, 21, 35, 0.1); max-width: 100%; }
.theme-dark th, .theme-dark td { border-bottom-color: rgba(255, 255, 255, 0.1); }
th { font-weight: 600; }

details { margin-bottom: 0.8rem; border-bottom: 1px solid rgba(31, 21, 35, 0.1); padding-bottom: 0.8rem; }
.theme-dark details { border-bottom-color: rgba(255, 255, 255, 0.1); }
summary { cursor: pointer; font-weight: 600; padding: 0.5rem 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-size: 1.2rem; }
details[open] summary::after { content: '−'; }
details p { margin-top: 0.5rem; color: inherit; }

article.news-card { border: 1px solid rgba(31, 21, 35, 0.1); padding: var(--gap); background: var(--surface-light); }
.theme-dark article.news-card { border-color: rgba(255, 255, 255, 0.1); background: var(--bg-dark); }
article.news-card time { font-size: 0.85rem; color: var(--brand); font-weight: 600; display: block; margin-bottom: 0.5rem; }
.theme-dark article.news-card time { color: var(--accent); }

/* 兜底：裁掉横向溢出 */
div.container {
  overflow-x: clip;
}
