:root {
  --paper: #f8f5ef;
  --paper-2: #f1ece2;
  --paper-3: #e9e2d4;
  --ink: #1b1a17;
  --ink-soft: #3d3a34;
  --muted: #6f6a60;
  --rule: #d9d2c3;
  --rule-strong: #bdb3a0;
  --accent: #7a2e2a;
  --accent-soft: #f3e6e2;
  --forest: #2f4a3e;
  --forest-soft: #e6ede8;
  --gold: #a67c2e;
  --gold-soft: #f4ecdc;
  --white: #fffdf9;
  --serif: "Hoefler Text", "Iowan Old Style", "Palatino Linotype", "Songti SC",
    "Noto Serif CJK SC", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, monospace;
  --radius: 2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(166, 124, 46, 0.07), transparent 42%),
    radial-gradient(circle at 92% 8%, rgba(47, 74, 62, 0.05), transparent 38%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: 2.1rem; margin: 0 0 10px; }
h2 { font-size: 1.3rem; margin: 0 0 10px; }
h3 { font-size: 1.02rem; margin: 0; }
p { margin: 0 0 12px; }
code { font-family: var(--mono); background: var(--paper-2); padding: 1px 5px; font-size: 0.86em; }

.container { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }

/* ---------- masthead ---------- */
.utility-bar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.utility-inner { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.utility-right { display: flex; align-items: center; gap: 14px; }
.data-note { color: var(--accent); }
.lang-select {
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 2px 4px;
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.site-header {
  background: rgba(248, 245, 239, 0.94);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 70px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
  line-height: 1;
}
.brand-text { font-family: var(--serif); font-size: 1.28rem; font-weight: 600; letter-spacing: -0.03em; }
.brand-text em { font-style: normal; color: var(--accent); }

.main-nav { display: flex; gap: 22px; flex: 1; }
.main-nav a {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.main-nav a:hover, .main-nav a.active { color: var(--ink); text-decoration: none; border-bottom-color: var(--accent); }

.quick-search { display: flex; align-items: center; border-bottom: 1px solid var(--rule-strong); }
.quick-search input {
  width: 240px;
  border: 0;
  background: transparent;
  padding: 7px 4px;
  font: inherit;
  font-size: 0.86rem;
  color: var(--ink);
  outline: none;
}
.quick-search input::placeholder { color: #9a9488; }
.quick-search button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 2px;
}

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--rule); padding: 74px 0 62px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.75fr); gap: 56px; align-items: end; }
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.kicker span { color: var(--accent); border-right: 1px solid var(--rule-strong); padding-right: 12px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.08; margin-bottom: 18px; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--accent); }
.page-head h1, .journal-head h1 { text-wrap: balance; }
.deck { max-width: 620px; font-size: 1.04rem; color: var(--ink-soft); margin-bottom: 26px; }
.search-form {
  display: flex;
  max-width: 640px;
  border: 1px solid var(--ink);
  background: var(--white);
  padding: 4px;
}
.search-form input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  outline: none;
}
.search-form input::placeholder { color: #9a9488; }
.search-form button {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 12px 22px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.search-form button:hover { background: var(--accent); }
.hero-note { margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.hero-note strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.hero-index { border: 1px solid var(--rule-strong); background: var(--white); padding: 22px 24px; position: relative; }
.hero-index::before, .hero-index::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid var(--accent);
}
.hero-index::before { top: -4px; left: -4px; border-right: 0; border-bottom: 0; }
.hero-index::after { bottom: -4px; right: -4px; border-left: 0; border-top: 0; }
.index-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.index-stats { margin: 0; padding: 6px 0 4px; }
.index-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dotted var(--rule); }
.index-stats div:last-child { border-bottom: 0; }
.index-stats dt { font-size: 0.78rem; color: var(--muted); }
.index-stats dd { margin: 0; font-family: var(--serif); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.index-foot { margin: 8px 0 0; font-size: 0.7rem; letter-spacing: 0.05em; color: var(--muted); text-transform: uppercase; white-space: pre-line; }

/* ---------- sections ---------- */
.section { margin-top: 52px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.section-title { display: flex; align-items: baseline; gap: 14px; }
.section-no { font-family: var(--serif); font-style: italic; font-size: 0.9rem; color: var(--gold); letter-spacing: 0.04em; }
.section-head h2 { margin: 0; font-size: 1.35rem; }
.more { font-size: 0.76rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--rule);
  background: var(--white);
  padding: 7px 12px;
  font-size: 0.84rem;
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.chip:hover { border-color: var(--ink); background: var(--paper-2); text-decoration: none; }
.chip span { color: var(--muted); font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.chip-static { cursor: default; }
.chip-static:hover { border-color: var(--rule); background: var(--white); }

/* ---------- cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 18px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.22s ease, transform 0.22s ease;
}
.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.28s ease;
}
.card:hover { border-color: var(--rule-strong); transform: translateY(-2px); }
.card:hover::before { width: calc(100% + 2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-issn { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--muted); }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card-sub { color: var(--muted); font-size: 0.8rem; margin: 0; min-height: 2.4em; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border: 1px solid var(--rule);
  color: var(--muted);
  background: transparent;
}
.badge-oa { border-color: #9db5a7; color: var(--forest); background: var(--forest-soft); }
.badge-green { border-color: #d8c48f; color: #6f5315; background: var(--gold-soft); }
.badge-plain { border-color: #c9b7b4; color: var(--accent); background: var(--accent-soft); }
.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: auto 0 0;
  padding: 12px 0 14px;
  border-top: 1px solid var(--rule);
}
.mini-metrics dt { color: var(--muted); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; }
.mini-metrics dd { margin: 0; font-family: var(--serif); font-size: 0.95rem; font-variant-numeric: tabular-nums; }

/* ---------- page ---------- */
.page { padding: 42px 0 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: 2rem; margin-bottom: 4px; }
.sort-form label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.78rem; }
.sort-form select, .filters select, .filters input, .compare-form input {
  border: 1px solid var(--rule-strong);
  background: var(--white);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  outline: none;
}
.sort-form select:focus, .filters select:focus, .filters input:focus, .compare-form input:focus { border-color: var(--ink); }

/* ---------- filters ---------- */
.filters { background: var(--white); border: 1px solid var(--rule); padding: 18px; margin-bottom: 26px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-row + .filter-row { margin-top: 14px; padding-top: 14px; border-top: 1px dotted var(--rule); }
.filter-row label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.filter-row .grow { flex: 1 1 220px; }
.filter-row input, .filter-row select { min-width: 140px; }
.filter-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }
.btn-ghost {
  display: inline-block;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  background: transparent;
  padding: 9px 16px;
  font-size: 0.8rem;
  font-weight: 500;
}
.btn-ghost:hover { border-color: var(--ink); text-decoration: none; }

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 30px; flex-wrap: wrap; font-size: 0.82rem; }
.pagination a, .pagination span { padding: 6px 10px; border: 1px solid transparent; }
.pagination a { border-color: var(--rule); background: var(--white); color: var(--ink); }
.pagination a:hover { border-color: var(--ink); text-decoration: none; }
.pagination a.current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pagination .disabled { color: #b4ac9e; }
.pagination .muted { margin-left: auto; border: 0; }

/* ---------- empty ---------- */
.empty { background: var(--white); border: 1px dashed var(--rule-strong); padding: 54px 24px; text-align: center; }
.empty h2 { margin-bottom: 6px; }

/* ---------- detail ---------- */
.breadcrumb { display: flex; gap: 8px; font-size: 0.76rem; color: var(--muted); margin-bottom: 22px; flex-wrap: wrap; letter-spacing: 0.02em; }
.journal-head { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; margin-bottom: 26px; }
.journal-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); margin: 10px 0 6px; }
.alt-title { font-family: var(--serif); font-style: italic; color: var(--muted); margin: 0 0 6px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin-bottom: 24px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.metric { padding: 14px 16px; border-right: 1px solid var(--rule); }
.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: 0.62rem; letter-spacing: 0.09em; text-transform: uppercase; }
.metric strong { display: block; font-family: var(--serif); font-size: 1.18rem; margin-top: 3px; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel { background: var(--white); border: 1px solid var(--rule); padding: 22px 24px; margin-bottom: 18px; }
.panel h2 { font-size: 1.02rem; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.kv { margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 18px; padding: 7px 0; border-bottom: 1px dotted var(--rule); }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: 0.76rem; white-space: nowrap; }
.kv dd { margin: 0; text-align: end; font-size: 0.88rem; overflow-wrap: anywhere; }
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li { padding: 9px 0; border-bottom: 1px dotted var(--rule); font-size: 0.88rem; }
.checklist li:last-child { border-bottom: 0; }
.checklist strong { font-family: var(--serif); font-weight: 600; }
.disclaimer { background: var(--paper-2); border-left: 3px solid var(--gold); color: #5f4a1d; padding: 11px 13px; font-size: 0.78rem; margin: 16px 0 0; }
.plain-list { margin: 0; padding-left: 18px; font-size: 0.88rem; }

/* ---------- compare ---------- */
.compare-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; background: var(--white); border: 1px solid var(--rule); padding: 18px; margin-bottom: 26px; }
.compare-form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.compare-form input { min-width: 180px; }
.compare-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--rule); }
.compare-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.compare-table th, .compare-table td { text-align: start; padding: 13px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 0.88rem; }
.compare-table thead th { background: var(--paper-2); font-family: var(--serif); font-size: 0.98rem; }
.compare-table tbody th { width: 150px; color: var(--muted); font-weight: 500; font-size: 0.76rem; letter-spacing: 0.03em; }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: 0; }

/* ---------- note ---------- */
.note-box { background: var(--white); border: 1px solid var(--rule); border-left: 4px solid var(--accent); padding: 20px 24px; margin-top: 48px; }
.note-box h2 { font-size: 1.02rem; }
.note-box p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #cfc8ba; margin-top: 64px; padding: 34px 0 38px; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 28px; }
.footer-brand { font-family: var(--serif); font-size: 1.2rem; color: var(--paper); margin-bottom: 6px; }
.footer-brand em { font-style: normal; color: #d6a25a; }
.site-footer p { font-size: 0.78rem; line-height: 1.7; margin: 0; color: #a9a294; }
.site-footer h3 { color: var(--paper); font-family: var(--sans); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 10px; }
.site-footer p a { color: #d6a25a; }
.site-footer p a:hover { color: #fff; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: #cfc8ba; font-size: 0.82rem; }
.footer-links a:hover { color: #fff; }

/* ---------- motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-copy, .hero-index { animation: rise 0.65s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.hero-index { animation-delay: 0.08s; }
.card { animation: rise 0.45s ease both; }
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.08s; }
.card:nth-child(4) { animation-delay: 0.12s; }
.card:nth-child(5) { animation-delay: 0.16s; }
.card:nth-child(6) { animation-delay: 0.2s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- RTL ---------- */
html[dir="rtl"] body {
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", var(--sans);
}
html[dir="rtl"] .kicker span { border-right: 0; border-left: 1px solid var(--rule-strong); padding-right: 0; padding-left: 12px; }
html[dir="rtl"] .card::before { left: auto; right: -1px; }
html[dir="rtl"] .metric { border-right: 0; border-left: 1px solid var(--rule); }
html[dir="rtl"] .metric:last-child { border-left: 0; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-index { max-width: 420px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3n) { border-right: 0; }
  .metric:nth-child(-n + 3) { border-bottom: 1px solid var(--rule); }
  .two-col { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .quick-search input { width: 160px; }
}

@media (max-width: 660px) {
  .container { width: calc(100% - 32px); }
  .utility-inner { font-size: 0.62rem; }
  .data-note { display: none; }
  .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 12px; }
  .main-nav { order: 3; width: 100%; gap: 18px; }
  .quick-search { margin-left: auto; }
  .quick-search input { width: 120px; }
  .hero { padding: 46px 0 40px; }
  .hero h1 { font-size: 2.1rem; }
  .search-form { flex-direction: column; }
  .search-form button { padding: 11px; }
  .card-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(-n + 4) { border-bottom: 1px solid var(--rule); }
  .journal-head { flex-direction: column; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .filter-actions { margin-left: 0; }
  .kv div { flex-direction: column; gap: 2px; }
  .kv dd { text-align: left; }
  .footer-inner { grid-template-columns: 1fr; }
}
