/* ============================================================
   一码空传 · 佛曰加密  前台样式
   温暖纸感 + 佛系金棕配色
   ============================================================ */
:root {
    --bg: #f6f1e6;
    --bg-deep: #efe6d2;
    --card: #ffffff;
    --ink: #3a2f26;
    --ink-soft: #7a6b5c;
    --gold: #c9a05c;
    --gold-deep: #a97f38;
    --line: #e7dcc7;
    --blue: #2f6fed;
    --blue-dark: #2456b8;
    --gold-btn: #e8a33c;
    --gold-btn-dark: #cf8c26;
    --red: #c0392b;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(80, 60, 30, .08);
    --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; width: 100%; }
a { color: var(--gold-deep); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.site-header {
    background: #2e2519;
    color: #f3e7cf;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: baseline; gap: 6px; color: #f3e7cf; }
.logo-icon { font-size: 22px; }
.logo-text { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.logo small { color: var(--gold); font-size: 13px; }
.main-nav { display: flex; gap: 4px; align-items: center; }
.main-nav a {
    color: #d8c9ac; padding: 8px 14px; border-radius: 8px; font-size: 14px; transition: .2s;
}
.main-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.main-nav a.active { background: var(--gold); color: #2e2519; font-weight: 600; }
.main-nav a.nav-admin { border: 1px solid rgba(201,160,92,.5); }
@media (max-width: 640px) {
    .header-inner { height: auto; flex-direction: column; padding: 10px 0; gap: 8px; }
}

/* ---------- 公告条 ---------- */
.notice-bar {
    background: #fff8e6; border-bottom: 1px solid #ecd9a8; color: #6d5a2e;
    padding: 9px 16px; font-size: 13px; display: flex; align-items: center; gap: 10px;
}
.notice-tag { background: var(--gold); color: #fff; border-radius: 4px; padding: 1px 8px; font-size: 12px; flex: none; }
.notice-content { color: #8a7a4e; }
.notice-close { margin-left: auto; border: 0; background: none; font-size: 18px; cursor: pointer; color: #9c8a5e; }

/* ---------- 面板 ---------- */
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 40px; }
.panel {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 28px; margin-bottom: 24px;
}
.panel-head { margin-bottom: 22px; }
.panel-head h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: 1px; }
.panel-head h2 em {
    font-style: normal; font-size: 13px; color: #fff; background: var(--red);
    border-radius: 6px; padding: 2px 8px; vertical-align: middle; margin-left: 6px;
}
.panel-head p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ---------- 表单 ---------- */
.seg { display: inline-flex; background: #f1e9d8; border-radius: 10px; padding: 4px; margin-bottom: 18px; gap: 4px; }
.seg-item { cursor: pointer; }
.seg-item input { display: none; }
.seg-item span {
    display: inline-block; padding: 8px 26px; border-radius: 8px; font-size: 14px; color: var(--ink-soft);
    transition: .2s; user-select: none;
}
.seg-item.active span { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 6px rgba(80,60,30,.12); }

.field { margin-bottom: 16px; position: relative; }
.field.half { width: calc(50% - 8px); }
.field-row { display: flex; gap: 16px; }
@media (max-width: 640px) { .field-row { flex-direction: column; } .field.half { width: 100%; } }

.flabel { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.input {
    width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
    font-size: 14px; background: #fdfbf6; color: var(--ink); outline: none; transition: .2s;
}
.input:focus { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(201,160,92,.18); }
textarea.input, textarea { font-family: var(--serif); line-height: 1.7; resize: vertical; }
.counter { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: #b7a887; background: rgba(253,251,246,.9); padding: 0 4px; }

/* 文件上传 */
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 2px dashed var(--line); border-radius: 12px; padding: 28px; cursor: pointer;
    background: #fdfbf6; transition: .2s; text-align: center;
}
.dropzone:hover { border-color: var(--gold); background: #fffaf0; }
.dz-icon { font-size: 30px; margin-bottom: 8px; }
.dz-text { font-size: 14px; color: var(--ink-soft); }
.file-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-top: 10px; color: var(--ink-soft); }
.img-preview { max-width: 100%; max-height: 260px; border-radius: 10px; margin-top: 12px; border: 1px solid var(--line); }

/* 多内容页：编辑区 + 实时预览 */
.page-editor { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.page-edit-item { background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.page-edit-item textarea { width: 100%; min-height: 84px; box-sizing: border-box; }
.dz-sm { padding: 16px 10px; }
.dz-sm .dz-icon { font-size: 22px; margin-bottom: 4px; }
.media-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.media-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.mi-icon { flex-shrink: 0; }
.mi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-size { color: var(--ink-soft); white-space: nowrap; font-size: 12px; }
.mi-del { flex-shrink: 0; }
.preview-panel { margin-top: 16px; border: 2px dashed var(--gold); border-radius: 14px; background: #fff; overflow: hidden; }
.preview-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed var(--line); background: #fffaf0; }
.preview-tip { font-size: 12px; color: var(--ink-soft); }
.preview-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.preview-empty { color: var(--ink-soft); text-align: center; padding: 22px 0; font-size: 14px; }
.preview-text { font-family: var(--serif); font-size: 16px; line-height: 2; word-break: break-word; }
.preview-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.preview-img { flex: 1 1 120px; max-width: 180px; }
.preview-img img { width: 100%; border-radius: 10px; display: block; object-fit: cover; aspect-ratio: 1/1; }
.preview-audios, .preview-videos { display: flex; flex-direction: column; gap: 12px; }
.preview-audios p, .preview-videos div { display: flex; flex-direction: column; gap: 4px; }
.preview-audios audio, .preview-videos video { width: 100%; border-radius: 10px; background: #000; }
.preview-fname { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
    .page-editor { grid-template-columns: 1fr; }
    .preview-img { max-width: none; flex-basis: calc(50% - 5px); }
}

/* 查看页：多内容页图片画廊 */
.view-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.view-gallery .view-image { margin: 0; max-width: calc(50% - 5px); }
@media (max-width: 720px) {
    .view-gallery .view-image { max-width: 100%; }
}

/* 按钮 */
.btn {
    display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
    border-radius: 9px; padding: 9px 18px; font-size: 14px; cursor: pointer; transition: .2s;
    text-align: center;
}
.btn:hover { border-color: var(--gold); }
.btn-primary { background: linear-gradient(180deg, #d3a85f, var(--gold-deep)); border: 0; color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-blue { background: linear-gradient(180deg, #4a86f0, var(--blue-dark)); border: 0; color: #fff; font-weight: 600; }
.btn-blue:hover { filter: brightness(1.08); }
.btn-gold { background: linear-gradient(180deg, #f0b95c, var(--gold-btn-dark)); border: 0; color: #fff; font-weight: 600; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-danger { background: linear-gradient(180deg, #d9534f, #b93a36); border: 0; color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-lg { width: 100%; padding: 13px; font-size: 15px; border-radius: 11px; margin-top: 4px; }
.btn-mini { padding: 5px 12px; font-size: 13px; border-radius: 7px; }
.form-err { color: var(--red); font-size: 13px; margin-top: 10px; }

/* ---------- 分享结果 ---------- */
.share-result { margin-top: 24px; border-top: 1px dashed var(--line); padding-top: 22px; text-align: center; }
.share-result h3 { color: #2d6a2f; margin: 0 0 14px; }
.qr-box { display: inline-block; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr-box img { display: block; width: 220px; height: 220px; image-rendering: pixelated; }
.link-row { display: flex; gap: 8px; margin: 14px auto 0; max-width: 480px; }
.link-row .input { flex: 1; }
.result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.tip { font-size: 12px; color: #a08f70; margin-top: 12px; }

/* ---------- 佛曰加密 ---------- */
.crypt-wrap { max-width: 640px; margin: 0 auto; }
.crypt-title { text-align: center; margin-bottom: 20px; }
.crypt-title h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: 3px; font-family: var(--serif); }
.crypt-title p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.crypt-btns { display: flex; gap: 14px; margin: 18px 0; }
.crypt-btns .btn { flex: 1; }
.crypt-actions { display: flex; gap: 10px; }
#cryptOutput { background: #fbf6e9; }

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(40,30,15,.55); z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
    background: #fffdf7; border-radius: var(--radius); max-width: 520px; width: 100%;
    padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 85vh; overflow: auto;
}
.modal h3 { margin: 0 0 14px; font-size: 19px; font-family: var(--serif); letter-spacing: 1px; }
.modal ol { padding-left: 20px; line-height: 1.9; font-size: 14px; color: var(--ink); }
.modal li { margin-bottom: 6px; }
.modal .btn { width: 100%; margin-top: 8px; }

/* ---------- 查看页 ---------- */
.view-wrap { padding-top: 40px; }
.view-card { padding: 30px; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.badge-burn { background: var(--red); color: #fff; font-size: 12px; border-radius: 6px; padding: 3px 10px; }
.view-time { font-size: 12px; color: var(--ink-soft); }
.view-text { font-family: var(--serif); font-size: 16px; line-height: 2; white-space: pre-wrap; word-break: break-word; }
.view-image { max-width: 100%; border-radius: 10px; display: block; margin: 0 auto; }
.view-media { width: 100%; max-width: 640px; display: block; margin: 0 auto; border-radius: 10px; background: #000; }
.view-pdf { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.view-txt { background: #fdfbf6; border: 1px solid var(--line); border-radius: 10px; padding: 16px; max-height: 460px; overflow: auto; }
.view-txt pre { margin: 0; font-family: var(--serif); line-height: 1.8; font-size: 14px; white-space: pre-wrap; word-break: break-all; }
.view-dl { text-align: center; margin-top: 14px; }
.file-card {
    display: flex; align-items: center; gap: 14px; background: #fdfbf6; border: 1px solid var(--line);
    border-radius: 12px; padding: 18px;
}
.file-icon { font-size: 34px; }
.file-info { flex: 1; min-width: 0; }
.file-info b { display: block; font-size: 14px; word-break: break-all; }
.file-info span { font-size: 12px; color: var(--ink-soft); }
.view-burn-tip { margin-top: 22px; padding: 12px; background: #fdf3ee; color: #a0562f; border-radius: 10px; font-size: 13px; text-align: center; }
.view-mkv-tip { margin: 8px auto 0; max-width: 640px; font-size: 12px; color: #b06f00; background: #fff7e8; border-radius: 8px; padding: 8px 12px; }
.view-empty { color: var(--ink-soft); text-align: center; }

/* 音乐自动播放悬浮按钮 */
#musicFab {
    position: fixed; right: 18px; bottom: 24px; z-index: 999;
    border: none; border-radius: 999px; padding: 12px 18px; font-size: 13px;
    background: rgba(120, 88, 42, .92); color: #fff; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.22); max-width: 78vw;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent; transition: .2s;
}
#musicFab:active { transform: scale(.96); }

/* 密码门 */
.pwd-gate { padding-top: 60px; max-width: 440px; }
.pwd-card { text-align: center; }
.pwd-card h2 { margin: 0 0 8px; }
.pwd-card p { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }

/* 焚毁页（后台可配置文字/图片，默认空白） */
.burn-body { background: #fff; }
.burn-page {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; padding: 24px 16px; text-align: center;
}
.burn-img {
    display: block;
    max-width: calc(100vw - 32px);
    max-height: 60vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}
.burn-text { font-family: var(--serif); font-size: 16px; line-height: 2; color: var(--ink); white-space: pre-wrap; word-break: break-word; max-width: 640px; }

/* 禁用态（焚毁方式互斥时未选中的选项） */
select.input:disabled { background: #f1ebdc; color: #b7a887; cursor: not-allowed; }

/* ---------- 页脚 ---------- */
.site-footer { background: #2e2519; color: #9c8a6a; padding: 18px 0; text-align: center; font-size: 13px; margin-top: 20px; }
.site-footer .footer-links { margin-top: 6px; font-size: 12px; }
.site-footer .footer-links a { color: #9c8a6a; text-decoration: none; }
.site-footer .footer-links a:hover { color: #c9b48a; text-decoration: underline; }
