/* 词源查询 · 手稿年表设计系统（前缀 wet-）
   浅色：羊皮纸 + 深棕墨 + 青铜绿 + 朱砂；深色：暗羊皮 + 暖米 + 青绿 */
.wet-page, .wet-modal, .ws-toast {
    --wet-bg: #f7f2e6; --wet-paper: #fffdf6; --wet-ink: #3a2d21; --wet-sub: #786b5b;
    --wet-brown: #4a3424; --wet-green: #4f7a61; --wet-red: #a33b2a; --wet-gold: #b89048;
    --wet-line: #e0d5bd; --wet-fill: #f1e9d6; --wet-shadow: 0 10px 28px rgba(74,52,36,.1);
    --wet-font: "Songti SC", "STSong", "Iowan Old Style", "PingFang SC", serif;
}
:root[data-theme="dark"] .wet-page, :root[data-theme="dark"] .wet-modal, :root[data-theme="dark"] .ws-toast {
    --wet-bg: #171410; --wet-paper: #221c16; --wet-ink: #ede2cf; --wet-sub: #b3a48e;
    --wet-brown: #d8b78c; --wet-green: #7fb89a; --wet-red: #ef8b76; --wet-gold: #e0bc75;
    --wet-line: #3b3227; --wet-fill: #2a221a; --wet-shadow: 0 14px 34px rgba(0,0,0,.36);
}
.wet-page { background: var(--wet-bg); color: var(--wet-ink); font-family: var(--wet-font);
    font-size: 15px; line-height: 1.85; padding-bottom: 56px; }
.wet-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wet-page .detail-breadcrumb { padding: 18px 0 0; font-size: 13px; color: var(--wet-sub); }
.wet-page .detail-breadcrumb a { color: var(--wet-brown); text-decoration: none; }
.wet-page .detail-breadcrumb .sep { margin: 0 8px; }
.wet-page b { font-weight: 700; }
.wet-kicker { font-size: 11px; letter-spacing: .17em; color: var(--wet-red); text-transform: uppercase; }

/* 首屏：手稿页 + 右侧卷轴 */
.wet-hero { display: grid; grid-template-columns: 1.45fr .6fr; gap: 24px; margin: 22px 0 26px; }
.wet-hero-copy { position: relative; padding: 30px 34px; border: 1px solid var(--wet-line); border-radius: 3px;
    background: var(--wet-paper) repeating-linear-gradient(0deg, transparent 0 31px, rgba(120,107,91,.07) 31px 32px);
    box-shadow: var(--wet-shadow); }
.wet-hero-copy::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--wet-green); }
.wet-hero h1 { font-size: clamp(25px, 3vw, 35px); line-height: 1.4; margin: 10px 0 10px; }
.wet-sub { font-size: 14.5px; color: var(--wet-sub); line-height: 2; margin: 0 0 20px; max-width: 640px; }
.wet-sub b { color: var(--wet-red); }
.wet-search { display: flex; gap: 8px; flex-wrap: wrap; }
.wet-page input, .wet-page textarea { font: inherit; color: var(--wet-ink); background: var(--wet-paper);
    border: 1px solid var(--wet-line); border-radius: 2px; padding: 10px 12px; outline: none; box-sizing: border-box; }
.wet-page input:focus, .wet-page textarea:focus { border-color: var(--wet-green); }
.wet-search input { flex: 1 1 260px; font-size: 15px; min-width: 0; }
.wet-btn { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--wet-line);
    background: var(--wet-paper); color: var(--wet-ink); border-radius: 2px; padding: 9px 14px; white-space: nowrap; }
.wet-btn:hover { border-color: var(--wet-red); }
.wet-btn--main { background: var(--wet-brown); color: #fff; border-color: var(--wet-brown); }
.wet-btn--main:hover { background: var(--wet-red); border-color: var(--wet-red); }
.wet-btn--wide { width: 100%; margin-top: 10px; }
.wet-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.wet-chip { font: inherit; font-size: 12px; cursor: pointer; background: var(--wet-fill); color: var(--wet-brown);
    border: 1px solid var(--wet-line); border-radius: 2px; padding: 3px 10px; }
.wet-chip:hover { border-color: var(--wet-red); color: var(--wet-red); }
.wet-hero-scroll { background: var(--wet-fill); border: 1px solid var(--wet-line); border-radius: 2px;
    padding: 16px 18px; align-self: stretch; box-shadow: var(--wet-shadow); }
.wet-scroll-h { font-size: 10px; letter-spacing: .14em; color: var(--wet-red); border-bottom: 1px solid var(--wet-line); padding-bottom: 8px; }
.wet-mini-chain { list-style: none; padding: 0; margin: 12px 0 0; }
.wet-mini-chain li { position: relative; padding: 0 0 14px 22px; font-size: 12.5px; line-height: 1.6; }
.wet-mini-chain li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px;
    border-radius: 50%; background: var(--wet-green); border: 2px solid var(--wet-paper); }
.wet-mini-chain li:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--wet-line); }
.wet-scroll-foot { font-size: 11px; color: var(--wet-sub); margin: 0; border-top: 1px dashed var(--wet-line); padding-top: 8px; }

/* 主体：词条手稿 + 侧栏 */
.wet-layout { display: grid; grid-template-columns: 1.55fr .7fr; gap: 20px; align-items: start; }
.wet-sheet { background: var(--wet-paper); border: 1px solid var(--wet-line); padding: 24px 28px;
    border-radius: 3px; box-shadow: var(--wet-shadow); min-width: 0; }
.wet-sheet-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
    border-bottom: 2px solid var(--wet-brown); padding-bottom: 12px; }
.wet-sheet-no { font-size: 11px; letter-spacing: .12em; color: var(--wet-red); }
.wet-sheet-h h2 { font: 700 clamp(26px, 3vw, 34px) Georgia, serif; margin: 2px 0 0; word-break: break-all; }
.wet-sheet-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.wet-era { display: inline-block; margin: 14px 0 6px; font-size: 12px; background: var(--wet-fill);
    border-left: 3px solid var(--wet-gold); padding: 4px 12px; color: var(--wet-sub); }
.wet-section-t { font-size: 13px; font-weight: 700; margin: 20px 0 10px; display: flex; align-items: baseline; gap: 10px; }
.wet-section-t span { font-weight: 400; font-size: 11px; color: var(--wet-sub); }
.wet-chain { list-style: none; margin: 0; padding: 0 0 0 8px; border-left: 2px solid var(--wet-line); }
.wet-chain li { position: relative; padding: 0 0 16px 24px; font-size: 14px; line-height: 1.8; }
.wet-chain li::before { content: ""; position: absolute; left: -8px; top: 9px; width: 12px; height: 12px;
    border: 2px solid var(--wet-green); border-radius: 50%; background: var(--wet-paper); }
.wet-chain li:last-child { padding-bottom: 0; }
.wet-chain li b { display: block; font-size: 11px; letter-spacing: .08em; color: var(--wet-red); font-weight: 400; }
.wet-parts { display: flex; gap: 8px; flex-wrap: wrap; }
.wet-part { border: 1px solid var(--wet-line); background: var(--wet-fill); border-radius: 2px;
    padding: 8px 14px; font-size: 13px; min-width: 90px; }
.wet-part span { display: block; font-size: 10px; color: var(--wet-sub); letter-spacing: .1em; }
.wet-part b { font-size: 16px; font-family: Georgia, serif; }
.wet-sense { margin-top: 14px; padding: 12px 14px; background: var(--wet-fill);
    border-left: 3px solid var(--wet-green); font-size: 14px; line-height: 1.9; }
.wet-note { font-size: 12.5px; color: var(--wet-sub); margin: 12px 0 0; }
.wet-side { display: flex; flex-direction: column; gap: 14px; }
.wet-side-card { background: var(--wet-paper); border: 1px solid var(--wet-line); border-radius: 3px;
    padding: 16px 18px; box-shadow: var(--wet-shadow); }
.wet-side-card h3 { font-size: 15px; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px dashed var(--wet-line); }
.wet-side-card h3 span { color: var(--wet-red); }
.wet-side-tip { font-size: 11.5px; color: var(--wet-sub); line-height: 1.8; margin: 0 0 10px; }
.wet-kin, .wet-star-list { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.wet-kin button { font: inherit; font-size: 12px; cursor: pointer; border: 1px solid var(--wet-line);
    background: var(--wet-fill); color: var(--wet-green); border-radius: 12px; padding: 3px 10px; }
.wet-kin button:hover { border-color: var(--wet-red); }
.wet-star-list span { background: var(--wet-fill); border-radius: 2px; padding: 2px 8px; }
.wet-side-stat div { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px dashed var(--wet-line); padding: 5px 0; }
.wet-side-stat div:last-child { border: 0; }
.wet-side-stat b { font: 700 22px Georgia, serif; color: var(--wet-brown); }
.wet-side-stat span { font-size: 11px; color: var(--wet-sub); }

/* 索引与批量 */
.wet-panel { background: var(--wet-paper); border: 1px solid var(--wet-line); border-radius: 3px;
    padding: 18px 22px; margin-top: 20px; box-shadow: var(--wet-shadow); min-width: 0; }
.wet-panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    border-bottom: 1px solid var(--wet-line); padding-bottom: 10px; margin-bottom: 12px; }
.wet-panel-h b { font-size: 16px; }
.wet-panel-h span { font-size: 11.5px; color: var(--wet-sub); }
.wet-index { display: flex; flex-wrap: wrap; gap: 6px; }
.wet-index button { font: inherit; font-size: 12px; cursor: pointer; background: var(--wet-fill); color: var(--wet-brown);
    border: 1px solid var(--wet-line); border-radius: 2px; padding: 4px 10px; }
.wet-index button.is-on, .wet-index button:hover { background: var(--wet-brown); color: #fff; }
.wet-panel textarea { width: 100%; resize: vertical; font-size: 13px; }
.wet-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wet-err { color: var(--wet-red); font-size: 12px; min-height: 18px; }
.wet-hint { font-size: 12px; color: var(--wet-sub); margin: 10px 0 0; }
.wet-table-scroll { overflow-x: auto; margin-top: 8px; }
.wet-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wet-table th, .wet-table td { padding: 8px 9px; border-bottom: 1px solid var(--wet-line); text-align: left; vertical-align: top; }
.wet-table th { background: var(--wet-fill); color: var(--wet-sub); white-space: nowrap; }
.wet-empty { text-align: center; color: var(--wet-sub); padding: 18px; }

/* 弹窗：批量完成后才出现 */
.wet-modal[hidden] { display: none !important; }
.wet-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
    background: rgba(32,24,16,.62); padding: 20px; }
.wet-modal-box { position: relative; width: min(440px, 100%); background: var(--wet-paper); color: var(--wet-ink);
    padding: 28px 30px; border-radius: 3px; border-top: 5px solid var(--wet-green); box-shadow: 0 22px 54px rgba(0,0,0,.32); }
.wet-modal-x { position: absolute; right: 12px; top: 6px; border: 0; background: none; font-size: 24px; color: var(--wet-sub); cursor: pointer; }
.wet-modal-box h2 { margin: 8px 0 10px; font-size: 22px; }
.wet-modal-box p { font-size: 14px; color: var(--wet-sub); line-height: 1.9; }
.ws-toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px); z-index: 10000;
    background: var(--wet-ink); color: var(--wet-paper); padding: 10px 20px; border-radius: 2px;
    font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; }
.ws-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ws-toast.is-err { background: var(--wet-red); color: #fff; }

@media (max-width: 960px) {
    .wet-hero, .wet-layout { grid-template-columns: 1fr; }
    .wet-hero-scroll { max-width: 100%; }
}
@media (max-width: 480px) {
    .wet-wrap { padding: 0 12px; }
    .wet-hero-copy { padding: 22px 16px; }
    .wet-sheet, .wet-panel { padding: 16px 14px; }
    .wet-sheet-h h2 { font-size: 24px; }
    .wet-table { min-width: 0; }
}

/* dark button contrast fix */
:root[data-theme="dark"] .wet-btn--main { color: #201810; }
