:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #64706b;
  --line: #dfe5e2;
  --paper: #ffffff;
  --wash: #f4f7f5;
  --accent: #176b53;
  --accent-dark: #10533f;
  --danger: #b93a3a;
  --shadow: 0 12px 36px rgba(28, 55, 45, 0.09);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--wash); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(140deg, #edf7f2, #f8f5ee); }
.login-card { width: min(420px, 100%); padding: 38px; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; }
.login-card h1 { margin: 10px 0 8px; font-size: 34px; }
.muted { color: var(--muted); }
.field { display: grid; gap: 7px; margin: 16px 0; }
.field label { color: #34413c; font-size: 14px; font-weight: 650; }
input, textarea, select { width: 100%; padding: 11px 12px; color: var(--ink); background: #fff; border: 1px solid #cfd8d4; border-radius: 9px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23, 107, 83, .12); }
textarea { min-height: 94px; resize: vertical; }
.markdown-input { min-height: 430px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.55; }
.btn { padding: 10px 15px; color: white; background: var(--accent); border: 0; border-radius: 9px; font-weight: 650; }
.btn:hover { background: var(--accent-dark); }
.btn.secondary { color: var(--ink); background: #edf2f0; }
.btn.secondary:hover { background: #e0e8e5; }
.btn.danger { color: var(--danger); background: #fff0f0; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 6vw; color: #fff; background: #173b31; }
.brand-logo { color: #fff; font-size: 21px; font-weight: 800; letter-spacing: .04em; text-decoration: none; }
.top-actions, .row-actions, .dialog-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top-actions .btn.secondary { color: #fff; background: rgba(255,255,255,.13); }
.page { width: min(1160px, 90vw); margin: 34px auto 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin-bottom: 5px; font-size: 28px; }
.crumb { display: inline-block; margin-bottom: 14px; color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 16px rgba(32, 66, 54, .04); }
.card { padding: 19px; }
.card:hover { border-color: #b9cbc4; }
.card h3 { margin-bottom: 9px; }
.feature-card { background: linear-gradient(145deg, #eef8f4, #fff); border-color: #c9ddd5; }
.card-link { color: inherit; text-decoration: none; }
.card-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 18px; }
.panel { padding: 20px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 13px; }
.panel-head h2 { margin: 0; font-size: 19px; }
.list { display: grid; gap: 9px; }
.list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-title { margin-bottom: 3px; font-weight: 700; }
.category-filter { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 15px; }
.chip { padding: 7px 10px; color: #365248; background: #eaf1ee; border: 0; border-radius: 999px; font-size: 13px; }
.chip.active { color: #fff; background: var(--accent); }
.dialog-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(10, 25, 20, .45); z-index: 20; }
.dialog { width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 22px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.dialog.wide { width: min(920px, 100%); }
.dialog-actions { justify-content: flex-end; margin-top: 18px; }
.notice { padding: 10px 12px; color: #854040; background: #fff0f0; border-radius: 8px; font-size: 14px; }
.account-section-title { margin: 22px 0 7px; color: #34413c; font-size: 15px; }
.account-section-title:first-child { margin-top: 0; }
.permission-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.permission-grid label { display: flex; gap: 6px; align-items: center; color: #43524d; font-size: 13px; }
.permission-grid input { width: auto; }
.permission-brands { display: grid; gap: 8px; }
.permission-brand { padding: 11px; background: #f7f9f8; border: 1px solid var(--line); border-radius: 9px; }
.empty { padding: 24px 4px; color: var(--muted); }
.reader { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.toc { position: sticky; top: 18px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.toc h3 { margin-bottom: 11px; font-size: 15px; }
.toc a { display: block; padding: 4px 0; color: #4c6159; text-decoration: none; font-size: 13px; line-height: 1.4; }
.toc .level-2 { padding-left: 10px; }
.toc .level-3 { padding-left: 20px; }
.article { min-width: 0; padding: 30px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.article h1, .article h2, .article h3 { scroll-margin-top: 20px; margin-top: 1.5em; }
.article h1:first-child { margin-top: 0; }
.article p, .article li { line-height: 1.8; }
.article img, .article video, .article iframe { max-width: 100%; border-radius: 8px; }
.article iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.article table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.article th, .article td { padding: 9px; border: 1px solid var(--line); text-align: left; }
.article pre { overflow: auto; padding: 14px; background: #f3f6f5; border-radius: 8px; }
.article blockquote { margin-left: 0; padding-left: 15px; color: var(--muted); border-left: 3px solid #aac8bc; }
.portal-shell { min-height: calc(100vh - 68px); padding: 70px 5vw; background: radial-gradient(circle at 80% 12%, #dceee7, transparent 29%), linear-gradient(135deg, #f5faf7, #f7f3eb); }
.portal-hero, .portal-grid { width: min(1080px, 100%); margin: 0 auto; }
.portal-hero h1 { margin: 10px 0; font-size: clamp(46px, 8vw, 78px); letter-spacing: -.06em; }
.portal-hero p { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 42px; }
.portal-card { min-height: 230px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.portal-card a { display: flex; min-height: 230px; flex-direction: column; padding: 25px; color: inherit; text-decoration: none; }
.portal-card h2 { margin: 10px 0; font-size: 27px; }
.portal-card p { color: var(--muted); line-height: 1.7; }
.portal-card span { margin-top: auto; color: var(--accent); font-weight: 700; }
.practice-entry { background: linear-gradient(145deg, #fff, #edf8f4); }
.tutorial-entry { background: linear-gradient(145deg, #fff, #f8f3e7); }
.blog-shell { min-height: calc(100vh - 68px); background: #f7f4ed; }
.blog-banner { position: relative; overflow: hidden; padding: 76px max(5vw, calc((100vw - 1080px) / 2)); color: #fff; background: linear-gradient(120deg, #123f34, #276f5c); }
.blog-banner::after { content: ""; position: absolute; width: 360px; height: 360px; right: 6vw; top: -145px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025); }
.blog-banner .eyebrow { color: #b9eee0; }
.blog-banner h1 { position: relative; margin: 9px 0; font-size: clamp(38px, 6vw, 62px); letter-spacing: -.04em; z-index: 1; }
.blog-banner p { position: relative; margin: 0; color: #d7ebe5; font-size: 18px; z-index: 1; }
.blog-manage { position: relative; display: inline-block; margin-top: 23px; color: #17483b; background: #fff; text-decoration: none; z-index: 1; }
.blog-content { width: min(1080px, 90vw); margin: 0 auto; padding: 28px 0 70px; }
.blog-categories { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 23px; }
.blog-categories a { text-decoration: none; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.blog-card { padding: 22px; background: #fff; border: 1px solid #e4ded2; border-radius: 13px; box-shadow: 0 6px 18px rgba(66, 56, 37, .045); }
.blog-card h2 { margin: 8px 0 10px; font-size: 21px; line-height: 1.35; }
.blog-card h2 a, .blog-card .card-meta a { color: inherit; text-decoration: none; }
.blog-card p { min-height: 52px; color: var(--muted); line-height: 1.65; }
.blog-article-head { padding: 42px max(5vw, calc((100vw - 1080px) / 2)) 30px; background: #f1eee5; border-bottom: 1px solid #e2ddcf; }
.blog-article-head h1 { margin: 8px 0; font-size: clamp(30px, 5vw, 46px); }
.blog-article-head p { color: var(--muted); }
@media (max-width: 760px) {
  .topbar { padding: 0 5vw; }
  .page { width: 92vw; margin-top: 22px; }
  .page-head { display: block; }
  .page-head .row-actions { margin-top: 12px; }
  .reader { grid-template-columns: 1fr; }
  .toc { position: static; }
  .article { padding: 19px; }
  .blog-banner { padding-top: 52px; padding-bottom: 52px; }
  .list-row { align-items: flex-start; flex-direction: column; }
}
