:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --pos: #16a34a;
    --neg: #dc2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* topbar */
.topbar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-size: 18px; font-weight: 700; color: var(--primary); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--text); text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--primary); }
.points-badge { background: #ecfdf5; color: var(--pos); padding: 4px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.btn-link { color: var(--primary) !important; font-weight: 600; }

/* buttons */
.btn { display: inline-block; padding: 9px 18px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* hero */
.hero { text-align: center; padding: 70px 20px 50px; }
.hero h1 { font-size: 38px; margin-bottom: 14px; }
.hero-sub { color: var(--muted); font-size: 16px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px 20px; text-align: center; }
.feature-num { font-size: 28px; font-weight: 700; color: var(--primary); }
.feature-label { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* auth */
.auth-card { max-width: 400px; margin: 50px auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
.auth-card h2 { text-align: center; margin-bottom: 22px; }
.form label { display: block; margin-bottom: 14px; }
.form label span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form input, .form select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.form input:focus, .form select:focus { outline: none; border-color: var(--primary); }
.form-msg { color: var(--neg); font-size: 13px; min-height: 18px; margin-top: 8px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--primary); }

/* dashboard */
.dashboard { padding: 30px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; margin-bottom: 24px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 20px; }
.panel h3 { margin-bottom: 16px; font-size: 16px; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--muted); font-weight: 600; }
.table .empty { text-align: center; color: var(--muted); padding: 20px; }
.pos { color: var(--pos); font-weight: 600; }
.neg { color: var(--neg); font-weight: 600; }
.tag { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-pending { background: #fef3c7; color: #92400e; }
.tag-approved { background: #dbeafe; color: #1e40af; }
.tag-rejected { background: #fee2e2; color: #991b1b; }
.tag-paid { background: #d1fae5; color: #065f46; }
.tag-news { background: #e0e7ff; color: #3730a3; }
.tag-bulletin { background: #fef3c7; color: #92400e; }
.tag-article { background: #d1fae5; color: #065f46; }

/* footer */
.footer { text-align: center; padding: 30px 0; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 40px; }

/* admin */
.admin-nav { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.admin-nav a { color: var(--text); text-decoration: none; font-size: 14px; }
.admin-nav a.active, .admin-nav a:hover { color: var(--primary); }

/* 滚动记录 */
.scroll-records { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 20px 0; }
.scroll-mini { max-width: 480px; margin: 20px auto; }
.scroll-header { background: #f9fafb; padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); }
.scroll-viewport { height: 200px; overflow: hidden; position: relative; }
.scroll-track { display: flex; flex-direction: column; }
.scroll-item { padding: 10px 16px; font-size: 13px; border-bottom: 1px solid #f3f4f6; white-space: normal; word-break: break-all; line-height: 1.5; flex-shrink: 0; }
.scroll-item.placeholder { color: var(--muted); text-align: center; }
.scroll-time { color: var(--muted); font-size: 12px; margin-left: 4px; }
@keyframes scrollUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* 文章卡片 */
.article-list { display: flex; flex-direction: column; gap: 16px; }
.article-card { padding: 16px; background: #f9fafb; border-radius: 10px; border: 1px solid var(--border); }
.article-title { font-size: 16px; margin-bottom: 8px; }
.article-title a { color: var(--text); text-decoration: none; }
.article-title a:hover { color: var(--primary); }
.article-excerpt { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.article-meta { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }

/* 计时器 - 圆形表盘 */
.timer-clock { position: relative; width: 120px; height: 120px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.timer-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg-ring { fill: none; stroke: #e5e7eb; stroke-width: 5; }
.timer-progress-ring { fill: none; stroke: var(--primary); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.timer-display { font-size: 28px; font-weight: 700; font-family: 'Courier New', monospace; z-index: 1; line-height: 1; }
.timer-label { font-size: 11px; color: var(--muted); z-index: 1; margin-top: 2px; }
.timer-clock.warning .timer-progress-ring { stroke: var(--neg); }
.timer-clock.warning .timer-display { color: var(--neg); animation: pulse 0.5s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.5; } }

/* 信息行 */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.info-row span { color: var(--muted); }
.panel-note { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

/* 邀请链接 */
.referral-link { display: flex; gap: 8px; margin: 10px 0; }
.referral-link input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }

/* 新闻 */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.news-item .news-title { flex: 1; font-size: 14px; }
.news-item .news-date { font-size: 12px; color: var(--muted); }
.news-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.news-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.news-card-header h3 { flex: 1; font-size: 16px; }
.news-card-header .news-date { font-size: 12px; color: var(--muted); }
.news-content { font-size: 14px; line-height: 1.8; color: var(--text); }
.news-page { padding: 30px 0; }

/* 验证码工作台 */
.work-wrap { padding: 24px 0; }
.work-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 14px; }
.work-header h2 { margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 13px; }
.balance-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 20px; text-align: center; }
.balance-box span { display: block; font-size: 12px; color: var(--muted); }
.balance-box strong { font-size: 22px; color: var(--primary); }

/* 分页 */
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; flex-wrap: wrap; gap: 10px; }
.page-info { font-size: 13px; color: var(--muted); }
.page-links { display: flex; gap: 6px; flex-wrap: wrap; }
.page-links .btn-sm { min-width: 36px; text-align: center; }

.captcha-card { max-width: 480px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 28px; text-align: center; min-height: 320px; display: flex; flex-direction: column; justify-content: center; }
.captcha-idle p { margin-bottom: 16px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 12px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.captcha-prompt { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.captcha-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 auto 18px; max-width: 320px; }
.tile { width: 100%; aspect-ratio: 1/1; background-size: cover; background-position: center; border-radius: 4px; cursor: pointer; border: 3px solid transparent; transition: .1s; }
.tile:hover { border-color: rgba(79,70,229,0.4); }
.tile.selected { border-color: var(--primary); background-color: rgba(79,70,229,0.15); }
.captcha-actions { display: flex; gap: 10px; justify-content: center; }
.result-success { color: var(--pos); font-size: 18px; font-weight: 600; padding: 20px 0; }
.result-fail { color: var(--neg); font-size: 18px; font-weight: 600; padding: 20px 0; }

@media (max-width: 768px) {
    .features, .stat-grid, .dash-cols { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
}
