/* ============ 游资心法秘籍阁 · 墨金书卷 ============ */
:root {
  --ink: #0e0d0a;
  --ink2: #14120e;
  --ink3: #1d1a14;
  --line: #2c2820;
  --gold: #c9a227;
  --gold-dim: #8a7428;
  --cinnabar: #c53a2b;
  --cinnabar-dim: #8f2b1f;
  --paper: #f4eddc;
  --paper2: #ece2c9;
  --paper-ink: #2a2218;
  --paper-ink-dim: #6b5c48;
  --muted: #8d8474;
  --txt: #e8e0cc;
  --font-display: "KaiTi", "STKaiti", "楷体", "SimSun", serif;
  --font-body: "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "Consolas", "JetBrains Mono", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--txt);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1200px 500px at 85% -5%, rgba(201,162,39,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 40%, rgba(197,58,43,.06), transparent 60%),
    radial-gradient(700px 400px at 60% 110%, rgba(201,162,39,.05), transparent 60%);
}
/* 纸张噪点 */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,.font-display { font-family: var(--font-display); font-weight: 400; }
::selection { background: var(--gold); color: var(--ink); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 36px;
  background: rgba(14,13,10,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: var(--font-display); font-size: 20px; letter-spacing: 2px; }
.gold { color: var(--gold); }
.cinnabar { color: var(--cinnabar); }
.topsearch { flex: 1; max-width: 520px; display: flex; gap: 0; }
.topsearch input, .herosearch input {
  flex: 1; padding: 9px 16px; font-size: 14px;
  background: var(--ink2); color: var(--txt);
  border: 1px solid var(--line); border-right: 0; outline: none;
}
.topsearch input:focus, .herosearch input:focus { border-color: var(--gold-dim); }
.topsearch button, .herosearch button {
  padding: 9px 20px; cursor: pointer;
  background: var(--gold); color: #131108; border: 1px solid var(--gold);
  font-size: 14px; font-weight: 700; letter-spacing: 2px;
}
.topnav { display: flex; gap: 10px; }

/* ---------- 印章 ---------- */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
  font-family: var(--font-display); font-size: 18px; color: #f6e9d8;
  background: var(--cinnabar); border-radius: 5px;
  box-shadow: inset 0 0 8px rgba(0,0,0,.4), 2px 2px 0 rgba(197,58,43,.25);
  border: 1px solid rgba(255,255,255,.14);
  transform: rotate(-3deg);
}
.seal.mini { width: 26px; height: 26px; font-size: 14px; }
.seal.big { width: 74px; height: 74px; font-size: 40px; transform: rotate(-4deg); box-shadow: inset 0 0 12px rgba(0,0,0,.45), 4px 5px 0 rgba(197,58,43,.22); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 84px 36px 64px; overflow: hidden; }
.hero-inner { max-width: 1240px; margin: 0 auto; display: flex; gap: 44px; align-items: stretch; }
.hero-vertical {
  font-family: var(--font-display); font-size: 26px; letter-spacing: 14px;
  writing-mode: vertical-rl; color: var(--muted);
  padding: 10px 4px 10px 0; border-left: 1px solid var(--gold-dim);
  text-shadow: 0 0 24px rgba(201,162,39,.2);
}
.hero-main { flex: 1; }
.hero-title {
  font-size: clamp(44px, 7vw, 84px); letter-spacing: 10px; line-height: 1.15;
  text-shadow: 0 4px 40px rgba(201,162,39,.18);
  animation: rise .8s ease both;
}
.hero-sub { color: var(--muted); margin: 18px 0 30px; font-size: 17px; letter-spacing: 1px; animation: rise .8s .1s ease both; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; animation: rise .8s .2s ease both; }
.stat {
  flex: 1; min-width: 120px; padding: 16px 18px;
  background: linear-gradient(160deg, var(--ink3), var(--ink2));
  border: 1px solid var(--line); border-radius: 6px;
}
.stat b { display: block; font-family: var(--font-display); font-size: 30px; color: var(--gold); }
.stat b i { font-style: normal; font-size: 16px; }
.stat span { color: var(--muted); font-size: 12px; letter-spacing: 3px; }
.herosearch { display: flex; max-width: 640px; animation: rise .8s .3s ease both; }
.herosearch input { padding: 14px 18px; font-size: 15px; }

/* ---------- 分类 Card ---------- */
.section { max-width: 1240px; margin: 0 auto; padding: 48px 36px; position: relative; z-index: 2; }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: 34px; letter-spacing: 6px; color: var(--txt); }
.section-head h2 .en { font-size: 15px; letter-spacing: 4px; color: var(--gold-dim); margin-left: 14px; font-family: var(--font-body); }
.section-sub { color: var(--muted); margin-top: 8px; font-size: 13px; letter-spacing: 1px; }

.featured { max-width: 1240px; margin: 0 auto; padding: 0 36px; position: relative; z-index: 2; }
.featured-card {
  display: block; position: relative; padding: 34px 40px;
  background:
    linear-gradient(120deg, rgba(201,162,39,.10), transparent 45%),
    linear-gradient(160deg, var(--ink3), var(--ink2));
  border: 1px solid var(--gold-dim); border-radius: 8px;
  box-shadow: 0 0 60px rgba(201,162,39,.08);
  transition: transform .3s ease, box-shadow .3s ease;
}
.featured-card:hover { transform: translateY(-4px); box-shadow: 0 12px 50px rgba(201,162,39,.16); }
.featured-badge {
  display: inline-block; font-size: 12px; letter-spacing: 3px;
  color: var(--gold); border: 1px solid var(--gold-dim); padding: 3px 12px; border-radius: 20px; margin-bottom: 14px;
}
.featured-card h2 { font-size: 34px; letter-spacing: 6px; margin-bottom: 8px; }
.featured-card .tagline { color: var(--muted); margin-bottom: 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px 24px 20px;
  background: linear-gradient(170deg, var(--ink3), var(--ink2) 70%);
  border: 1px solid var(--line); border-radius: 8px;
  opacity: 0; animation: rise .55s ease forwards; animation-delay: var(--d, 0ms);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 14px 40px rgba(201,162,39,.12); }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.rank { font-family: var(--font-mono); font-size: 22px; color: var(--gold-dim); letter-spacing: 1px; }
.card-name { font-size: 30px; letter-spacing: 4px; color: var(--txt); }
.card-tagline { color: var(--muted); font-size: 13px; line-height: 1.6; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 4px 11px; border-radius: 20px;
  color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,.02);
  letter-spacing: 1px;
}
.chip em { font-style: normal; color: var(--gold); }
.gold-chip { color: var(--gold); border-color: var(--gold-dim); }
.red-chip { color: #e07a66; border-color: #6e2a1e; }
.card-skill { font-family: var(--font-display); font-size: 15px; color: var(--cinnabar); letter-spacing: 2px; }

/* ---------- 游资详情 ---------- */
.trader-hero { padding: 52px 36px 0; max-width: 1240px; margin: 0 auto; position: relative; z-index: 2; }
.trader-hero-inner { display: flex; gap: 26px; align-items: flex-start; }
.trader-head-main h1 { font-size: clamp(38px, 5vw, 56px); letter-spacing: 8px; }
.trader-head-main .tagline { color: var(--muted); margin: 10px 0 14px; max-width: 900px; }
.tabs {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 30px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 57px; z-index: 40;
  background: rgba(14,13,10,.94); backdrop-filter: blur(8px);
  padding-top: 6px;
}
.tab {
  padding: 12px 22px; font-size: 15px; color: var(--muted);
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.tab em { font-style: normal; color: var(--gold-dim); font-size: 12px; margin-left: 4px; }
.tab:hover { color: var(--txt); }
.tab.active, .tab:target { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- 宣纸阅读面板 ---------- */
.paper {
  background:
    linear-gradient(rgba(255,249,234,.05), rgba(255,249,234,0)) ,
    var(--paper);
  color: var(--paper-ink);
  border-radius: 4px;
  padding: 44px 52px;
  box-shadow: 0 10px 34px rgba(0,0,0,.42), inset 0 0 80px rgba(180,150,90,.13);
  position: relative;
}
.paper.scroll-x { overflow-x: auto; }
.scroll-head {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 16px; margin: -26px -34px 26px;
  background: var(--cinnabar-dim); color: #f6e9d8;
  font-family: var(--font-display); font-size: 17px; letter-spacing: 2px;
}
.scroll-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-btn { margin-left: auto; flex: none; }
.dl-chip {
  color: var(--cinnabar); border-color: var(--cinnabar-dim); font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.dl-chip:hover { background: var(--cinnabar); color: #f6e9d8; }
.md { font-size: 15.5px; }
.md h1 { font-size: 28px; margin: 0 0 16px; color: var(--cinnabar-dim); letter-spacing: 2px; }
.md h2 { font-size: 21px; margin: 30px 0 12px; padding-left: 12px; border-left: 4px solid var(--cinnabar); color: #7d4d16; line-height: 1.4; }
.md h3 { font-size: 17px; margin: 22px 0 10px; color: #7d4d16; }
.md p { margin: 10px 0; }
.md ul, .md ol { margin: 10px 0 10px 4px; padding-left: 22px; }
.md li { margin: 6px 0; }
.md hr { border: 0; border-top: 1px dashed rgba(122,98,50,.5); margin: 24px 0; }
.md blockquote { margin: 12px 0; padding: 8px 18px; border-left: 3px solid var(--gold-dim); background: rgba(201,162,39,.08); color: #5c4a2c; }
.md code { background: rgba(122,98,50,.14); padding: 2px 7px; border-radius: 3px; font-family: var(--font-mono); font-size: 13.5px; }
.md pre { background: #3a3122; color: #f0e6cf; padding: 16px 20px; border-radius: 4px; overflow-x: auto; margin: 12px 0; }
.md pre code { background: none; color: inherit; }
.md table { border-collapse: collapse; margin: 14px 0; width: 100%; }
.md th, .md td { border: 1px solid rgba(122,98,50,.4); padding: 7px 12px; text-align: left; }
.md th { background: rgba(201,162,39,.14); }
.md a { color: #8a2f1f; text-decoration: underline; }
.md strong { color: #6b3a10; }
.skill-desc-line { margin-bottom: 16px; color: var(--muted); font-size: 13.5px; }
.skill-desc-line b { color: var(--gold); }
.aux-link { margin-top: 14px; }
.aux-link a { color: var(--gold); font-size: 14px; }
.aux-link a:hover { text-decoration: underline; }
/* 卷轴面板保持素净，不加装饰边 */

/* ---------- 文件列表 ---------- */
.filegroup { font-family: var(--font-display); font-size: 19px; color: var(--gold); letter-spacing: 2px; margin: 26px 0 14px; }
.filelist { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.filerow {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 18px; background: var(--ink2);
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.filerow:last-child { border-bottom: 0; }
.filerow:hover { background: var(--ink3); }
.fileicon {
  flex: none; width: 44px; text-align: center; padding: 4px 0;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
  border-radius: 4px; color: #171411;
}
.fileicon.pdf { background: var(--cinnabar); }
.fileicon.audio { background: var(--gold); font-size: 16px; }
.fileicon.doc  { background: #7a93a8; }
.fileicon.md   { background: #6f9a7a; }
.fileicon.txt  { background: #96a89a; }
.filename { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.filesize { color: var(--muted); font-size: 12px; flex: none; }
.fileacts { display: flex; gap: 8px; flex: none; }
.btn {
  display: inline-block; padding: 6px 16px; font-size: 13px; cursor: pointer;
  background: var(--gold); color: #131108; border: 1px solid var(--gold);
  letter-spacing: 1px; border-radius: 3px; transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn.small { padding: 4px 12px; font-size: 12px; }
.btn.ghost { background: transparent; color: var(--txt); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.audio-row { flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.empty { color: var(--muted); padding: 20px 0; }

/* ---------- 墨金迷你播放器 ---------- */
.player {
  flex: 1; min-width: 240px;
  display: flex; align-items: center; gap: 12px;
}
.pbtn {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); border: 1px solid var(--gold); cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
}
.pbtn:hover { transform: scale(1.08); box-shadow: 0 0 14px rgba(201,162,39,.45); }
.pbtn:active { transform: scale(.96); }
.pico {
  display: block; width: 0; height: 0; margin-left: 2px;
  border-left: 9px solid #131108; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.pico.pause {
  width: 8px; height: 12px; margin-left: 0;
  border-left: 3px solid #131108; border-right: 3px solid #131108;
  border-top: 0; border-bottom: 0;
}
.ptrack {
  position: relative; flex: 1; height: 8px; border-radius: 4px; cursor: pointer;
  background: #26221a; border: 1px solid #322c20; overflow: hidden;
}
.ptrack:hover { border-color: var(--gold-dim); }
.pbuf { position: absolute; inset: 0; width: 100%; }
.pfill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 4px; transition: width .15s linear;
}
.playing .ptrack::after {
  content: ""; position: absolute; right: 0; top: -3px; width: 3px; height: 12px;
  background: var(--gold); animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.ptime {
  flex: none; min-width: 74px; text-align: right;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.player.playing .ptime { color: var(--gold); }
.player.loading .pbtn { opacity: .55; }

/* ---------- 图库 ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gitem { position: relative; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--ink2); }
.gitem img { width: 100%; height: 150px; object-fit: cover; display: block; transition: transform .3s; }
.gitem span {
  display: block; padding: 6px 10px; font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gitem:hover img { transform: scale(1.05); }

/* ---------- 搜索命中 ---------- */
.hitlist { display: flex; flex-direction: column; gap: 10px; }
.hit {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 20px;
  background: var(--ink2); border: 1px solid var(--line); border-left: 3px solid var(--gold-dim);
  border-radius: 4px; transition: border-color .2s, background .2s;
}
.hit:hover { border-left-color: var(--gold); background: var(--ink3); }
.hit b { font-size: 15px; color: var(--gold); }
.hit .snip { font-size: 13px; color: var(--muted); }

/* ---------- 文本页 ---------- */
.texttitle { font-family: var(--font-body); font-size: 22px; letter-spacing: 1px; }
.plaintext { white-space: pre-wrap; font-family: var(--font-body); font-size: 14.5px; line-height: 1.9; }

.footer { text-align: center; color: #5a5344; font-size: 12.5px; padding: 40px 30px 60px; border-top: 1px solid var(--line); margin-top: 60px; letter-spacing: 1px; }
.footer p { margin: 4px 0; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .topbar { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .topnav { display: none; }
  .hero { padding: 48px 20px; }
  .hero-inner { flex-direction: column; }
  .hero-vertical { writing-mode: horizontal-tb; border-left: 0; border-top: 1px solid var(--gold-dim); padding: 8px 0; letter-spacing: 4px; }
  .section { padding: 36px 20px; }
  .paper { padding: 26px 20px; }
  .scroll-head { margin: -12px -6px 20px; }
  .trader-hero { padding: 36px 20px 0; }
}
