:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #111827;
  --muted: #5b6472;
  --line: #e3e6ec;
  --accent: #1e40af;
  --accent-2: #0369a1;
  --accent-soft: #e8eefc;
  --tag: #eef1f6;
  --t1: #1e40af; --t1-bg: #e0e9ff;
  --t2: #1d4ed8; --t2-bg: #e8efff;
  --t3: #92400e; --t3-bg: #fdf1e2;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111614; --panel: #18201c; --text: #eef3f0; --muted: #9aa8a0; --line: #2c3631;
    --accent: #2dd4bf; --accent-2: #4ade80; --accent-soft: #143029; --tag: #222b26;
    --t1: #5eead4; --t1-bg: #123631; --t2: #93c5fd; --t2-bg: #16243f; --t3: #fcd34d; --t3-bg: #3a2c12;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* header */
.topbar { background: linear-gradient(120deg, #0b1f4d 0%, #1e3a8a 100%); color: #fff; }
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: rgba(255,255,255,.14); font-weight: 800; font-size: 18px; }
.brand .t1 { display: block; font-size: 21px; font-weight: 700; letter-spacing: .01em; }
.brand .t2 { display: block; font-size: 12.5px; opacity: .8; }
.nav { display: flex; gap: 4px; }
.nav a { color: rgba(255,255,255,.82); padding: 7px 14px; border-radius: 999px; font-weight: 600; }
.nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.nav a.active { background: #fff; color: #0b1f4d; }

/* generic panels */
.intro { margin: 22px 0 6px; color: var(--muted); font-size: 14px; max-width: 900px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--accent); }
.stat .l { color: var(--muted); font-size: 13px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.controls { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row + .row { margin-top: 10px; }
.row .lbl { font-size: 13px; color: var(--muted); margin-right: 2px; }
input[type=search], select { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
input[type=search] { flex: 1 1 280px; min-width: 200px; }
select { max-width: 280px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; cursor: pointer; }
.btn { font: inherit; font-size: 14px; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--muted); cursor: pointer; }
.btn:hover { color: var(--text); border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip { font: inherit; font-size: 13px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--muted); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip .c { color: var(--muted); font-size: 12px; margin-left: 4px; }
.count { color: var(--muted); font-size: 13px; margin: 0 0 10px 2px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }

/* tags & badges */
.tag { display: inline-block; background: var(--tag); border-radius: 5px; padding: 0 7px; font-size: 12px; margin: 0 4px 4px 0; white-space: nowrap; }
.badge { display: inline-block; border-radius: 5px; padding: 0 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tier-核心领域 { color: var(--t1); background: var(--t1-bg); }
.tier-领域之一 { color: var(--t2); background: var(--t2-bg); }
.tier-相关研究 { color: var(--t3); background: var(--t3-bg); }
.badge.plain { color: var(--muted); background: var(--tag); font-weight: 500; }

/* school group + cards */
.group-h { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.group-h .rk { color: var(--muted); font-size: 13px; min-width: 30px; }
.group-h .nm { font-weight: 700; font-size: 16px; }
.group-h .zh { color: var(--muted); }
.group-h .n { margin-left: auto; color: var(--muted); font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 15px 12px; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 4px 14px rgba(30,64,175,.10); transform: translateY(-1px); }
.card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.card .nm { font-weight: 700; font-size: 16px; line-height: 1.3; }
.card .nm .zh { color: var(--muted); font-weight: 400; margin-left: 4px; font-size: 14px; }
.card .meta { color: var(--muted); font-size: 13px; margin: 3px 0 8px; }
.card .edu { font-size: 12.5px; color: var(--muted); margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; display: flex; justify-content: space-between; gap: 6px; }
.card .pc { color: var(--accent); font-weight: 600; white-space: nowrap; }
.card .pc.zero { color: var(--muted); font-weight: 400; }

/* profile page */
.crumb { margin: 18px 0 6px; font-size: 13px; color: var(--muted); }
.profile-h { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.profile-h h1 { margin: 0; font-size: 26px; }
.profile-h h1 .zh { color: var(--muted); font-weight: 400; font-size: 20px; margin-left: 8px; }
.profile-h .ttl { color: var(--muted); margin: 4px 0 10px; }
.profile-h .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.profile-h .links a { border: 1px solid var(--line); border-radius: 8px; padding: 4px 11px; font-size: 13.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 14px; margin-top: 14px; align-items: start; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.box + .box { margin-top: 14px; }
.box h3 { margin: 0 0 10px; font-size: 14px; color: var(--accent); letter-spacing: .03em; }
.box p { margin: 0 0 8px; font-size: 14px; }
.kv { display: grid; grid-template-columns: 6.5em 1fr; gap: 4px 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--accent-soft); }
.timeline li { position: relative; margin: 0 0 10px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline .deg { font-weight: 600; }
.timeline .yr { color: var(--muted); margin-left: 6px; font-size: 13px; }
.timeline .fd { display: block; color: var(--muted); font-size: 13px; }
.career { margin: 0; padding-left: 18px; font-size: 14px; }
.career li { margin-bottom: 3px; }
.small { font-size: 12.5px; color: var(--muted); }

/* papers */
.paper { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 16px; margin-bottom: 10px; }
.paper .pt { font-weight: 650; font-size: 15.5px; line-height: 1.4; }
.paper .pt a { color: var(--text); }
.paper .pt a:hover { color: var(--accent); }
.paper .ptz { color: var(--muted); font-size: 14px; }
.paper .pm { font-size: 13px; color: var(--muted); margin-top: 4px; }
.paper .pm .venue { font-style: italic; color: var(--text); }
.paper .st { margin-left: 6px; }
.st-已发表 { color: var(--t1); background: var(--t1-bg); }
.st-即将发表 { color: var(--accent-2); background: var(--accent-soft); }
.st-修改重投 { color: var(--t2); background: var(--t2-bg); }
.st-工作论文 { color: var(--t3); background: var(--t3-bg); }
.paper details { margin-top: 8px; }
.paper summary { cursor: pointer; color: var(--accent); font-size: 13.5px; user-select: none; }
.paper .abs { white-space: pre-line; font-size: 14px; margin-top: 6px; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.paper .by { font-size: 13px; margin-top: 4px; }
.placeholder { border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); background: var(--panel); }
.placeholder .btn { margin-top: 10px; }

/* schools table */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
thead th { border-top: none; color: var(--muted); font-size: 12.5px; font-weight: 600; background: var(--panel); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent); vertical-align: middle; margin-left: 6px; opacity: .75; }
tr.clk { cursor: pointer; }
tr.clk:hover td { background: var(--accent-soft); }
.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }

/* about */
.prose { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; margin: 20px 0; max-width: 900px; }
.prose h2 { font-size: 18px; margin: 18px 0 8px; color: var(--accent); }
.prose h2:first-child { margin-top: 4px; }
.prose li { margin-bottom: 4px; }
.prose code, .prose pre { background: var(--tag); border-radius: 5px; font-size: 13px; }
.prose code { padding: 1px 5px; }
.prose pre { padding: 10px 12px; overflow-x: auto; line-height: 1.5; }

.footer { color: var(--muted); font-size: 13px; padding: 26px 20px 40px; }

@media (max-width: 820px) {
  .grid2, .split { grid-template-columns: 1fr; }
  .brand .t1 { font-size: 18px; }
  .brand .t2 { display: none; }
  .nav { width: 100%; }
  .nav a { padding: 6px 12px; }
  select { max-width: 100%; }
  .kv { grid-template-columns: 5.5em 1fr; }
}

/* round 2 additions */
.badge.eee { color: var(--accent-2); background: var(--accent-soft); margin-left: 6px; font-size: 11px; }
.card .meta .unit-t { color: var(--t3); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 14px 0 6px; }

/* econ-faculty additions */
.rk-Professor { color: var(--t1); background: var(--t1-bg); }
.rk-Associate { color: var(--t2); background: var(--t2-bg); }
.rk-Assistant { color: var(--t3); background: var(--t3-bg); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.fcell { display: flex; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; color: var(--text); }
.fcell:hover { border-color: var(--accent); text-decoration: none; }
.fcell .c { color: var(--muted); }
.coming { border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; color: var(--muted); text-align: center; }
.tag.pf { background: var(--accent-soft); color: var(--accent); }
.badge.pfb { color: var(--accent); background: var(--accent-soft); }

/* paper lists */
.pbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 6px; }
.pbar input[type=search] { flex: 1; min-width: 180px; }
.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.psec { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.paper .pm a { color: var(--muted); text-decoration: underline; }
.paper .pt a.srch { text-decoration: none; }
.tier.g0 { background: #e7f0fb; border-color: #a9c6ec; color: #1f4f8a; }
.tier.g1 { background: #ebf6ee; border-color: #a7d7b4; color: #23653a; }
.tier.g2 { background: #f3ecfa; border-color: #c9b3e6; color: #5b3a8a; }
.tier { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; vertical-align: 2px; margin-left: 4px; border: 1px solid var(--line); color: var(--muted); }
.curated { color: #23653a; }
td.num { text-align: right; white-space: nowrap; }

.paper .pa { font-size: 14px; margin-top: 2px; }
.paper .pa a { font-weight: 600; }
