:root {
    --primary: #0f4c81;
    --primary-dark: #0b3a63;
    --primary-light: #e8f0f8;
    --accent: #c79a3a;
    --accent-dark: #a87f25;
    --bg: #f4f6f9;
    --bg-soft: #eef2f6;
    --card: #ffffff;
    --text: #1f2a37;
    --muted: #64748b;
    --border: #e3e8ef;
    --danger: #c0392b;
    --success: #1f8a4c;
    --radius: 14px;
    --shadow: 0 6px 20px rgba(15, 76, 129, .08);
    --shadow-hover: 0 14px 34px rgba(15, 76, 129, .16);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.75;
    font-size: 15px;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); text-decoration: none; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- Navbar ---------- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 66px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0 24px;
}
.brand {
    font-size: 19px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand::before {
    content: "";
    width: 10px; height: 22px;
    background: linear-gradient(var(--accent), var(--accent-dark));
    border-radius: 3px;
}
.nav-links { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.nav-links a { color: var(--text); font-size: 15px; font-weight: 500; position: relative; padding: 4px 0; }
.nav-links a::after {
    content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
    background: var(--primary); transition: width .25s;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--primary); font-weight: 700; }
.user-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border-radius: 20px; padding: 3px 13px; font-size: 13px; font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; padding: 11px 26px; border-radius: 10px; border: none; cursor: pointer;
    font-size: 15px; font-weight: 600; transition: transform .15s, box-shadow .2s, filter .2s;
    box-shadow: 0 4px 14px rgba(15, 76, 129, .25);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15, 76, 129, .35); color: #fff; filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); box-shadow: none; }
.btn.ghost:hover { background: var(--primary-light); }
.btn.block { width: 100%; }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0; font-size: 14px; }
.link-danger:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background:
        radial-gradient(1200px 400px at 80% -10%, rgba(199,154,58,.25), transparent),
        linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; padding: 86px 0 96px; text-align: center; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 48px;
    background: var(--bg);
    clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 100%);
    transform: scaleY(-1);
}
.hero h1 { font-size: 42px; margin: 0 0 14px; font-weight: 800; letter-spacing: 1px; }
.hero-sub { font-size: 18px; opacity: .92; margin: 0 auto 30px; max-width: 680px; }
.hero .features { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.hero .features span {
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
    padding: 6px 16px; border-radius: 30px; font-size: 14px;
}

/* ---------- Layout ---------- */
main.container { padding-top: 44px; padding-bottom: 64px; }
.section-title { font-size: 26px; margin: 8px 0 6px; font-weight: 800; }
.section-sub { color: var(--muted); margin: 0 0 28px; }
.page-title { font-size: 30px; margin: 0 0 8px; font-weight: 800; }
.page-desc { color: var(--muted); margin-bottom: 28px; }
.prose p { margin: 0 0 16px; }
.prose .lead { font-size: 16px; color: #2b3a4a; background: var(--primary-light); padding: 16px 20px; border-left: 4px solid var(--accent); border-radius: 8px; }

/* ---------- Stat bar (home) ---------- */
.stat-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 0 auto 48px; }
.stat {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; text-align: center; box-shadow: var(--shadow);
}
.stat .num { font-size: 30px; font-weight: 800; color: var(--primary); }
.stat .label { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- Cards (home) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: box-shadow .25s, transform .25s; display: flex; flex-direction: column;
    box-shadow: var(--shadow); cursor: pointer;
}
/* 卡片内所有区域继承手型, 表明整块可点 */
.card *, .article-item * { cursor: pointer; }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.card-thumb {
    height: 120px; padding: 22px 24px; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: flex-end;
}
.card-thumb .tag { background: rgba(255,255,255,.18); padding: 4px 12px; border-radius: 20px; font-size: 12px; }
.card-body { padding: 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin: 0 0 10px; font-size: 17px; line-height: 1.5; }
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--primary); }
.summary { color: var(--muted); font-size: 14px; margin: 0 0 16px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.price { color: #e4393c; font-weight: 700; font-size: 15px; }
.price.free { color: #e4393c; }

/* ---------- Article list ---------- */
.article-list { display: flex; flex-direction: column; gap: 16px; }
.article-item {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 24px; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
    display: flex; gap: 20px; align-items: flex-start;
}
.article-item:hover { box-shadow: var(--shadow-hover); transform: translateX(2px); }
.article-rank {
    flex: 0 0 46px; height: 46px; border-radius: 12px; color: #fff; font-weight: 800; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}
.article-main { flex: 1; }
.article-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.article-item-head h3 { margin: 0; font-size: 18px; line-height: 1.5; }
.article-item-head h3 a { color: var(--text); }
.article-item-head h3 a:hover { color: var(--primary); }
.article-item-meta { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- Article detail ---------- */
.article-page { max-width: 820px; }
.article-meta { color: var(--muted); font-size: 14px; margin-bottom: 22px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.article-meta .author-badge { background: var(--primary-light); color: var(--primary); padding: 3px 12px; border-radius: 20px; font-weight: 600; }
.prose { font-size: 16px; color: #2a3645; }
.prose p { margin: 0 0 18px; }
.prose h2, .prose h3 { margin: 26px 0 12px; color: var(--primary-dark); }
.prose ol, .prose ul { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }
.paid-tip { color: var(--success); background: #e9f7ef; padding: 12px 16px; border-radius: 8px; font-weight: 600; }

/* ---------- Paywall ---------- */
.paywall {
    background: linear-gradient(180deg, #fffdf7, #fdf6e7);
    border: 1.5px dashed var(--accent); border-radius: var(--radius);
    padding: 32px; text-align: center; margin-top: 22px; box-shadow: var(--shadow);
}
.paywall h3 { margin: 0 0 8px; font-size: 20px; color: var(--accent-dark); }
.paywall .lock-ico { font-size: 34px; }
.qr-box {
    display: inline-block; margin: 18px 0 10px; padding: 16px; background: #fff;
    border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.qr-box img { width: 220px; height: 220px; display: block; object-fit: contain; }
.qr-method { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.paywall-action { margin-top: 14px; }
.paywall-action .btn { min-width: 180px; }
.note { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ---------- 支付弹窗 (文章列表点击) ---------- */
.modal-mask {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15,23,42,.55); backdrop-filter: blur(2px); padding: 20px;
}
.modal-box {
    position: relative; width: 100%; max-width: 380px; text-align: center;
    background: linear-gradient(180deg, #fffdf7, #fdf6e7);
    border: 1.5px solid var(--accent); border-radius: var(--radius);
    padding: 34px 28px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.28);
    animation: modalPop .22s ease;
}
@keyframes modalPop { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
    position: absolute; top: 10px; right: 14px; border: none; background: transparent;
    font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--accent-dark); }
.modal-title { margin: 4px 0 8px; font-size: 20px; color: var(--accent-dark); }
.modal-desc { margin: 0 0 6px; color: var(--text); font-size: 14px; }
.modal-desc .price { font-size: 15px; }
.article-item { cursor: pointer; }

/* ---------- Info cards (about/contact) ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 24px; }
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.info-card h4 { margin: 0 0 8px; color: var(--primary); font-size: 16px; }
.info-card p { margin: 0; color: var(--muted); font-size: 14px; }

.contact-list { list-style: none; padding: 0; margin: 18px 0; }
.contact-list li {
    display: flex; gap: 10px; padding: 14px 18px; background: var(--card);
    border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px;
}
.contact-list .label { font-weight: 700; color: var(--text); min-width: 96px; }

/* ---------- Auth ---------- */
.auth-page { max-width: 460px; margin: 0 auto; }
.auth-form { display: flex; flex-direction: column; gap: 16px; background: var(--card); padding: 32px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.auth-form input, .auth-form textarea, .auth-form select {
    padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 15px; font-weight: 400; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.auth-form input:focus, .auth-form textarea:focus, .auth-form select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}

/* ---------- Alerts ---------- */
.alert { padding: 13px 17px; border-radius: 9px; margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.alert.error { background: #fdecec; color: var(--danger); border-color: #f5c2c2; }
.alert.success { background: #e9f7ef; color: var(--success); border-color: #bfe3cc; }
.alert ul { margin: 0; padding-left: 20px; }

/* ---------- Admin ---------- */
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.admin-table th { background: var(--bg-soft); font-weight: 700; color: var(--primary-dark); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #fafcff; }
.admin-table .ops { display: flex; gap: 14px; align-items: center; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.pub { background: #e9f7ef; color: var(--success); }
.badge.draft { background: #fdf0e6; color: var(--accent-dark); }

/* ---------- Footer ---------- */
.footer {
    padding: 40px 20px 30px; color: var(--muted); font-size: 14px; text-align: center;
    border-top: 1px solid var(--border); background: #fff;
    background-image: linear-gradient(180deg, #fff, #fbfcfe);
}
.footer p { margin: 5px 0; }
.footer .company { color: var(--primary-dark); font-weight: 700; }
.footer .copy { font-size: 13px; margin-top: 14px; }
.icp-link { color: var(--muted); }
.icp-link:hover { color: var(--primary); }
.footer-bottom-right { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; align-items: center; margin-top: 8px; }
.beian-police { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.beian-police:hover { color: var(--primary); }
.beian-police-icon { width: 14px; height: 14px; vertical-align: middle; }

@media (max-width: 760px) {
    .hero h1 { font-size: 30px; }
    .stat-bar { grid-template-columns: repeat(2, 1fr); }
    .nav-links { gap: 14px; font-size: 14px; }
    .article-item { flex-direction: column; }
    .article-rank { flex-basis: auto; }
}
