/* 公众号互阅平台 - 前台样式 */
:root {
    --pri: #2b5cff;
    --pri-d: #1f45d4;
    --pri-l: #eaf0ff;
    --bg: #f4f6fb;
    --txt: #171e2e;
    --sub: #7b8798;
    --line: #e9eef7;
    --ok: #12b886;
    --warn: #f76707;
    --danger: #e03131;
    --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
    font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--txt);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--pri); text-decoration: none; }

.container { max-width: 600px; margin: 0 auto; padding: 12px 14px 92px; }

/* 顶栏 */
.topbar {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.topbar .brand small { display: block; font-weight: 400; font-size: 11px; color: var(--sub); letter-spacing: 0; }
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--pri-l); color: var(--pri-d);
    padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.pill b { font-size: 15px; }

/* 卡片 */
.card {
    background: #fff; border-radius: var(--radius);
    padding: 16px; margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(24, 44, 90, .05);
}
.card h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; justify-content: space-between; }
.card h3 span.more { font-weight: 400; font-size: 12px; color: var(--sub); }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 18px; border: 0; border-radius: 11px;
    background: linear-gradient(135deg, #3b6cff, #2450e6);
    color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: .18s;
    box-shadow: 0 6px 16px rgba(43, 92, 255, .22);
}
.btn:active { transform: translateY(1px); box-shadow: 0 3px 8px rgba(43, 92, 255, .2); }
.btn.block { width: 100%; }
.btn.big { padding: 16px 20px; font-size: 17px; border-radius: 13px; }
.btn.ghost { background: #fff; color: var(--pri); border: 1px solid #cfdcff; box-shadow: none; }
.btn.gray { background: #eef2f8; color: #4a5568; box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #ff6b6b, #e03131); box-shadow: 0 6px 16px rgba(224, 49, 49, .2); }
.btn:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #47536b; font-weight: 600; margin-bottom: 7px; }
.input, select.input, textarea.input {
    width: 100%; padding: 12px 14px; font-size: 15px;
    border: 1px solid #dfe6f2; border-radius: 11px;
    background: #fbfcfe; color: var(--txt);
    font-family: inherit;
}
.input:focus { outline: none; border-color: var(--pri); background: #fff; box-shadow: 0 0 0 3px rgba(43, 92, 255, .1); }
textarea.input { min-height: 74px; resize: vertical; }
.hint { font-size: 12px; color: var(--sub); margin-top: 6px; }

/* 数据面板 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-grid.four { grid-template-columns: repeat(4, 1fr); }
.stat {
    background: #f8faff; border: 1px solid #eff3fb;
    border-radius: 12px; padding: 12px; text-align: center;
}
.stat .n { font-size: 20px; font-weight: 700; color: var(--pri-d); line-height: 1.3; }
.stat .n.ok { color: var(--ok); }
.stat .n.warn { color: var(--warn); }
.stat .t { font-size: 12px; color: var(--sub); margin-top: 2px; }

/* 提示条 */
.alert {
    border-radius: 12px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 12px;
    display: flex; gap: 8px; align-items: flex-start;
}
.alert.info { background: #eef4ff; color: #1f45d4; }
.alert.warn { background: #fff7e8; color: #b35c00; }
.alert.ok { background: #e9fbf3; color: #0a7f5c; }
.alert.err { background: #fff1f0; color: var(--danger); }

/* 列表 */
.list { margin: 0; padding: 0; list-style: none; }
.list li {
    padding: 12px 0; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.list li:last-child { border-bottom: 0; }
.list .main { min-width: 0; flex: 1; }
.list .ttl { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { font-size: 12px; color: var(--sub); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.list .act { display: flex; gap: 6px; flex-shrink: 0; }
.plus { color: var(--ok); font-weight: 700; }
.minus { color: var(--danger); font-weight: 700; }

/* 徽标 */
.badge { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: #eef2f8; color: #5b6779; }
.badge.ok { background: #e9fbf3; color: #0a7f5c; }
.badge.off { background: #f1f3f6; color: #97a1b0; }
.badge.warn { background: #fff4e6; color: #b35c00; }

/* 底部导航 */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: blur(12px);
}
.tabbar a {
    flex: 1; text-align: center; font-size: 11px; color: #97a1b0;
    padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar a .ico { font-size: 19px; line-height: 1; }
.tabbar a.on { color: var(--pri); font-weight: 600; }

/* 分页 */
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 16px 0 4px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 34px; text-align: center; padding: 6px 10px;
    border-radius: 8px; background: #fff; border: 1px solid var(--line);
    font-size: 13px; color: #4a5568;
}
.pager span.cur { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.pager span.info { border: 0; background: transparent; color: var(--sub); font-size: 12px; }

/* 登录页 */
.auth-hero { text-align: center; padding: 28px 0 10px; }
.auth-hero .logo {
    width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 14px;
    background: linear-gradient(135deg, #3b6cff, #6f8cff);
    color: #fff; font-size: 26px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px rgba(43, 92, 255, .28);
}
.auth-hero h1 { font-size: 21px; margin: 0 0 6px; }
.auth-hero p { color: var(--sub); font-size: 13px; margin: 0; }

/* 阅读页 */
.read-wrap { padding-bottom: 10px; }
.timer-box { text-align: center; padding: 8px 0 14px; }
.timer-ring {
    width: 92px; height: 92px; margin: 0 auto 10px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: conic-gradient(var(--pri) 0deg, #e9eef7 0deg);
    position: relative;
}
.timer-ring::after {
    content: ''; position: absolute; inset: 8px; border-radius: 50%; background: #fff;
}
.timer-ring b { position: relative; z-index: 1; font-size: 22px; color: var(--pri-d); }
.timer-txt { font-size: 13px; color: var(--sub); }

.art-card {
    border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfcff;
}
.art-card .acc { font-size: 12px; color: var(--sub); }
.art-card .ttl { font-size: 15.5px; font-weight: 600; margin: 6px 0 10px; line-height: 1.5; }
.art-card .link { font-size: 12px; color: var(--sub); word-break: break-all; }

.num-display {
    height: 62px; border-radius: 12px; border: 2px dashed #cfdcff;
    background: #f8faff; display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; letter-spacing: 4px; color: var(--pri-d);
    margin: 14px 0 12px;
}
.num-display.empty { color: #b9c3d4; font-size: 15px; letter-spacing: 0; font-weight: 400; }
.num-display.shake { animation: shake .32s; border-color: var(--danger); color: var(--danger); }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.keypad button {
    padding: 15px 0; font-size: 20px; font-weight: 600;
    border: 1px solid var(--line); border-radius: 11px;
    background: #fff; color: var(--txt); cursor: pointer;
}
.keypad button:active { background: #eef3ff; }
.keypad button.fn { font-size: 14px; color: #5b6779; background: #f6f8fc; }
.keypad button.ok-btn {
    background: linear-gradient(135deg, #3b6cff, #2450e6); color: #fff; border: 0; font-size: 16px;
}
.keypad button:disabled { opacity: .4; }

/* 弹层 */
.mask {
    position: fixed; inset: 0; background: rgba(12, 22, 44, .5); z-index: 90;
    display: none; align-items: center; justify-content: center; padding: 24px;
}
.mask.show { display: flex; }
.dialog {
    background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 320px;
    text-align: center; animation: pop .22s;
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dialog .ico { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.dialog h4 { margin: 0 0 6px; font-size: 17px; }
.dialog p { margin: 0 0 16px; font-size: 13.5px; color: var(--sub); }
.dialog .btn { width: 100%; }

/* 空态 */
.empty { text-align: center; padding: 48px 20px; }
.empty .ico { font-size: 42px; margin-bottom: 12px; }
.empty h3 { margin: 0 0 6px; font-size: 17px; }
.empty p { color: var(--sub); font-size: 13.5px; margin: 0 0 20px; }

/* 底部操作条 */
.footbar {
    position: sticky; bottom: 0; background: linear-gradient(to top, #fff 60%, rgba(255,255,255,0));
    padding: 14px 0 6px; margin-top: 6px;
}

/* 加载 */
.loading { text-align: center; padding: 40px; color: var(--sub); font-size: 13px; }
