/* 净空老法师 · 听经阁 —— 亲民、大字、安静的暖色阅读界面 */
:root{
  --font-scale: 1;
  --bg: #fbf7ef;
  --bg-soft: #f4ecdd;
  --card: #fffdf8;
  --ink: #3b322b;
  --ink-soft: #756859;
  --brown: #7d5c43;
  --brown-deep: #573b2b;
  --gold: #bd9550;
  --line: #e7dcc7;
  --lotus: #c58c86;
  --green: #788b72;
  --shadow: 0 6px 24px rgba(87, 59, 43, .08);
  --radius: 16px;
  --player-h: 104px;
}
body[data-font="small"]{ --font-scale: .92; }
body[data-font="normal"]{ --font-scale: 1; }
body[data-font="large"]{ --font-scale: 1.16; }

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; scroll-padding-top: 90px; }
body{
  margin: 0;
  padding-bottom: calc(var(--player-h) + 28px);
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Hiragino Sans GB", sans-serif;
  font-size: calc(17px * var(--font-scale));
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
.wrap{ width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.hidden{ display: none !important; }
a{ color: var(--brown); }
button, input, select{ font-family: inherit; font-size: inherit; }
button{ cursor: pointer; }
img{ max-width: 100%; display: block; }

/* 纸张纹理 */
.paper-grain{
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .42;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(189,149,80,.10) 0, transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(197,140,134,.08) 0, transparent 30%),
    radial-gradient(circle at 76% 82%, rgba(120,139,114,.07) 0, transparent 38%);
}
main, header, footer, .player{ position: relative; z-index: 1; }

/* 顶栏 */
.site-header{
  position: sticky; top: 0; z-index: 30;
  background: rgba(251,247,239,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner{ display: flex; align-items: center; gap: 22px; min-height: 78px; }
.brand{ display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brown-deep); flex-shrink: 0; }
.lotus-seal{ width: 46px; height: 46px; color: var(--gold); flex-shrink: 0; }
.lotus-seal svg{ width: 100%; height: 100%; }
.brand-text{ display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong{ font-family: "Songti SC", "STSong", "SimSun", serif; font-size: calc(21px * var(--font-scale)); letter-spacing: .06em; }
.brand-text small{ color: var(--ink-soft); font-size: calc(12.5px * var(--font-scale)); letter-spacing: .18em; }
.top-nav{ display: flex; gap: 6px; margin-left: auto; }
.top-nav a{
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--ink-soft); font-size: calc(15px * var(--font-scale)); white-space: nowrap;
}
.top-nav a:hover{ background: var(--bg-soft); color: var(--brown-deep); }
.font-tools{ display: flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: calc(13px * var(--font-scale)); }
.font-tools span{ margin-right: 4px; }
.font-tools button{
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  width: 34px; height: 34px; border-radius: 9px; padding: 0;
}
.font-tools button.active{ background: var(--brown-deep); border-color: var(--brown-deep); color: #fff; }

/* 主视觉 */
.hero{
  display: grid; grid-template-columns: 340px 1fr; gap: 58px; align-items: center;
  padding: 54px 0 46px;
}
.hero-photo{
  position: relative; padding: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
}
.hero-photo img{
  width: 100%; aspect-ratio: 463 / 478; object-fit: cover; object-position: center top;
  border-radius: 3px; filter: saturate(.92);
}
.hero-photo::after{
  content: ""; position: absolute; inset: 14px; pointer-events: none;
  box-shadow: inset 0 0 34px rgba(87,59,43,.10);
}
.photo-corner{ position: absolute; width: 15px; height: 15px; border: 2px solid var(--gold); z-index: 2; }
.photo-corner.tl{ left: 6px; top: 6px; border-right: 0; border-bottom: 0; }
.photo-corner.tr{ right: 6px; top: 6px; border-left: 0; border-bottom: 0; }
.photo-corner.bl{ left: 6px; bottom: 6px; border-right: 0; border-top: 0; }
.photo-corner.br{ right: 6px; bottom: 6px; border-left: 0; border-top: 0; }
.eyebrow{
  color: var(--gold); letter-spacing: .42em; font-size: calc(14px * var(--font-scale)); margin: 0 0 14px;
}
.hero h1{
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "SimSun", serif;
  font-size: calc(46px * var(--font-scale)); line-height: 1.35; font-weight: 600;
  color: var(--brown-deep); margin: 0 0 20px; letter-spacing: .08em;
}
.hero-desc{ max-width: 30em; color: var(--ink-soft); margin: 0 0 8px; font-size: calc(17px * var(--font-scale)); }
.hero-note{ color: #a2957f; font-size: calc(13px * var(--font-scale)); margin: 0 0 26px; }
.hero-stats{ display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats div{
  min-width: 116px; padding: 12px 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: baseline; gap: 8px;
}
.hero-stats b{ font-size: calc(27px * var(--font-scale)); color: var(--brown-deep); font-family: Georgia, serif; }
.hero-stats span{ color: var(--ink-soft); font-size: calc(13px * var(--font-scale)); }

/* 区块通用 */
.block{ padding: 38px 0 12px; }
.section-head{
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 24px;
}
.section-kicker{
  margin: 0 0 2px; color: var(--gold); letter-spacing: .26em;
  font-size: calc(11.5px * var(--font-scale)); font-family: Georgia, serif;
}
.section-head h2{
  margin: 0; font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: calc(27px * var(--font-scale)); letter-spacing: .1em; color: var(--brown-deep);
}
.section-note{ margin: 0; max-width: 42em; color: var(--ink-soft); font-size: calc(14px * var(--font-scale)); text-align: right; }

/* 法相纪念 */
.photo-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.photo-card{
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.photo-card .frame{ position: relative; aspect-ratio: 1 / 1; background: var(--bg-soft); overflow: hidden; }
.photo-card img{ width: 100%; height: 100%; object-fit: cover; object-position: 28% center; transition: transform .5s ease; }
.photo-card:hover img{ transform: scale(1.04); }
.photo-card .frame.tall img{ object-position: center 18%; }
.photo-card .art{ width: 100%; height: 100%; display: grid; place-items: center; color: var(--gold); background: linear-gradient(150deg, #f7efe0, #fbf8f0); }
.photo-card .art svg{ width: 62%; height: 62%; }
.photo-card figcaption{ padding: 12px 14px 14px; flex: 1; }
.photo-card figcaption b{ display: block; font-size: calc(15px * var(--font-scale)); color: var(--brown-deep); line-height: 1.5; }
.photo-card figcaption small{ display: block; color: var(--ink-soft); font-size: calc(12.5px * var(--font-scale)); margin-top: 4px; line-height: 1.55; }
.tag-photo, .tag-art{
  display: inline-block; font-size: calc(11px * var(--font-scale)); padding: 1px 8px;
  border-radius: 999px; margin-bottom: 6px; border: 1px solid var(--line); color: var(--ink-soft);
}
.tag-photo{ background: #f1e8d5; color: #8a6a3e; }
.photo-credit{
  margin: 16px 0 0; color: var(--ink-soft); font-size: calc(13px * var(--font-scale)); line-height: 1.9;
  border-left: 3px solid var(--gold); padding-left: 14px;
}
.photo-credit a{ color: var(--brown); text-decoration: underline; text-underline-offset: 3px; }

/* 提示条 */
.resume-bar, .demo-tip{
  border-radius: 12px; padding: 14px 18px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: calc(15px * var(--font-scale));
}
.resume-bar{ background: #f0eadb; border: 1px solid #e0cfae; color: var(--brown-deep); }
.resume-bar .soft-btn{ margin-left: auto; }
.demo-tip{ background: #fdf6ef; border: 1px dashed #d8bfa2; color: #8a6a4b; line-height: 1.8; flex-direction: column; align-items: stretch; gap: 2px; }

/* 工具条 */
.toolbar{ display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search-box{
  flex: 1 1 380px; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px;
  min-height: 54px; box-shadow: var(--shadow);
}
.search-box svg{ width: 21px; height: 21px; flex-shrink: 0; stroke: var(--brown); stroke-width: 1.9; fill: none; stroke-linecap: round; }
.search-box input{ flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); min-width: 100px; }
.search-box input::placeholder{ color: #a99c8b; }
.text-btn{ border: 0; background: transparent; color: var(--ink-soft); padding: 6px 4px; white-space: nowrap; }
.text-btn:hover{ color: var(--brown-deep); }
.page-size{ color: var(--ink-soft); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.page-size select{
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
.category-bar{ display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 20px; }
.cat-chip{
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  padding: 9px 16px; border-radius: 999px; min-height: 44px;
  font-size: calc(14.5px * var(--font-scale)); white-space: nowrap;
}
.cat-chip:hover{ border-color: var(--gold); color: var(--brown-deep); }
.cat-chip.active{ background: var(--brown-deep); border-color: var(--brown-deep); color: #fff; }
.cat-chip i{ font-style: normal; opacity: .65; margin-left: 6px; font-size: .86em; }

.list-head{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px; color: var(--ink-soft); font-size: calc(14.5px * var(--font-scale));
}
.list-head b{ color: var(--brown-deep); font-size: 1.15em; }
.soft-btn{
  border: 1px solid var(--line); background: var(--card); color: var(--brown-deep);
  border-radius: 10px; padding: 9px 16px; min-height: 44px; font-size: calc(14px * var(--font-scale));
}
.soft-btn:hover{ background: var(--bg-soft); border-color: var(--gold); }

/* 音档列表 */
.audio-list{ list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.audio-item{
  display: grid; grid-template-columns: 58px 1fr auto; gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; min-height: 72px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.audio-item:hover{ border-color: var(--gold); box-shadow: var(--shadow); }
.audio-item.playing{ background: #f7f0e2; border-color: var(--gold); }
.audio-item .idx{
  font-family: Georgia, serif; color: var(--gold); font-size: calc(19px * var(--font-scale));
  text-align: center; border-right: 1px solid var(--line); padding-right: 8px;
}
.audio-item .info{ min-width: 0; }
.audio-item .info b{
  display: block; font-weight: 600; color: var(--ink); font-size: calc(16px * var(--font-scale));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.audio-item .info small{ color: var(--ink-soft); font-size: calc(12.5px * var(--font-scale)); }
.audio-item .info .heard{ color: var(--green); margin-left: 8px; }
.audio-item .row-actions{ display: flex; align-items: center; gap: 10px; }
.audio-item .dur{ color: var(--ink-soft); font-size: calc(13px * var(--font-scale)); min-width: 52px; text-align: right; }
.row-play{
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--brown-deep); display: grid; place-items: center; padding: 0;
}
.row-play:hover{ background: var(--brown-deep); color: #fff; border-color: var(--brown-deep); }
.row-play svg{ width: 19px; height: 19px; fill: currentColor; }
.empty{ padding: 46px 20px; text-align: center; color: var(--ink-soft); background: var(--card); border: 1px dashed var(--line); border-radius: 12px; }

.pagination{ display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; padding: 24px 0 8px; }
.page-btn{
  min-width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-soft); padding: 0 12px;
}
.page-btn:hover:not(:disabled){ border-color: var(--gold); color: var(--brown-deep); }
.page-btn.active{ background: var(--brown-deep); color: #fff; border-color: var(--brown-deep); }
.page-btn:disabled{ opacity: .4; cursor: default; }
.page-info{ color: var(--ink-soft); font-size: calc(13px * var(--font-scale)); padding: 0 8px; }

/* 使用说明 */
.guide-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.guide-card{ background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.guide-num{
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-soft); color: var(--gold); border: 1px solid var(--line);
  font-family: "Kaiti SC", "KaiTi", serif; font-size: 19px; margin-bottom: 12px;
}
.guide-card h3{ margin: 0 0 8px; font-size: calc(17px * var(--font-scale)); color: var(--brown-deep); }
.guide-card p{ margin: 0; color: var(--ink-soft); font-size: calc(14px * var(--font-scale)); }
code{ background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: .9em; color: var(--brown-deep); }

/* 页脚 */
.site-footer{ border-top: 1px solid var(--line); background: rgba(244,236,221,.6); padding: 26px 0 30px; margin-top: 28px; }
.site-footer p{ margin: 0 auto 8px; max-width: 62em; text-align: center; color: var(--ink-soft); font-size: calc(13.5px * var(--font-scale)); line-height: 1.9; }
.footer-lotus{ color: var(--gold); font-size: 22px !important; letter-spacing: .3em; }
.footer-small{ font-size: calc(12px * var(--font-scale)) !important; color: #9e907c !important; }

/* 播放器 */
.player{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,253,248,.97); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(87,59,43,.09); backdrop-filter: blur(12px);
}
.player-inner{ display: grid; grid-template-columns: 58px minmax(180px, 1fr) auto; gap: 16px; align-items: center; min-height: var(--player-h); padding-top: 10px; padding-bottom: 10px; }
.now-cover{ width: 58px; height: 58px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-soft); }
.now-cover img{ width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.now-line{ display: flex; align-items: baseline; gap: 10px; min-width: 0; margin-bottom: 3px; }
.now-label{ color: var(--gold); font-size: calc(11.5px * var(--font-scale)); letter-spacing: .14em; white-space: nowrap; }
.now-line strong{ font-size: calc(16px * var(--font-scale)); color: var(--brown-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-album{ color: var(--ink-soft); font-size: calc(12.5px * var(--font-scale)); white-space: nowrap; }
.progress-row{ display: flex; align-items: center; gap: 10px; }
.time{ font-family: Georgia, serif; color: var(--ink-soft); font-size: calc(12.5px * var(--font-scale)); min-width: 44px; }
#curTime{ text-align: right; }
input[type="range"]{
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px;
  background: linear-gradient(to right, var(--gold) 0%, var(--gold) var(--fill, 0%), #e8dfcd var(--fill, 0%), #e8dfcd 100%);
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brown-deep); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
input[type="range"]::-moz-range-thumb{ width: 14px; height: 14px; border-radius: 50%; background: var(--brown-deep); border: 2px solid #fff; }
#seek{ flex: 1; min-width: 60px; }
.controls{ display: flex; align-items: center; gap: 8px; }
.icon-btn, .play-btn, .chip-btn{ border: 1px solid var(--line); background: var(--card); color: var(--brown-deep); }
.icon-btn{ width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.icon-btn svg{ width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.play-btn{ width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; padding: 0; background: var(--brown-deep); color: #fff; border-color: var(--brown-deep); }
.play-btn svg{ width: 24px; height: 24px; fill: currentColor; }
.icon-btn:hover, .chip-btn:hover{ border-color: var(--gold); background: var(--bg-soft); }
.play-btn:hover{ background: #6d4a34; }
.chip-btn{ border-radius: 9px; min-height: 42px; padding: 0 12px; font-size: calc(13px * var(--font-scale)); white-space: nowrap; }
.chip-btn.active{ background: var(--bg-soft); border-color: var(--gold); color: var(--brown-deep); }
.volume-box{ display: flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.volume-box svg{ width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
#volume{ width: 78px; }

.playlist-drawer{
  position: absolute; right: 20px; bottom: calc(var(--player-h) + 8px);
  width: min(380px, calc(100vw - 40px)); max-height: 340px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 36px rgba(87,59,43,.18); padding: 12px;
}
.playlist-drawer h4{ margin: 4px 6px 10px; font-size: calc(15px * var(--font-scale)); color: var(--brown-deep); }
.playlist-drawer ul{ list-style: none; margin: 0; padding: 0; }
.playlist-drawer li{
  display: flex; gap: 8px; align-items: center; padding: 9px 8px; border-radius: 8px;
  font-size: calc(13.5px * var(--font-scale)); cursor: pointer;
}
.playlist-drawer li:hover{ background: var(--bg-soft); }
.playlist-drawer li.current{ background: #f7f0e2; color: var(--brown-deep); font-weight: 600; }
.playlist-drawer li span.num{ color: var(--gold); min-width: 26px; font-family: Georgia, serif; }
.playlist-drawer li span.t{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 自适应 */
@media (max-width: 980px){
  .hero{ grid-template-columns: 260px 1fr; gap: 34px; }
  .hero h1{ font-size: calc(38px * var(--font-scale)); }
  .photo-grid{ grid-template-columns: repeat(2, 1fr); }
  .guide-grid{ grid-template-columns: 1fr; }
  .top-nav{ display: none; }
  .font-tools{ margin-left: auto; }
  .player-inner{ grid-template-columns: 48px minmax(150px, 1fr) auto; gap: 10px; }
  .now-cover{ width: 48px; height: 48px; }
  .volume-box{ display: none; }
}
@media (max-width: 680px){
  .wrap{ width: calc(100% - 24px); }
  body{ padding-bottom: calc(var(--player-h) + 86px); --player-h: 132px; }
  .header-inner{ min-height: 68px; gap: 8px; }
  .brand-text strong{ font-size: calc(17px * var(--font-scale)); }
  .brand-text small{ display: none; }
  .lotus-seal{ width: 36px; height: 36px; }
  .font-tools span{ display: none; }
  .font-tools button{ width: 30px; height: 30px; }
  .hero{ grid-template-columns: 1fr; padding: 28px 0 26px; gap: 26px; }
  .hero-photo{ max-width: 260px; margin: 0 auto; }
  .hero h1{ font-size: calc(34px * var(--font-scale)); }
  .hero-stats{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero-stats div{ min-width: 0; flex-direction: column; align-items: center; gap: 0; padding: 9px 4px; }
  .hero-stats b{ font-size: calc(25px * var(--font-scale)); }
  .hero-stats span{ white-space: nowrap; font-size: calc(12px * var(--font-scale)); }
  .section-head{ flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-note{ text-align: left; }
  .photo-grid{ grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .toolbar{ flex-direction: column; align-items: stretch; }
  .page-size{ justify-content: flex-end; }
  .category-bar{ flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .audio-item{ grid-template-columns: 40px 1fr auto; gap: 8px; padding: 8px 10px; }
  .audio-item .idx{ font-size: calc(15px * var(--font-scale)); padding-right: 4px; }
  .audio-item .dur{ display: none; }
  .row-play{ width: 42px; height: 42px; }
  .player-inner{
    grid-template-columns: 44px 1fr; grid-template-rows: auto auto;
    gap: 4px 10px; padding-top: 8px; padding-bottom: 8px;
  }
  .now-cover{ grid-row: 1; width: 44px; height: 44px; }
  .now-block{ grid-column: 2; }
  .controls{ grid-column: 1 / -1; justify-content: center; gap: 6px; }
  .chip-btn{ min-height: 38px; padding: 0 9px; }
  .icon-btn{ width: 38px; height: 38px; }
  .play-btn{ width: 46px; height: 46px; }
  .playlist-drawer{ right: 12px; bottom: calc(var(--player-h) + 6px); }
}
