/**
 * RuleTree-inspired Consumer Community Theme
 * Author: Zhang Wei
 * Date: 2026-05-21
 * Description: Community portal layout, dense article feed, ranked widgets, responsive navigation and admin styling.
 */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --accent: #f59e0b;
    --danger: #ef4444;
    --success: #16a34a;
    --text: #0f172a;
    --muted: #64748b;
    --light: #f8fafc;
    --line: #e2e8f0;
    --card: #ffffff;
    --shadow: 0 16px 45px rgba(15, 23, 42, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background: #f3f6fb;
    line-height: 1.7;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 0%, rgba(37, 99, 235, .10), transparent 28rem),
        radial-gradient(circle at 90% 10%, rgba(245, 158, 11, .10), transparent 24rem),
        linear-gradient(180deg, rgba(255,255,255,.7), rgba(243,246,251,.55));
    z-index: -2;
}
.site-bg {
    position: fixed;
    inset: auto 0 0 0;
    height: 45vh;
    background-image: linear-gradient(rgba(37,99,235,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(37,99,235,.04) 1px, transparent 1px);
    background-size: 28px 28px;
    z-index: -1;
    mask-image: linear-gradient(transparent, #000);
}

a { color: inherit; text-decoration: none; transition: .2s ease; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

/* Header */
.rt-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226,232,240,.88);
    box-shadow: 0 10px 28px rgba(15,23,42,.045);
}
.rt-header.scrolled { box-shadow: 0 14px 38px rgba(15,23,42,.08); }
.rt-topbar {
    background: linear-gradient(90deg, #0f172a, #1e3a8a);
    color: rgba(255,255,255,.84);
    font-size: 13px;
}
.rt-topbar-inner {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.rt-toplinks { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.rt-toplinks a { color: rgba(255,255,255,.86); }
.rt-toplinks a:hover { color: #fff; }
.rt-head-main {
    display: grid;
    grid-template-columns: 245px 1fr auto;
    gap: 22px;
    align-items: center;
    padding: 18px 0;
}
.rt-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.rt-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(37,99,235,.25);
}
.rt-brand strong { display: block; font-size: 22px; line-height: 1.1; letter-spacing: -.04em; }
.rt-brand small { color: var(--muted); font-weight: 700; font-size: 12px; }
.rt-search {
    display: grid;
    grid-template-columns: 1fr 92px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px;
    box-shadow: 0 12px 28px rgba(15,23,42,.06);
}
.rt-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    padding: 12px 18px;
    color: var(--text);
    background: transparent;
}
.rt-search button {
    height: 42px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(37,99,235,.22);
}
.rt-search button:hover { background: var(--primary-dark); }
.rt-actions { display: flex; align-items: center; gap: 12px; }
.rt-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-weight: 800;
    box-shadow: 0 12px 22px rgba(15,23,42,.18);
}
.rt-submit:hover { color: #fff; transform: translateY(-1px); }
.rt-menu-btn { display: none; width: 42px; height: 42px; border-radius: 13px; background: var(--primary-soft); }
.rt-menu-btn span { display: block; width: 20px; height: 2px; margin: 5px auto; background: var(--primary); transition: .2s ease; }
.rt-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.rt-menu-btn.open span:nth-child(2) { opacity: 0; }
.rt-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.rt-nav-wrap { background: #fff; border-top: 1px solid var(--line); }
.rt-nav-scroll { overflow-x: auto; scrollbar-width: none; }
.rt-nav-scroll::-webkit-scrollbar { display: none; }
.rt-nav { display: flex; align-items: center; gap: 6px; min-height: 48px; white-space: nowrap; }
.rt-nav a {
    position: relative;
    padding: 11px 14px;
    border-radius: 999px;
    color: #334155;
    font-weight: 800;
    font-size: 14px;
}
.rt-nav a:hover, .rt-nav a.active { background: var(--primary-soft); color: var(--primary); }

/* Hero */
.rt-hero { padding: 26px 0 18px; }
.rt-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 22px;
    align-items: stretch;
}
.rt-breadcrumb {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.rt-breadcrumb a { color: var(--primary); }
.rt-feature-card {
    position: relative;
    min-height: 300px;
    overflow: hidden;
    border-radius: 28px;
    padding: 38px;
    background:
        linear-gradient(135deg, rgba(15,23,42,.92), rgba(30,64,175,.86)),
        radial-gradient(circle at 90% 10%, rgba(59,130,246,.6), transparent 22rem);
    color: #fff;
    box-shadow: var(--shadow);
}
.rt-feature-card::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -100px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 46px solid rgba(255,255,255,.08);
}
.rt-feature-meta { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.rt-feature-meta span, .rt-feature-meta a {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    background: rgba(255,255,255,.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
}
.rt-feature-card h1 { position: relative; z-index: 1; max-width: 760px; margin: 0; font-size: clamp(30px, 5vw, 54px); line-height: 1.12; letter-spacing: -.06em; }
.rt-feature-card p { position: relative; z-index: 1; max-width: 620px; margin: 18px 0 0; color: rgba(255,255,255,.82); font-size: 16px; }
.rt-feature-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.rt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 13px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
.rt-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 12px 24px rgba(37,99,235,.22); }
.rt-btn.primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.rt-btn.block { width: 100%; }
.rt-hero-side { display: grid; gap: 14px; }
.rt-stats-card, .rt-hot-mini, .rt-widget, .rt-category-matrix, .rt-feed {
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(226,232,240,.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.rt-stats-card { padding: 20px; }
.rt-stats-card h3, .rt-widget h3 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.rt-stats-card ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.rt-stats-card li { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.rt-stats-card li:last-child { border-bottom: 0; }
.rt-stats-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.rt-stats-card strong { font-size: 14px; }
.rt-hot-mini { padding: 12px; display: grid; gap: 8px; }
.rt-hot-mini a { display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; padding: 9px; border-radius: 13px; background: #f8fafc; }
.rt-hot-mini a:hover { background: var(--primary-soft); }
.rt-hot-mini em { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: #0f172a; color: #fff; font-style: normal; font-weight: 900; font-size: 12px; }
.rt-hot-mini span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.rt-hot-mini b { color: var(--muted); font-size: 12px; }

/* Category matrix */
.rt-category-matrix { margin-top: 18px; padding: 20px; }
.rt-module-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.rt-module-title h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.rt-module-title span { color: var(--muted); font-weight: 700; font-size: 13px; }
.rt-channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rt-channel {
    position: relative;
    overflow: hidden;
    display: block;
    min-height: 96px;
    padding: 18px;
    border-radius: 17px;
    background: linear-gradient(135deg, #f8fafc, #fff);
    border: 1px solid var(--line);
}
.rt-channel:hover, .rt-channel.active { border-color: rgba(37,99,235,.35); background: linear-gradient(135deg, var(--primary-soft), #fff); transform: translateY(-2px); }
.rt-channel strong { display: block; font-size: 17px; margin-bottom: 2px; }
.rt-channel span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.rt-channel em { position: absolute; right: 16px; bottom: 12px; color: rgba(37,99,235,.18); font-style: normal; font-weight: 900; font-size: 38px; line-height: 1; }

/* Main layout */
.rt-main-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; margin-top: 22px; margin-bottom: 42px; }
.rt-feed { overflow: hidden; }
.rt-tabs { display: flex; align-items: center; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); background: #fff; overflow-x: auto; }
.rt-tabs a { flex: 0 0 auto; padding: 10px 14px; border-radius: 999px; font-weight: 900; color: #334155; }
.rt-tabs a.active, .rt-tabs a:hover { background: var(--primary); color: #fff; }
.rt-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.rt-section-head span { color: var(--primary); font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.rt-section-head h2 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.05em; }
.rt-section-head b { display: inline-flex; height: 32px; align-items: center; padding: 0 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 13px; }
.rt-empty { margin: 24px; padding: 40px; text-align: center; border-radius: 16px; background: #f8fafc; color: var(--muted); font-weight: 800; }
.rt-post-list { display: grid; }
.rt-post-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    transition: .2s ease;
}
.rt-post-item:hover { background: #f8fbff; }
.rt-post-item.is-top { background: linear-gradient(90deg, rgba(239,246,255,.95), #fff); }
.rt-thumb {
    position: relative;
    overflow: hidden;
    min-height: 140px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    font-size: 46px;
}
.rt-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.rt-post-item:hover .rt-thumb img { transform: scale(1.06); }
.rt-post-info { min-width: 0; }
.rt-post-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.rt-badge, .rt-label {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 900;
    font-size: 12px;
}
.rt-badge.muted { color: var(--muted); background: #f1f5f9; }
.rt-label { background: #fff7ed; color: #ea580c; }
.rt-post-line time { color: var(--muted); font-size: 13px; font-weight: 700; }
.rt-post-info h3 { margin: 0; font-size: 22px; line-height: 1.32; letter-spacing: -.04em; }
.rt-post-info p { margin: 10px 0 0; color: #475569; font-size: 15px; }
.rt-post-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 13px; font-weight: 700; }
.rt-post-foot a { color: var(--primary); font-weight: 900; }
.rt-pagination { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 24px; }
.rt-pagination a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); font-weight: 900; }
.rt-pagination a.active, .rt-pagination a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Sidebar widgets */
.rt-sidebar { display: grid; gap: 16px; }
.rt-widget { padding: 18px; }
.rt-widget-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rt-widget-head a, .rt-widget-head span { color: var(--muted); font-size: 13px; font-weight: 800; }
.rt-rank-list, .rt-comment-rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rt-rank-list li a, .rt-comment-rank li a {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 13px;
    background: #f8fafc;
}
.rt-rank-list li a:hover, .rt-comment-rank li a:hover { background: var(--primary-soft); }
.rt-rank-list em, .rt-comment-rank em { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: #e2e8f0; color: #334155; font-style: normal; font-weight: 900; font-size: 12px; }
.rt-rank-list li:nth-child(-n+3) em, .rt-comment-rank li:nth-child(-n+3) em { background: linear-gradient(135deg, #f97316, #f59e0b); color: #fff; }
.rt-rank-list span, .rt-comment-rank a { min-width: 0; }
.rt-rank-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.rt-rank-list b, .rt-comment-rank b { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rt-rank-list.compact li a { grid-template-columns: 26px 1fr 42px; }
.rt-tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.rt-tag-cloud a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border-radius: 999px; background: #f8fafc; border: 1px solid var(--line); color: #334155; font-size: 13px; font-weight: 800; }
.rt-tag-cloud a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.rt-reco-list, .rt-reply-list { display: grid; gap: 10px; }
.rt-reco-list a { padding: 12px; border-radius: 14px; background: #f8fafc; border: 1px solid transparent; }
.rt-reco-list a:hover { border-color: rgba(37,99,235,.25); background: var(--primary-soft); }
.rt-reco-list span { display: block; color: var(--primary); font-size: 12px; font-weight: 900; }
.rt-reco-list strong { display: block; margin-top: 3px; line-height: 1.45; }
.rt-comment-rank li a { display: grid; grid-template-columns: 28px 1fr; }
.rt-comment-rank b { grid-column: 2; }
.rt-reply-list a { display: block; padding: 12px; border-radius: 14px; background: #f8fafc; }
.rt-reply-list strong { display: block; font-size: 14px; }
.rt-reply-list span { display: block; color: #475569; margin: 3px 0; }
.rt-reply-list small, .rt-reply-list p { color: var(--muted); margin: 0; }

/* Article page */
.rt-article-head { padding: 28px 0 14px; }
.rt-article-head-inner {
    padding: 34px;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    box-shadow: var(--shadow);
}
.rt-article-head .rt-breadcrumb { color: rgba(255,255,255,.72); }
.rt-article-head h1 { margin: 14px 0; font-size: clamp(30px, 5vw, 50px); line-height: 1.16; letter-spacing: -.06em; }
.rt-article-head .rt-badge { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.18); }
.rt-article-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.rt-article-meta span { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.86); font-size: 13px; font-weight: 800; }
.rt-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; margin-top: 18px; }
.rt-article-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.rt-article-cover { max-height: 420px; overflow: hidden; }
.rt-article-cover img { width: 100%; height: 100%; object-fit: cover; }
.rt-article-content { padding: 34px; font-size: 17px; color: #1f2937; line-height: 2; word-break: break-word; }
.article-side { position: sticky; top: 150px; }
.rt-author-box { text-align: center; }
.rt-avatar { width: 74px; height: 74px; border-radius: 24px; margin: 0 auto 12px; display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #38bdf8); color: #fff; font-size: 28px; font-weight: 900; box-shadow: 0 14px 24px rgba(37,99,235,.22); }
.rt-author-box p { color: var(--muted); margin: 8px 0 16px; }
.rt-info-list { display: grid; gap: 8px; }
.rt-info-list span { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rt-info-list span:last-child { border-bottom: 0; }
.rt-info-list b { color: var(--muted); }
.rt-info-list em { font-style: normal; font-weight: 900; }
.rt-below-article { display: grid; gap: 18px; margin-top: 22px; margin-bottom: 42px; }
.rt-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rt-related-grid a { padding: 16px; border-radius: 15px; background: #f8fafc; border: 1px solid var(--line); }
.rt-related-grid a:hover { background: var(--primary-soft); border-color: rgba(37,99,235,.3); }
.rt-related-grid strong { display: block; line-height: 1.45; }
.rt-related-grid span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.rt-comments { padding: 22px; }
.rt-comment-form { padding: 16px; border-radius: 16px; background: #f8fafc; border: 1px solid var(--line); }
.rt-comment-list { display: grid; gap: 12px; margin-top: 18px; }
.rt-comment { padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.rt-comment strong { display: inline-block; margin-right: 8px; }
.rt-comment span { color: var(--muted); font-size: 13px; }
.rt-comment p { margin: 8px 0 0; color: #334155; }

/* Footer */
.rt-footer { margin-top: 28px; background: #0f172a; color: rgba(255,255,255,.78); }
.rt-footer-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1.25fr; gap: 24px; padding: 34px 0; }
.footer-brand .rt-logo { box-shadow: none; }
.rt-footer p { margin: 14px 0 0; color: rgba(255,255,255,.66); }
.rt-footer .rt-brand strong { color: #fff; }
.rt-footer .rt-brand small { color: rgba(255,255,255,.62); }
.rt-footer h3 { margin: 0 0 12px; color: #fff; font-size: 16px; }
.rt-footer-links { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-footer-links a, .rt-records a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.76); font-size: 13px; }
.rt-footer-links a:hover, .rt-records a:hover { background: rgba(255,255,255,.16); color: #fff; }
.rt-records { display: grid; align-content: start; gap: 10px; }
.rt-records small { color: rgba(255,255,255,.48); }

/* Forms and common admin components */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 7px; color: #334155; font-weight: 900; }
.form-control, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: var(--text);
    outline: none;
    padding: 12px 13px;
    transition: .2s ease;
}
textarea { min-height: 170px; resize: vertical; }
.form-control:focus, select:focus, textarea:focus { border-color: rgba(37,99,235,.55); box-shadow: 0 0 0 4px rgba(37,99,235,.10); }
.notice { padding: 13px 15px; border-radius: 14px; background: var(--primary-soft); border: 1px solid rgba(37,99,235,.22); color: var(--primary); font-weight: 900; margin-bottom: 14px; }
.meta { color: var(--muted); }
.btn, button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 15px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    border: 1px solid var(--primary);
}
.btn:hover, button[type="submit"]:hover { color: #fff; background: var(--primary-dark); }
.btn-muted { background: #f8fafc; color: #334155; border-color: var(--line); }
.btn-muted:hover { color: var(--primary); background: var(--primary-soft); }
.btn-danger, .btn.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.panel h2 { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.table { width: 100%; border-collapse: collapse; background: #fff; overflow: hidden; }
.table th, .table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: #334155; background: #f8fafc; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 20px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-weight: 800; }
.stat b { display: block; font-size: 32px; margin-top: 4px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #eff6ff, #f8fafc); }
.login-card { width: min(420px, 100%); padding: 28px; border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 20px; letter-spacing: -.05em; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; background: #f3f6fb; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 18px; background: #0f172a; color: rgba(255,255,255,.75); display: flex; flex-direction: column; gap: 8px; }
.sidebar .logo { margin-bottom: 14px; color: #fff; font-size: 22px; font-weight: 900; }
.sidebar a { padding: 12px 14px; border-radius: 13px; color: rgba(255,255,255,.78); font-weight: 800; }
.sidebar a:hover { background: rgba(255,255,255,.10); color: #fff; }
.admin-main { padding: 24px; min-width: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.admin-top h1 { margin: 0; letter-spacing: -.05em; }

/* Responsive */
@media (max-width: 1040px) {
    .rt-head-main { grid-template-columns: 220px 1fr auto; }
    .rt-hero-grid, .rt-main-layout, .rt-article-layout { grid-template-columns: 1fr; }
    .article-side { position: static; }
    .rt-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rt-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .container { width: min(100% - 24px, 1180px); }
    .rt-topbar { display: none; }
    .rt-head-main { grid-template-columns: 1fr auto; gap: 12px; padding: 14px 0; }
    .rt-brand strong { font-size: 19px; }
    .rt-logo { width: 42px; height: 42px; }
    .rt-search { grid-column: 1 / -1; order: 3; grid-template-columns: 1fr 76px; }
    .rt-submit { display: none; }
    .rt-menu-btn { display: block; }
    .rt-nav-wrap { display: none; }
    .rt-nav-wrap.open { display: block; }
    .rt-nav { padding: 10px 0; }
    .rt-feature-card { padding: 24px; border-radius: 22px; min-height: 260px; }
    .rt-feature-card h1 { font-size: 30px; }
    .rt-channel-grid, .rt-related-grid, .form-row, .stats { grid-template-columns: 1fr; }
    .rt-post-item { grid-template-columns: 1fr; padding: 18px; }
    .rt-thumb { min-height: 190px; }
    .rt-sidebar { grid-template-columns: 1fr; }
    .rt-section-head { align-items: flex-start; flex-direction: column; }
    .rt-post-foot { align-items: flex-start; flex-direction: column; }
    .rt-article-head-inner { padding: 24px; border-radius: 22px; }
    .rt-article-content { padding: 24px; font-size: 16px; }
    .rt-footer-grid { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .admin-main { padding: 16px; }
    .table { display: block; overflow-x: auto; white-space: nowrap; }
    .admin-top { align-items: flex-start; flex-direction: column; }
}

/**
 * Local Cover Upload Components
 * Author: Zhang Wei
 * Date: 2026-05-21
 * Description: Admin cover uploader preview, device file picker and upload error feedback.
 */
.notice-error {
    background: #fef2f2;
    border-color: rgba(239, 68, 68, .26);
    color: #dc2626;
}
.cover-upload-card {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
    padding: 14px;
    border: 1px dashed rgba(37, 99, 235, .32);
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}
.cover-preview {
    min-height: 170px;
    overflow: hidden;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(37,99,235,.10), rgba(56,189,248,.08)),
        #f8fafc;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
}
.cover-preview img {
    width: 100%;
    height: 100%;
    min-height: 170px;
    object-fit: cover;
}
.cover-preview-empty {
    text-align: center;
    color: var(--muted);
    padding: 20px;
}
.cover-preview-empty strong {
    display: block;
    color: var(--primary);
    font-size: 28px;
    letter-spacing: -.05em;
}
.cover-preview-empty span {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    font-weight: 800;
}
.cover-upload-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}
.cover-select-btn {
    width: fit-content;
}
.cover-upload-body p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.inline-check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: #475569 !important;
    font-weight: 800 !important;
}
.inline-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
@media (max-width: 760px) {
    .cover-upload-card {
        grid-template-columns: 1fr;
    }
}


/**
 * Admin SEO Settings Components
 * Author: Zhang Wei
 * Date: 2026-05-21
 * Description: SEO management cards, discovery file links and article metadata form styling.
 */
.seo-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}
.seo-panel-main h2,
.seo-card h2,
.seo-quick-panel h2 {
    margin-top: 0;
}
.seo-form-box {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(37, 99, 235, .14);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(255,255,255,.9));
}
.seo-form-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.seo-form-head strong {
    color: #0f172a;
    font-size: 15px;
}
.seo-form-head span,
.field-tip {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.seo-side {
    display: grid;
    gap: 18px;
}
.seo-card a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    color: #1d4ed8;
    font-weight: 900;
    text-decoration: none;
}
.seo-card a::after {
    content: '↗';
    color: #64748b;
}
.seo-card code {
    display: block;
    white-space: normal;
    word-break: break-all;
    padding: 12px;
    border-radius: 12px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 12px;
}
.seo-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
@media (max-width: 960px) {
    .seo-dashboard-grid {
        grid-template-columns: 1fr;
    }
}
