:root {
  --bg: #f5f1e8;
  --bg-soft: #faf6ee;
  --panel: #fffdf8;
  --ink: #1f2a30;
  --ink-soft: #56656f;
  --ink-mute: #7a8893;
  --accent: #0f766e;
  --accent-2: #b45309;
  --accent-3: #0058be;
  --border: #e8ddcb;
  --border-soft: rgba(108, 117, 128, 0.14);
  --shadow: 0 14px 36px rgba(31, 42, 48, 0.12);
  --shadow-sm: 0 6px 18px rgba(31, 42, 48, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1400px 600px at -20% -30%, rgba(180, 83, 9, 0.14), transparent),
    radial-gradient(1200px 500px at 120% -20%, rgba(15, 118, 110, 0.12), transparent),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 顶栏 ===== */
.nav-wrap {
  position: sticky; top: 0; z-index: 12;
  backdrop-filter: blur(16px);
  background: rgba(245, 241, 232, 0.82);
  border-bottom: 1px solid var(--border-soft);
}
.nav {
  max-width: 1240px; margin: 0 auto;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 22px; }
.brand-text { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.nav-stat { color: var(--ink-mute); font-size: 13px; font-weight: 600; }

/* ===== 主壳 ===== */
.shell {
  max-width: 1240px; margin: 0 auto;
  padding: 36px 20px 56px;
  animation: rise-in 400ms ease-out;
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Hero ===== */
.hero { text-align: center; margin: 8px 0 8px; }
.hero-kicker {
  margin: 0 0 14px;
  color: var(--accent-2); font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
}
.hero-title {
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  line-height: 1.22; letter-spacing: -0.018em; font-weight: 800;
}
.hero-sub {
  margin: 18px auto 0; max-width: 680px;
  color: var(--ink-soft); font-size: 15px; line-height: 1.75;
}
.hero-note {
  margin: 14px auto 0; max-width: 680px;
  color: var(--ink-mute); font-size: 13px; line-height: 1.6;
}

/* ===== 筛选面板 ===== */
.filter-panel {
  margin-top: 30px; padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow-sm);
}
.filter-main {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
}
.input {
  width: 100%; min-height: 44px;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fff; color: var(--ink);
  padding: 10px 14px; font-size: 14px; outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.input:focus {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.btn {
  border: 0; border-radius: 999px;
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: transform 120ms ease, background 120ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost { color: var(--ink-soft); background: #efe7d6; }

.filter-tags {
  margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px;
}
.tag {
  border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-soft); background: #f3ede2;
  border: 1px solid transparent;
  cursor: pointer; transition: all 150ms ease;
  display: inline-flex; align-items: center; gap: 5px;
}
.tag:hover { background: var(--accent); color: #fff; }
.tag.active { background: var(--accent); color: #fff; }
.tag small { opacity: 0.7; font-weight: 700; }
/* "全部"按钮:稍重,和普通标签区分 */
.tag-all { background: #fff; border-color: var(--border); color: var(--ink); font-weight: 800; }
.tag-all:hover { background: var(--accent); color: #fff; }
.tag-all.active { background: var(--accent); color: #fff; }

.filter-count { margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; background: #edf0f4; color: #465264;
  padding: 6px 13px; font-size: 12px; font-weight: 700;
}

/* ===== 卡片网格 ===== */
.grid {
  margin-top: 30px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  min-height: 240px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 280ms ease, box-shadow 280ms ease, background 280ms ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  background: #fffefb;
}
.card::after {
  content: ""; position: absolute; bottom: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left;
  transition: transform 320ms ease;
}
.card:hover::after { transform: scaleX(1); }

.card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px;
}
.card-name {
  font-size: 16px; font-weight: 700; line-height: 1.35;
  color: var(--ink); word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card-name a { color: var(--ink); }
.card-name a:hover { color: var(--accent-3); text-decoration: none; }
.card-meta { display: flex; gap: 6px; flex-shrink: 0; }
.star-chip, .lang-chip {
  display: inline-flex; align-items: center; gap: 3px;
  border-radius: 999px; padding: 4px 10px;
  font-size: 12px; font-weight: 700;
}
.star-chip { color: #8a5a06; background: #fbf0d9; }
.lang-chip { color: #004fa9; background: #dce8ff; }

/* 中文摘要为主体 */
.card-summary {
  flex-grow: 1;
  color: var(--ink); font-size: 15px; line-height: 1.7;
  margin-bottom: 18px;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pill {
  border-radius: 999px; padding: 4px 11px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #465265; background: #edf1f7;
}
.card-foot {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--border);
  color: var(--ink-mute); font-size: 12px;
  display: flex; justify-content: space-between; align-items: center;
}

.empty {
  grid-column: 1 / -1;
  text-align: center; color: var(--ink-mute);
  padding: 48px 0; font-size: 14px;
}

/* ===== 分页 ===== */
.pagination {
  margin-top: 28px; display: flex; justify-content: center;
  align-items: center; flex-wrap: wrap; gap: 8px;
}
.page-btn {
  min-width: 38px; height: 36px; padding: 0 14px;
  border: 1px solid var(--border-soft); border-radius: 999px;
  background: var(--panel); color: var(--ink-soft);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 150ms ease;
}
.page-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--accent); }
.page-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.page-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.status-line { margin-top: 12px; text-align: center; color: var(--ink-mute); font-size: 13px; }

/* ===== 详情弹层 ===== */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(31, 42, 48, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade-in 200ms ease;
}
.modal.hidden { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: min(680px, 96vw); max-height: 86vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 28px; position: relative;
  animation: rise-in 280ms ease-out;
}
.modal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; font-size: 26px;
  color: var(--ink-mute); cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--ink); }
.modal h2 { font-size: 20px; margin-bottom: 14px; word-break: break-all; }
.modal .m-meta { color: var(--ink-mute); font-size: 13px; margin-bottom: 18px; }
.modal .m-meta a { font-weight: 600; }
.modal .m-section-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-2); margin-bottom: 8px;
}
.modal .m-summary {
  font-size: 16px; line-height: 1.75; color: var(--ink);
  margin-bottom: 20px;
}
.modal .m-desc { font-size: 14px; line-height: 1.65; color: var(--ink-soft); margin-bottom: 20px; }
.modal .m-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== 页脚 ===== */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 36px 20px; margin-top: 24px;
}
.footer-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.footer-brand .brand-text { font-size: 16px; font-weight: 800; }
.footer-brand .copyright { font-size: 13px; color: var(--ink-mute); }

/* ===== 响应式 ===== */
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 20px; min-height: auto; }
  .nav-stat { display: none; }
  .filter-main { grid-template-columns: 1fr; }
}
