/* ============================================
   全唐诗大典 - 古诗文网 全局样式
   ============================================ */

/* ===== 主题变量 ===== */
:root {
    --bg-primary: #f7f4ec;
    --bg-card: #ffffff;
    --bg-soft: #faf7ec;
    --accent: #f0a83a;
    --accent-hover: #e0962f;
    --accent-soft: #fdf3e3;
    --accent-text: #b45309;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f0f0f0;
    --success: #16a34a;
    --danger: #dc2626;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.7;
}

a { color: var(--accent-text); }
a:hover { color: var(--accent); }

/* ===== 顶部导航 ===== */
.top-bar {
    background: #1c1917;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.top-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: #f5f5f5;
    text-decoration: none;
    letter-spacing: 1px;
}
.logo-icon { font-size: 22px; }
.main-nav { display: flex; gap: 4px; }
.main-nav a {
    color: #c9c9c9;
    text-decoration: none;
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.main-nav a.active { color: var(--accent); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.premium-badge {
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #7c2d12;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.btn-login {
    background: transparent;
    border: 1px solid #555;
    color: #ddd;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-login:hover { border-color: var(--accent); color: var(--accent); }
.btn-app {
    background: var(--accent);
    color: #1c1917;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-app:hover { background: var(--accent-hover); color: #1c1917; }

/* ===== 搜索栏 ===== */
.search-section {
    background: linear-gradient(135deg, #2d2a26, #1c1917);
    padding: 28px 24px;
}
.search-box {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.search-type { display: flex; border-right: 1px solid var(--border); background: #fafafa; }
.search-type a {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
}
.search-type a.active { color: var(--accent-text); font-weight: 600; background: var(--accent-soft); }
.search-input-wrap { flex: 1; display: flex; }
.search-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 16px;
    font-size: 14px;
    font-family: inherit;
}
.btn-search {
    background: var(--accent);
    border: none;
    color: #1c1917;
    font-size: 14px;
    font-weight: 600;
    padding: 0 24px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-search:hover { background: var(--accent-hover); }

/* ===== 主内容布局 ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}
.content-left { min-width: 0; }
.content-right { display: flex; flex-direction: column; gap: 20px; }

/* ===== 卡片通用 ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-title .more { font-size: 13px; font-weight: 400; color: var(--text-muted); text-decoration: none; }

/* ===== 每日推荐 ===== */
.featured-card {
    background: linear-gradient(135deg, #2d2a26, #1c1917);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}
.featured-inner { padding: 32px; }
.featured-poem-title {
    color: #f5f5f5;
    font-size: 28px;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: 2px;
}
.featured-meta {
    text-align: center;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.featured-meta .dynasty { color: #aaa; font-size: 14px; }
.featured-meta .author { color: var(--accent); font-size: 15px; }
.featured-body {
    color: #e5e5e5;
    text-align: center;
    line-height: 2.2;
    font-size: 16px;
    white-space: pre-line;
    margin-bottom: 20px;
}
.featured-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.btn-action {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #eee;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-action:hover { background: var(--accent); color: #1c1917; border-color: var(--accent); }

/* ===== 诗词卡片 ===== */
.poem-cards { display: flex; flex-direction: column; gap: 16px; }
.poem-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 20px 24px;
    transition: all 0.2s;
    cursor: pointer;
}
.poem-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--accent); }
.poem-card-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.poem-card-meta { font-size: 13px; color: var(--text-secondary); margin: 6px 0 10px; }
.poem-card-meta .dynasty { color: var(--text-muted); }
.poem-card-body {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.poem-card-tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 12px;
}

/* ===== 名句 ===== */
.quote-list { display: flex; flex-direction: column; gap: 12px; }
.quote-item {
    padding: 14px 16px;
    background: var(--bg-soft);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.22s;
}
.quote-item:hover {
    background: var(--accent-soft);
    border-left-color: #b45309;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}
.quote-content { font-size: 15px; color: var(--text-primary); margin-bottom: 6px; }
.quote-source { font-size: 12px; color: var(--text-muted); text-align: right; }

/* ===== 古籍 ===== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.book-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}
.book-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.book-icon { font-size: 32px; margin-bottom: 8px; }
.book-title { font-size: 14px; font-weight: 600; }
.book-dynasty { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== 字词 ===== */
.word-list { display: flex; flex-direction: column; gap: 10px; }
.word-item { padding: 12px 16px; background: var(--bg-soft); border-radius: var(--radius); }
.word-item .word { font-weight: 700; color: var(--accent-text); margin-right: 8px; }
.word-item .def { color: var(--text-secondary); font-size: 14px; }

/* ===== 侧栏 ===== */
.side-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow);
}
.side-card h3 {
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}
.side-link { display: block; padding: 8px 0; color: var(--text-secondary); text-decoration: none; font-size: 14px; border-bottom: 1px dashed var(--border-light); }
.side-link:hover { color: var(--accent-text); }
.side-link:last-child { border-bottom: none; }

/* ===== 登录注册 ===== */
.login-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, #f7f4ec, #f0ead8);
}
.login-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 400px;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
}
.login-box h2 { text-align: center; margin-bottom: 24px; color: var(--text-primary); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }
.error-msg {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}
.btn-primary {
    background: var(--accent);
    border: none;
    color: #1c1917;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-cancel {
    background: var(--border);
    border: none;
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ===== 网格卡片 ===== */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.grid-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.grid-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.grid-card h3 { font-size: 16px; margin-bottom: 6px; }
.grid-card .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.grid-card p { font-size: 13px; color: var(--text-secondary); }

/* ===== 详情页 ===== */
.detail-page { max-width: 1180px; margin: 0 auto; padding: 24px; }
.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.poem-detail {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 32px;
    box-shadow: var(--shadow);
}
.poem-detail h1 { text-align: center; font-size: 28px; margin-bottom: 10px; }
.poem-detail .meta { text-align: center; color: var(--text-secondary); margin-bottom: 24px; }
.poem-detail .content {
    text-align: center;
    line-height: 2.4;
    font-size: 16px;
    white-space: pre-line;
    margin-bottom: 16px;
}
.poem-detail .tags { text-align: center; margin-bottom: 20px; }
.poem-detail .actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.related { margin-top: 24px; }

/* 详情页右侧栏 */
.detail-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; }
.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 18px;
    box-shadow: var(--shadow);
}
.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-text);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { margin-bottom: 0; }
.sidebar-link {
    display: flex;
    flex-direction: column;
    padding: 9px 4px;
    border-bottom: 1px dashed var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: all 0.18s;
    border-radius: 4px;
}
.sidebar-link:hover { background: var(--bg-soft); padding-left: 8px; }
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 2px;
}
.sidebar-link-meta {
    font-size: 11px;
    color: var(--text-muted);
}
.sidebar-quote {
    color: var(--accent-text);
    font-weight: 500;
    font-style: italic;
}
.sidebar-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 600;
}
.sidebar-more:hover { text-decoration: underline; }

/* 热门排行带数字 */
.sidebar-rank .sidebar-link {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.sidebar-rank-num {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 4px;
    background: var(--bg-soft);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-rank .sidebar-link:nth-child(1) .sidebar-rank-num { background: #dc2626; color: #fff; }
.sidebar-rank .sidebar-link:nth-child(2) .sidebar-rank-num { background: #ea580c; color: #fff; }
.sidebar-rank .sidebar-link:nth-child(3) .sidebar-rank-num { background: #ca8a04; color: #fff; }
.sidebar-rank .sidebar-link .sidebar-link-title { margin-bottom: 0; }

/* 作者卡片 */
.sidebar-author-link { text-decoration: none; display: block; margin-bottom: 8px; }
.sidebar-author-name { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.sidebar-author-dynasty { font-size: 12px; color: var(--text-muted); }
.sidebar-author-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 8px;
}

/* ===== 下载支付选择弹窗 ===== */
.dlg-mask {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(28, 25, 23, 0.55);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    animation: dlg-fade 0.18s ease;
}
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
.dlg-box {
    background: var(--bg-card);
    border-radius: 16px;
    width: 420px; max-width: 92%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
    animation: dlg-pop 0.22s ease;
}
@keyframes dlg-pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dlg-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px; font-weight: 700; font-size: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}
.dlg-close {
    background: none; border: none; font-size: 24px; cursor: pointer;
    color: var(--text-secondary); line-height: 1; padding: 0; width: 28px; height: 28px;
    border-radius: 50%;
}
.dlg-close:hover { background: rgba(0,0,0,0.08); }
.dlg-body { padding: 18px 22px 22px; }
.dlg-option {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; margin-bottom: 10px;
    border: 2px solid var(--border-light);
    border-radius: 12px; text-decoration: none;
    transition: all 0.2s;
    background: var(--bg-card);
    color: inherit;
}
.dlg-option:last-child { margin-bottom: 0; }
.dlg-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.15);
    border-color: var(--accent);
}
.dlg-single:hover { border-color: #d97706; box-shadow: 0 8px 20px rgba(217, 119, 6, 0.18); }
.dlg-member {
    border-color: #dc2626;
    background: linear-gradient(135deg, #fef2f2, #fff);
}
.dlg-member:hover { border-color: #b91c1c; box-shadow: 0 8px 20px rgba(220, 38, 38, 0.18); }
.dlg-opt-icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    border-radius: 12px;
    color: #fff; font-weight: 800; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.dlg-opt-body { flex: 1; }
.dlg-opt-title {
    font-size: 15px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 3px; display: flex; align-items: center; gap: 6px;
}
.dlg-opt-desc { font-size: 12px; color: var(--text-secondary); }
.dlg-best {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff; padding: 1px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
}
@media (max-width: 480px) {
    .dlg-box { width: 96%; }
    .dlg-head { padding: 14px 16px; font-size: 14px; }
    .dlg-body { padding: 14px 14px 18px; }
    .dlg-option { padding: 12px 14px; }
    .dlg-opt-icon { width: 40px; height: 40px; font-size: 12px; }
    .dlg-opt-title { font-size: 14px; }
}

/* ===== 顶部编辑面板（编辑器工具栏永远可见） ===== */
.edit-panel {
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.12);
    display: block !important;
    overflow: visible;
}
.edit-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 2px solid var(--accent);
}
.edit-panel-head h3 { margin: 0; font-size: 18px; color: #92400e; font-weight: 800; letter-spacing: 0.5px; }
.btn-cancel-sm {
    background: #fff;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.btn-cancel-sm:hover { background: var(--bg-soft); }
.edit-panel form { padding: 20px; }
.edit-panel .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 768px) {
    .edit-panel .form-row { grid-template-columns: 1fr; gap: 0; }
}

/* ===== 会员页 ===== */
.premium-hero {
    background: linear-gradient(135deg, #1c1917, #44403c);
    color: #fff;
    text-align:  center;
    padding: 60px 24px;
    text-align: center;
}
.premium-hero h1 { font-size: 32px; margin-bottom: 12px; }
.premium-hero .sub { color: #bbb; }
.plan-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    padding: 40px 24px;
}
.plan-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 28px;
    text-align: center;
    transition: all 0.2s;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card.featured { border: 2px solid var(--accent); }
.plan-card .plan-name { font-size: 18px; font-weight: 700; }
.plan-card .plan-price { font-size: 32px; color: var(--accent); margin: 12px 0; }
.plan-card .plan-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.plan-card ul { list-style: none; text-align: left; font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.plan-card li { padding: 4px 0; }
.plan-card li::before { content: "✓ "; color: var(--success); }

/* ===== 管理后台 ===== */
.admin-body { background: #f3f4f6; }
.admin-layout { display: flex; max-width: 1400px; margin: 0 auto; }
.admin-sidebar {
    width: 200px;
    background: #1c1917;
    padding: 16px 0;
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-sidebar a {
    color: #c9c9c9;
    text-decoration: none;
    padding: 10px 20px;
    font-size: 14px;
    transition: all 0.2s;
}
.admin-sidebar a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.admin-sidebar a.active { color: var(--accent); background: rgba(240,168,58,0.1); font-weight: 600; }
.admin-main { flex: 1; padding: 24px; }
.admin-main h2 { margin-bottom: 20px; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-num { font-size: 32px; font-weight: 700; color: var(--accent-text); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.admin-table-wrap { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border-light); overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); text-align: left; }
.admin-table th { background: #fafafa; font-weight: 600; color: var(--text-secondary); }
.admin-table tr:hover { background: #fafafa; }
.btn-sm { background: var(--accent-soft); border: 1px solid var(--border); color: var(--text-primary); padding: 4px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.btn-sm-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.actions { white-space: nowrap; }

/* ===== 弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 720px;
    max-width: 95%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
@media (max-width: 768px) {
    .modal-box { width: 95%; padding: 18px; }
}
/* 编辑器在模态框里的样式 */
.w-e-toolbar { flex-wrap: wrap !important; }
.w-e-toolbar .w-e-bar-item, .w-e-toolbar .w-e-select { margin-bottom: 2px; }
.w-e-text-container { min-height: 140px !important; }
.modal-box h3 { margin-bottom: 20px; }

/* ===== 页脚 ===== */
.footer {
    background: #1c1917;
    color: #9ca3af;
    margin-top: 40px;
    padding: 32px 24px;
    font-size: 13px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer a { color: #9ca3af; text-decoration: none; margin-right: 12px; }
.footer a:hover { color: var(--accent); }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .main-content { grid-template-columns: 1fr; }
    .main-nav a { padding: 6px 10px; font-size: 13px; }
    .search-type a { padding: 10px 12px; font-size: 12px; }
    .grid-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; flex-wrap: wrap; padding: 8px 12px; gap: 4px; }
    .admin-sidebar a { padding: 8px 14px; font-size: 13px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-main { padding: 20px 16px; }
    .book-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ===== 移动端适配（≤768px）===== */
@media (max-width: 768px) {
    /* 顶部导航：汉堡菜单 */
    .top-bar-inner { height: 52px; padding: 0 12px; }
    .logo { font-size: 17px; }
    .main-nav {
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        background: #1c1917;
        flex-direction: column;
        padding: 8px 12px;
        gap: 2px;
        display: none;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
        z-index: 99;
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px 16px; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .main-nav a:last-child { border-bottom: none; }
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 36px;
        height: 36px;
        padding: 8px;
        background: transparent;
        border: none;
        cursor: pointer;
    }
    .nav-toggle span {
        display: block;
        height: 2px;
        width: 100%;
        background: #ddd;
        border-radius: 2px;
        transition: all 0.3s;
    }
    .nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.active span:nth-child(2) { opacity: 0; }
    .nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .top-actions .btn-login, .top-actions .btn-app { padding: 5px 12px; font-size: 12px; }

    /* 搜索栏 */
    .search-section { padding: 16px 12px; }
    .search-input-wrap input { font-size: 13px; padding: 0 12px; }
    .btn-search { padding: 0 16px; font-size: 13px; }

    /* 主内容 */
    .main-content { padding: 12px; gap: 16px; }
    .card { padding: 14px; }
    .card-title { font-size: 15px; }

    /* 每日推荐 */
    .featured-inner { padding: 20px 16px; }
    .featured-poem-title { font-size: 20px; }
    .featured-body { font-size: 14px; line-height: 2; }
    .featured-actions { gap: 6px; }
    .btn-action { padding: 5px 12px; font-size: 12px; }

    /* 诗词卡片 */
    .poem-card { padding: 14px 16px; }
    .poem-card-title { font-size: 15px; }
    .poem-card-body { font-size: 13px; }

    /* 筛选标签 */
    .filter-row { flex-direction: column; gap: 6px; }
    .filter-label { width: auto; }
    .filter-links { gap: 4px; }
    .filter-link { padding: 3px 10px; font-size: 12px; }

    /* 详情页 */
    .detail-page { padding: 12px; }
    .detail-layout { grid-template-columns: 1fr; gap: 14px; }
    .detail-sidebar { position: static; }
    .poem-detail { padding: 20px 16px; }
    .poem-detail h1 { font-size: 22px; }
    .poem-detail .content { font-size: 15px; line-height: 2.2; }
    .poem-detail .actions { flex-wrap: wrap; gap: 8px; }
    .poem-detail .actions .btn-action { flex: 1; text-align: center; min-width: 100px; }

    /* 会员页 */
    .premium-hero { padding: 40px 16px; }
    .premium-hero h1 { font-size: 24px; }
    .plan-grid { padding: 24px 12px; grid-template-columns: 1fr; gap: 14px; }
    .plan-card { padding: 22px 18px; }

    /* 登录注册 */
    .login-page { padding: 24px 12px; }
    .login-box { padding: 24px 18px; }

    /* 结算页 */
    .buy-page { margin: 30px auto; padding: 0 12px; }
    .buy-card { padding: 20px 16px; }

    /* 分页 */
    .pagination { flex-wrap: wrap; gap: 6px; }
    .page-btn { padding: 5px 10px; font-size: 12px; }

    /* 表格（横向滚动） */
    .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-table { min-width: 600px; }

    /* 页脚 */
    .footer { padding: 24px 16px; }
    .footer-inner { flex-direction: column; gap: 10px; }
}

/* ===== 手机端（≤480px）===== */
@media (max-width: 480px) {
    .logo { font-size: 15px; }
    .logo-icon { font-size: 18px; }
    .top-actions { gap: 8px; }
    .premium-badge { font-size: 11px; padding: 2px 8px; }
    .grid-cards { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .book-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .book-card { padding: 12px; }
    .book-icon { font-size: 26px; }
    .quote-content { font-size: 14px; }
    .word-item { padding: 10px 12px; }
    .featured-actions .btn-action { flex: 1; }
    .poem-detail .actions .btn-action { min-width: 90px; }
}

/* 汉堡菜单按钮默认隐藏（桌面端） */
.nav-toggle { display: none; }

/* ===== 轮播图 ===== */
.banner-wrap {
    position: relative;
    max-width: 1200px;
    margin: 16px auto 0;
    padding: 0 24px;
}
.banner-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 300px;
}
.banner-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}
.banner-slide.active { opacity: 1; pointer-events: auto; }
.banner-slide img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.banner-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
    padding: 30px 24px 16px;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}
.banner-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}
.banner-dots span.active { background: var(--accent); width: 20px; border-radius: 4px; }
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    border: none;
    color: #fff;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s;
}
.banner-arrow:hover { background: var(--accent); }
.banner-prev { left: 40px; }
.banner-next { right: 40px; }
@media (max-width: 900px) {
    .banner-wrap { padding: 0 12px; }
    .banner-slider { height: 200px; }
    .banner-arrow { width: 32px; height: 32px; font-size: 16px; }
    .banner-prev { left: 16px; }
    .banner-next { right: 16px; }
    .banner-caption { font-size: 15px; }
}
@media (max-width: 480px) {
    .banner-slider { height: 160px; }
}
/* Logo 图片样式 */
.logo { display: inline-flex; align-items: center; }
.logo-img { height: 40px; width: auto; transition: transform 0.2s; }
.logo-img:hover { transform: scale(1.05); }
@media (max-width: 768px) { .logo-img { height: 32px; } }

/* Logo 文字样式 */
.logo-text {
  font-weight: 700;
  font-size: 20px;
  color: #ffffff;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", serif;
  margin-left: 10px;
  white-space: nowrap;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
@media (max-width: 768px) {
  .logo-text { font-size: 16px; margin-left: 6px; }
  .logo-img { height: 32px; }
}

/* Footer Logo */
.footer-brand { display: inline-flex; align-items: center; gap: 8px; }
.footer-logo { height: 24px; width: auto; vertical-align: middle; }

/* Login Logo */
.login-title { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-logo {
  height: 28px;
  width: 28px;
  max-height: 28px;
  max-width: 28px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}


/* footer beian / tech support */
.footer-beian {
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(120, 53, 15, 0.2);
    text-align: center;
    font-size: 12px;
    color: #78716c;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.footer-beian a {
    color: #57534e;
    text-decoration: none;
    transition: color 0.15s;
}
.footer-beian a:hover {
    color: #d97706;
    text-decoration: underline;
}
.footer-beian .footer-gov-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: -3px;
    margin-right: 3px;
}
.footer-beian .footer-sep {
    color: rgba(120, 53, 15, 0.3);
}


/* ===== 内容自动换行（含长串无空格） ===== */
.quote-content,
.quote-content p,
.quote-body,
.quote-body p,
.poem-content,
.poem-content p,
.poem-body,
.poem-body p,
.word-content,
.word-content p,
.book-content,
.book-content p,
.admin-table td,
.quote-detail-content,
.quote-detail-content p,
.long-text,
.w-e-text p,
.w-e-text {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100%;
}
.quote-content,
.quote-body {
    line-height: 1.7;
    white-space: pre-wrap;
}


/* 后台表格强制换行 + 固定列宽 */
.admin-table {
    table-layout: fixed !important;
    width: 100% !important;
}
.admin-table th, .admin-table td {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    vertical-align: top;
    padding: 8px 10px;
}
.admin-table td:nth-child(2) {
    max-width: 320px;
    overflow: hidden;
}


/* author index bar */
.author-index-bar {
    background: linear-gradient(135deg, #fff8e7 0%, #fef3c7 100%);
    border-top: 1px solid #fbbf24;
    border-bottom: 1px solid #fbbf24;
    padding: 14px 20px;
    margin: 0 0 20px 0;
}
.author-index-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.author-index-title {
    font-size: 16px;
    font-weight: 700;
    color: #92400e;
    white-space: nowrap;
    flex-shrink: 0;
}
.author-index-list {
    display: flex;
    gap: 10px;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 4px;
}
.author-index-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #fbbf24;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.15s;
    min-width: 80px;
    white-space: nowrap;
}
.author-index-item:hover {
    background: #f59e0b;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
.author-index-item:hover .ai-name,
.author-index-item:hover .ai-meta {
    color: #fff;
}
.ai-name {
    font-size: 14px;
    font-weight: 600;
    color: #78350f;
}
.ai-meta {
    font-size: 10px;
    color: #a8a29e;
    margin-top: 2px;
}


/* poem comments section */
.comments-section {
    max-width: 800px;
    margin: 30px auto;
    background: #fff;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    padding: 20px 24px;
}
.comments-section h3 {
    font-size: 18px;
    color: #92400e;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #fbbf24;
}
.comment-form {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e7e5e4;
}
.comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #d6d3d1;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}
.comment-form textarea:focus {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}
.comment-form-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.comment-form input[type=text] {
    padding: 8px 12px;
    border: 1px solid #d6d3d1;
    border-radius: 6px;
    font-size: 13px;
    width: 160px;
}
.comment-form button {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
}
.comment-form button:hover {
    background: linear-gradient(135deg, #b45309, #d97706);
}
.comment-login-tip {
    flex: 1;
    color: #78716c;
    font-size: 13px;
}
.comment-login-tip a {
    color: #d97706;
    text-decoration: none;
    font-weight: 600;
}
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed #f5f5f4;
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.comment-name { font-weight: 600; color: #44403c; font-size: 14px; }
.comment-time { color: #a8a29e; font-size: 12px; }
.comment-text {
    color: #57534e;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
.no-comments {
    text-align: center;
    color: #a8a29e;
    padding: 30px 10px;
    font-size: 14px;
}


/* cat-tab wrap with edit buttons */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; }
.cat-tab-wrap { position: relative; display: inline-flex; align-items: center; background: #fff; border: 1px solid #e7e5e4; border-radius: 6px; padding: 4px 8px; margin: 2px; }
.cat-tab-wrap:hover { border-color: #a8a29e; }
.cat-edit-btn, .cat-del-btn {
    margin-left: 4px; width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid #d6d3d1; background: #fff; color: #57534e;
    cursor: pointer; font-size: 11px; line-height: 1; padding: 0;
    opacity: 0; transition: opacity 0.15s;
}
.cat-tab-wrap:hover .cat-edit-btn, .cat-tab-wrap:hover .cat-del-btn { opacity: 1; }
.cat-edit-btn:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.cat-del-btn:hover { background: #ef4444; color: #fff; border-color: #ef4444; }


/* tree */
.cat-sub-wrap { margin-left: 22px; }
.cat-tab.sub-cat { padding-left: 12px; font-size: 12px; background: #fafaf9; }
.cat-tab.top-cat { font-weight: 600; }


.cat-move-btn, .cat-edit-btn, .cat-del-btn { background: none; border: 1px solid #e7e5e4; border-radius: 4px; padding: 2px 6px; margin-left: 4px; cursor: pointer; opacity: 0; transition: opacity 0.2s; font-size: 12px; }
.cat-tab-wrap:hover .cat-move-btn { opacity: 1; }
.cat-move-btn:hover { background: #fef3c7; border-color: #d97706; color: #d97706; }


.admin-modal textarea { width: 100%; padding: 8px 12px; border: 1px solid #d6d3d1; border-radius: 6px; font-size: 14px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.admin-modal textarea:focus { outline: none; border-color: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1); }
