:root {
  --green: #1C4B2C;
  --green-deep: #0B3A20;
  --green-2: #066838;
  --tan: #C2B59B;
  --tan-light: #E8E0D1;
  --bg: #F7F4EE;
  --card: #FFFFFF;
  --ink: #404041;
  --ink-soft: #6B6B6C;
  --line: #E3DCCB;
  --gold: #B8935A;
  --shadow: 0 2px 10px rgba(28, 75, 44, .08);
  --radius: 10px;
  --font-head: "Montserrat", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.75;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 20px;
  background: linear-gradient(120deg, var(--green-deep) 0%, var(--green) 55%, var(--green-2) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(11, 58, 32, .35);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 46px; height: 46px; object-fit: contain; flex: none;
  background: #fff; border-radius: 50%; padding: 3px;
  box-shadow: 0 0 0 2px var(--tan), 0 0 0 4px rgba(255,255,255,.25);
}
.brand-text { min-width: 0; }
.brand-name {
  font-family: var(--font-head); font-weight: 700; letter-spacing: .02em;
  font-size: 15px; line-height: 1.25; white-space: nowrap;
}
.brand-sub { font-size: 12px; color: var(--tan-light); line-height: 1.3; }

.search-wrap { position: relative; flex: 1 1 260px; max-width: 640px; margin-left: auto; }
#searchInput {
  width: 100%; padding: 10px 36px 10px 16px;
  border-radius: 999px; border: 2px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.14); color: #fff; font-size: 14px;
  outline: none; transition: border-color .2s, background .2s;
  font-family: var(--font-body);
}
#searchInput::placeholder { color: rgba(255,255,255,.75); }
#searchInput:focus { border-color: var(--tan); background: rgba(255,255,255,.22); }
.search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  cursor: pointer; font-size: 18px; color: rgba(255,255,255,.85); line-height: 1;
  width: 20px; text-align: center; display: none;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: var(--card); color: var(--ink);
  border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.25);
  max-height: 60vh; overflow-y: auto; border: 1px solid var(--line);
}
.result-item { display: block; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--tan-light); }
.result-ch {
  font-size: 12px; font-weight: 700; color: var(--green);
  display: flex; gap: 6px; align-items: baseline; margin-bottom: 3px;
}
.result-ch .res-lang { margin-left: auto; font-weight: 600; color: var(--ink-soft); font-size: 11px; }
.result-snippet { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.result-snippet mark, .article mark, .result-ch mark {
  background: #F3D57A; color: #5A3E00; border-radius: 3px; padding: 0 1px;
}
.res-empty { padding: 14px; color: var(--ink-soft); font-size: 13px; text-align: center; }

.top-actions { display: flex; gap: 8px; flex: none; }
.btn {
  cursor: pointer; border: 1px solid rgba(255,255,255,.45); color: #fff;
  background: rgba(255,255,255,.1); border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-family: var(--font-head); transition: background .2s, border-color .2s;
}
.btn:hover { background: rgba(255,255,255,.22); border-color: var(--tan); }
.btn-small { padding: 4px 10px; font-size: 12px; }

/* ---------- layout ---------- */
.layout { display: flex; align-items: flex-start; max-width: 1280px; margin: 0 auto; }
.sidebar {
  position: sticky; top: 70px; align-self: flex-start;
  width: 280px; flex: none; max-height: calc(100vh - 80px); overflow-y: auto;
  padding: 18px 10px 18px 18px;
}
.nav-group-title {
  font-size: 11px; letter-spacing: .12em; color: var(--gold);
  font-weight: 700; margin: 16px 0 6px; padding-left: 8px;
}
.nav-group-title:first-child { margin-top: 0; }
.nav-item {
  display: block; width: 100%; text-align: left; border: none; cursor: pointer;
  background: transparent; padding: 7px 10px; margin-bottom: 2px;
  border-radius: 8px; color: var(--ink); font-size: 13.5px; line-height: 1.4;
  font-family: var(--font-body); transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--tan-light); }
.nav-item.active {
  background: var(--green); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(28,75,44,.3);
}
.nav-item .nav-en { display: block; font-family: var(--font-head); font-size: 11px; opacity: .75; }
.sidebar-foot { padding: 14px 8px 4px; }
.dl-link { color: var(--green); font-weight: 600; font-size: 13px; text-decoration: none; }
.dl-link:hover { text-decoration: underline; }

/* ---------- content ---------- */
.content { flex: 1; min-width: 0; padding: 24px 30px 80px; }
.article {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 34px 40px 46px; min-height: 70vh;
}
.cover {
  text-align: center; padding: 26px 10px 30px; margin-bottom: 26px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #FDFBF6 0%, var(--tan-light) 130%);
}
.cover-logo { width: 130px; height: 130px; object-fit: contain; background: #fff; border-radius: 50%; padding: 8px; box-shadow: 0 0 0 3px var(--green); margin-bottom: 14px; }
.cover-name { font-family: var(--font-head); font-weight: 800; color: var(--green); font-size: 22px; letter-spacing: .34em; line-height: 1.35; }
.cover-motto { font-family: var(--font-head); font-weight: 700; color: var(--gold); font-size: 13px; letter-spacing: .22em; margin: 14px 0 6px; }
.cover-en { font-family: var(--font-head); color: var(--ink-soft); font-size: 12px; letter-spacing: .1em; }
.article-head {
  border-bottom: 3px solid var(--green); padding-bottom: 18px; margin-bottom: 8px;
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
}
.article-no {
  font-family: var(--font-head); font-weight: 800; color: var(--tan);
  font-size: 13px; letter-spacing: .15em;
}
.article-title { font-size: 26px; font-weight: 800; color: var(--green); margin: 0; line-height: 1.3; }
.article-en-title { font-family: var(--font-head); font-size: 13px; color: var(--ink-soft); letter-spacing: .04em; }
.article-actions { margin: 6px 0 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-plain {
  cursor: pointer; border: 1px solid var(--green); color: var(--green);
  background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px;
  font-family: var(--font-head); transition: background .15s;
}
.btn-plain:hover { background: var(--tan-light); }
.btn-plain.on { background: var(--green); color: #fff; }

.para {
  margin: 14px 0; padding: 12px 16px; border-radius: 8px;
  border-left: 3px solid transparent; scroll-margin-top: 90px;
}
.para:hover { background: #FBF8F1; border-left-color: var(--tan); }
.para.kw { border-left-color: var(--green-2); background: #F3F6F2; }
.para-title { color: var(--green-2); font-weight: 700; }
.para table {
  border-collapse: collapse; margin: 8px 0; width: 100%; font-size: 13.5px;
}
.para th, .para td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.para th { background: var(--tan-light); }
.highlight { animation: flash 2.2s ease 1; }
@keyframes flash {
  0%, 60% { background: #F3D57A; }
  100% { background: transparent; }
}
.article-foot {
  margin-top: 34px; padding-top: 18px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-soft);
}
.chip {
  display: inline-block; background: var(--tan-light); color: var(--green);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 2px 4px 2px 0;
}

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(11, 40, 22, .72);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: #fff; border-radius: 14px; width: min(92vw, 860px); max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.modal-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--green); color: #fff;
}
.modal-title { font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.modal-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.page-ind { font-size: 12px; color: var(--tan-light); font-family: var(--font-head); }
.modal-body { overflow: auto; padding: 14px; text-align: center; background: #44403A; }
.modal-body img { max-width: 100%; max-height: 68vh; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.modal-foot { padding: 8px 16px; font-size: 12.5px; color: var(--ink-soft); border-top: 1px solid var(--line); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #fff; padding: 10px 22px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow); z-index: 200;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: static; width: 100%; max-height: none;
    padding: 10px 14px; border-bottom: 1px solid var(--line);
  }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-group-title { width: 100%; margin: 8px 0 4px; }
  .nav-item { width: auto; }
  .content { padding: 16px 14px 60px; }
  .article { padding: 22px 18px 34px; }
  .topbar { padding: 10px 14px; }
  .brand-name { font-size: 13px; }
}
