/* 艺廊（art.qianlong.wiki）样式。骨架照搬书单站的深色主题（顶栏、区块、卡片、横向栏、搜索、页脚），
   另加画框卡片、作品详情、诗词排版。CSP 不许 style=""，所有样式都在这里。 */
:root {
  --bg: #0f0e0c;
  --bg2: #17150f;
  --bg3: #221f18;
  --line: #2f2a20;
  --text: #ece6da;
  --text2: #bdb4a3;
  --muted: #8a8172;
  --accent: #d9a94e;
  --accent2: #f0cd85;
  --link: #e4bf78;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 var(--font); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent2); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 24px; min-height: 60vh; }
.dorig, .st, .facts dd, .bio, .ct, .winfo h1, .phead h1 { overflow-wrap: anywhere; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15, 14, 12, .9); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.hbar { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; letter-spacing: .12em; flex-shrink: 0; font-family: var(--serif); }
.brand img { border-radius: 7px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 6px 10px; border-radius: 6px; color: var(--text2); white-space: nowrap; font-size: 14.5px; }
.nav a:hover { background: var(--bg3); color: var(--text); }
.nav a.on { color: var(--accent); background: rgba(217, 169, 78, .1); }
.hsearch { margin-left: auto; }
.hsearch input, .sbox input[type=search], .filters input[type=search] {
  width: 250px; height: 36px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); padding: 0 16px; font: inherit; font-size: 14px; outline: none;
}
.hsearch input:focus, .sbox input:focus, .filters input:focus { border-color: var(--accent); }
@media (max-width: 860px) {
  .hbar { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px 6px; }
  .brand { font-size: 17px; gap: 6px; }
  .nav { flex: 1; min-width: 0; }
  .nav a { padding: 6px 6px; font-size: 14px; }
  .hsearch { order: 3; width: 100%; margin: 0; }
  .hsearch input { width: 100%; }
}

/* ---------- 首页大图 ---------- */
.hero { position: relative; margin: -24px -16px 8px; padding: 80px 16px 64px; overflow: hidden; }
.wall {
  position: absolute; inset: -40px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px;
  opacity: .28; transform: rotate(-4deg) scale(1.12); filter: saturate(.8);
}
.wall img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(15, 14, 12, .45), rgba(15, 14, 12, .97) 72%); }
.hero-in { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: 52px; letter-spacing: .2em; font-family: var(--serif); }
.hero p { color: var(--text2); margin: 12px 0 28px; font-size: 16px; }
.bigsearch { display: flex; gap: 8px; max-width: 580px; margin: 0 auto; }
.bigsearch input {
  flex: 1; min-width: 0; height: 46px; border-radius: 23px; border: 1px solid var(--line); background: rgba(23, 21, 15, .9);
  color: var(--text); padding: 0 20px; font: inherit; font-size: 15px; outline: none;
}
.bigsearch input:focus { border-color: var(--accent); }
.bigsearch .btn { margin: 0; height: 46px; border-radius: 23px; padding: 0 22px; }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
@media (max-width: 560px) { .hero h1 { font-size: 38px; } .wall { grid-template-columns: repeat(5, 1fr); } }

/* ---------- 区块 ---------- */
.sec { margin: 44px 0; }
.sech { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sech h2 { font-size: 21px; position: relative; padding-left: 13px; }
.sech h2::before { content: ""; position: absolute; left: 0; top: .22em; bottom: .22em; width: 4px; border-radius: 2px; background: var(--accent); }
.more { color: var(--muted); font-size: 14px; white-space: nowrap; }
.phead { margin: 12px 0 24px; }
.phead h1 { font-size: 30px; }
.phead p { color: var(--text2); margin: 8px 0 0; max-width: 820px; }
.phead p a { color: var(--link); }
.phead .crumb { font-size: 14px; margin: 0 0 4px; color: var(--muted); }
.phead .crumb a:hover { color: var(--accent2); }
.hint { font-size: 13.5px; color: var(--muted); margin: 10px 0; }
.hint a { color: var(--link); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.two .sec { margin-bottom: 0; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 0; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.toolbar .btn { margin-top: 0; }
.toolbar.center { justify-content: center; margin-top: 18px; }

/* ---------- 按钮、标签 ---------- */
.btn {
  display: inline-block; margin-top: 18px; padding: 9px 18px; border-radius: 20px; border: 1px solid var(--accent);
  color: #1a1408; background: var(--accent); font: inherit; font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--accent2); color: #1a1408; }
.btn.ghost { background: transparent; color: var(--accent); font-weight: 400; }
.btn.ghost:hover { background: rgba(217, 169, 78, .1); color: var(--accent2); }
.btn[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 18px; background: var(--bg2); border: 1px solid var(--line); font-size: 14px; }
.chip span { color: var(--muted); font-size: 12px; }
.chip:hover { border-color: var(--accent); }
.tag { padding: 2px 10px; border-radius: 14px; border: 1px solid var(--line); font-size: 13px; color: var(--text2); }
a.tag:hover { border-color: var(--accent); }
.rks { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.rk { display: inline-block; font-size: 12.5px; padding: 0 9px; line-height: 23px; border-radius: 4px; border: 1px solid var(--line); color: var(--text2); white-space: nowrap; }
.rk:hover { border-color: var(--accent); }
.loading { padding: 32px 0; color: var(--muted); }
.loadmore { text-align: center; }

/* ---------- 画框卡片 ---------- */
.grid.art { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 18px; }
.grid.art.wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.scroller {
  display: grid; grid-auto-flow: column; grid-auto-columns: 170px; gap: 18px;
  overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.scroller.wide { grid-auto-columns: 240px; }
.scroller .card { scroll-snap-align: start; }
.card { display: block; min-width: 0; }
.frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 3px; overflow: hidden; background: var(--bg3);
  box-shadow: 0 0 0 5px #1c1912, 0 0 0 6px #3a3222, 0 8px 22px rgba(0, 0, 0, .5);
  margin: 6px;
}
.wide .frame { aspect-ratio: 3 / 2; }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .frame img { transform: scale(1.04); }
.noimg {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; padding: 12px;
  text-align: center; color: var(--muted); font-size: 13.5px; background: repeating-linear-gradient(45deg, #1d1a14, #1d1a14 10px, #201d16 10px, #201d16 20px);
}
.noimg b { color: var(--text2); font-weight: 600; }
.noimg small { font-size: 12px; }
.noimg.big { min-height: 320px; border-radius: 6px; }
.ct { margin-top: 12px; font-weight: 600; font-size: 14.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm { color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .grid.art { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .grid.art.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scroller { grid-auto-columns: 132px; gap: 12px; }
  .scroller.wide { grid-auto-columns: 190px; }
}

/* ---------- 横向栏箭头（同书单站） ---------- */
.rail { position: relative; }
.rail-btn {
  position: absolute; z-index: 3; top: 110px; transform: translateY(-50%); width: 38px; height: 38px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(15, 14, 12, .85); color: var(--text); font: 700 22px/1 var(--font); cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.rail-btn:hover { border-color: var(--accent); color: var(--accent2); }
.rail-prev { left: 4px; }
.rail-next { right: 4px; }
.rail.rail-active .rail-btn:not(:disabled) { opacity: .55; pointer-events: auto; }
.rail.rail-active:hover .rail-btn:not(:disabled), .rail.rail-active:focus-within .rail-btn:not(:disabled) { opacity: 1; }
.rail-btn:disabled { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .rail.rail-active .rail-btn:not(:disabled) { opacity: .8; } }

/* ---------- 作品详情 ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 860px) { .work { grid-template-columns: 1fr; gap: 20px; } }
.artimg { margin: 0; position: sticky; top: 76px; }
@media (max-width: 860px) { .artimg { position: static; } }
.artimg img { margin: 0 auto; max-height: 78vh; width: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); border-radius: 2px; background: var(--bg3); }
.artimg figcaption { font-size: 12.5px; color: var(--muted); margin-top: 10px; text-align: center; overflow-wrap: anywhere; }
.artimg figcaption a { color: var(--text2); text-decoration: underline; text-decoration-color: var(--line); }
.zoom { cursor: zoom-in; display: block; }
.winfo h1 { font-size: 30px; font-family: var(--serif); }
.dorig { color: var(--text2); margin: 6px 0 0; font-style: italic; }
.ddesc { color: var(--muted); margin: 8px 0 0; }
.facts { margin: 20px 0; display: grid; gap: 8px; }
.facts div { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts a, .bio a, .extlinks a, .prose a, .pfacts a { color: var(--link); }
.bio { max-width: 820px; line-height: 1.85; font-size: 15px; color: var(--text2); margin: 18px 0; }
.bio p { margin: 0 0 .8em; }
.bio .src { font-size: 12.5px; color: var(--muted); }
.bio.classic { border-left: 3px solid var(--line); padding-left: 14px; }
.bio h3 { font-size: 15px; color: var(--text); margin-bottom: 6px; }
.extlinks { font-size: 14px; color: var(--muted); }
.ahead { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.ahead:not(:has(figure)) { grid-template-columns: 1fr; }
@media (max-width: 700px) { .ahead { grid-template-columns: 1fr; } }
.ahead h1 { font-size: 32px; font-family: var(--serif); }
.ameta { color: var(--text2); margin: 8px 0 0; }
.portrait, .mphoto { margin: 0; }
.portrait img { width: 100%; border-radius: 6px; box-shadow: 0 6px 22px rgba(0, 0, 0, .5); }
.mphoto img { width: 100%; border-radius: 6px; }
.portrait figcaption, .mphoto figcaption { font-size: 11.5px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.portrait figcaption a, .mphoto figcaption a { text-decoration: underline; }
.wlist { list-style: none; padding: 0; margin: 0; columns: 3 260px; column-gap: 28px; }
.wlist li { break-inside: avoid; padding: 4px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; justify-content: space-between; }
.wlist span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5, 5, 4, .94); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lbclose { position: absolute; top: 12px; right: 16px; font-size: 32px; background: none; border: 0; color: var(--text); cursor: pointer; }

/* ---------- 筛选栏（画库） ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 24px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); }
.filters select { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg3); color: var(--text); padding: 0 8px; font: inherit; font-size: 14px; }
.filters input[type=search] { width: 220px; height: 34px; }
.fcount { color: var(--muted); font-size: 13.5px; margin-left: auto; }
@media (max-width: 560px) { .filters input[type=search] { width: 100%; } .fcount { margin-left: 0; } }

/* ---------- 诗词 ---------- */
.poem { max-width: 760px; margin: 0 auto; }
.poem .phead { text-align: center; }
.poem .phead h1 { font-family: var(--serif); font-size: 34px; letter-spacing: .06em; }
.pfacts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; color: var(--text2); margin-top: 10px; font-size: 14.5px; }
.poemtext { font-family: var(--serif); font-size: 21px; line-height: 2.1; text-align: center; margin: 28px 0; letter-spacing: .04em; }
.poemtext p { margin: 0 0 .25em; }
.poem .rks { justify-content: center; }
.poem .extlinks { text-align: center; }
.pnav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin: 24px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.pnav a:first-child { color: var(--text2); }
.pnav a:nth-child(2) { color: var(--accent); }
.pnav a:last-child { text-align: right; color: var(--text2); }
.plist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 28px; }
.plist li { padding: 7px 0; border-bottom: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.plist li > a { font-weight: 600; }
.plist .pla { color: var(--muted); font-size: 13px; }
.plist .plf { color: var(--muted); font-size: 13px; flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); }
.plist.cols { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pcard { display: block; padding: 18px 20px; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--line); }
.pcard:hover { border-color: var(--accent); color: inherit; }
.pcard h3 { font-family: var(--serif); font-size: 19px; }
.pca { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.pct { font-family: var(--serif); color: var(--text2); line-height: 1.9; font-size: 15.5px; }
.pct p { margin: 0; }
.daily .pcard { padding: 22px 24px; }

/* ---------- 随机 ---------- */
.stabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 20px; scrollbar-width: none; }
.stabs::-webkit-scrollbar { display: none; }
.stabs a { padding: 6px 14px; border-radius: 18px; border: 1px solid var(--line); white-space: nowrap; font-size: 14px; color: var(--text2); }
.stabs a.on { border-color: var(--accent); color: var(--accent); }
.rpick { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.rpick img { max-height: 72vh; width: auto; margin: 0 auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.rpick h2 { font-family: var(--serif); font-size: 28px; }
.rpick p { color: var(--text2); }
@media (max-width: 760px) { .rpick { grid-template-columns: 1fr; } }

/* ---------- 搜索 ---------- */
.sbox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.sbox input[type=search] { flex: 1; min-width: 220px; width: auto; height: 42px; border-radius: 21px; font-size: 15px; }
.sbox .btn { margin: 0; }
.chk { color: var(--text2); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.sgroup { font-size: 15px; color: var(--text2); margin: 22px 0 10px; }
.shead { color: var(--muted); font-size: 14px; margin: 18px 0 10px; }
.slist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
@media (max-width: 560px) { .slist { grid-template-columns: 1fr; } }
.sitem a { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; padding: 8px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); align-items: center; }
.sitem a:hover { border-color: var(--accent); color: inherit; }
.sitem img, .sitem .ph { width: 54px; height: 64px; object-fit: cover; border-radius: 4px; background: var(--bg3); }
.sitem .ph { display: flex; align-items: center; justify-content: center; color: var(--accent); font-family: var(--serif); font-size: 20px; }
.st { font-weight: 600; }
.st .kind { font-size: 11.5px; font-weight: 400; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.so { font-size: 13px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm { font-size: 12.5px; color: var(--muted); display: flex; gap: 4px 10px; flex-wrap: wrap; margin-top: 2px; }

/* ---------- 关于 ---------- */
.prose { max-width: 820px; color: var(--text2); }
.prose h2 { font-size: 20px; color: var(--text); margin: 28px 0 10px; }
.prose li { margin: 6px 0; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 36px; color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.site-footer a { color: var(--text2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.attr p { margin: 6px 0; }
.fnav { margin: 14px 0 0; }
