/* ===== 基础 ===== */
:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #8090a8;
    --line: #e6eaf2;
    --primary: #2f6bff;
    --primary-dark: #1f52d0;
    --green: #128c5a;
    --red: #dc3545;
    --warn: #d97706;
    --gold: #b7791f;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(31, 45, 70, .07);
}

* { box-sizing: border-box; }

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

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

h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.35; font-weight: 700; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 26px; padding-bottom: 40px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.req { color: var(--red); }
.text-red { color: var(--red) !important; }
.text-green { color: var(--green) !important; }
.text-primary { color: var(--primary) !important; }
.text-gold { color: var(--gold) !important; }
.text-gray { color: var(--muted) !important; }
.text-warn { color: var(--warn) !important; }

/* ===== 顶栏 ===== */
.topbar {
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(10px);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); font-size: 17px; }
.brand:hover { color: var(--text); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, #2f6bff, #6a8dff);
    color: #fff; font-weight: 800; font-size: 16px;
    box-shadow: 0 6px 14px rgba(47, 107, 255, .28);
    flex: none;
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
    color: #4b5563; padding: 8px 12px; border-radius: 9px; font-size: 14px; position: relative;
}
.nav a:hover { background: #f3f6ff; color: var(--primary); }
.nav a.on { background: #eef3ff; color: var(--primary); font-weight: 600; }
.dot {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 4px; margin-left: 5px;
    background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700;
}
.dot-sm { width: 8px; min-width: 8px; height: 8px; padding: 0; margin-right: 6px; }

/* ===== 卡片 ===== */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 20px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.hero-card {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: linear-gradient(120deg, #ffffff 0%, #f3f7ff 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 26px;
    margin-bottom: 20px;
}
.hero-card h2 { margin: 2px 0 4px; font-size: 28px; }
.hero-right { text-align: right; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 4px 0 20px; }
.page-head h2 { margin-bottom: 4px; }
.narrow-card { max-width: 520px; }
.tip-card { background: #fbfcff; }
.empty { text-align: center; padding: 20px; color: var(--muted); }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--primary); color: #fff;
    border: 1px solid var(--primary);
    padding: 10px 18px; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: .15s; line-height: 1.3;
    font-family: inherit;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn:disabled { background: #c9d3e6; border-color: #c9d3e6; cursor: not-allowed; color: #fff; }
.btn-light { background: #fff; color: #334155; border-color: var(--line); }
.btn-light:hover { background: #f5f7fc; color: var(--primary); border-color: #cfdcff; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #b02a37; border-color: #b02a37; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.link { color: var(--primary); font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; font-family: inherit; }

/* ===== 提示 ===== */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ===== 表单 ===== */
.form .field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d7dfec;
    border-radius: 9px;
    background: #fff;
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
    transition: .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
textarea { resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.radio-row { display: flex; flex-direction: column; gap: 6px; }
.radio, .checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.radio input, .checkbox input { width: auto; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; min-width: 180px; }
.inline-form input[type="text"] { min-width: 240px; }

/* ===== 栅格 / 统计 ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.gap { margin-bottom: 0; }
.grid-2 > .card { margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
}
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 28px; line-height: 1.2; }

/* ===== 列表 ===== */
.info-list { display: grid; grid-template-columns: 92px 1fr; gap: 10px 14px; margin: 0; }
.info-list dt { color: var(--muted); font-size: 14px; }
.info-list dd { margin: 0; }
.record-list, .msg-list { list-style: none; margin: 0; padding: 0; }
.record-list li {
    display: flex; justify-content: space-between; gap: 14px;
    padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.record-list li:last-child { border-bottom: 0; }
.record-right { text-align: right; white-space: nowrap; }
.msg-list li { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.msg-list li:last-child { border-bottom: 0; }
.msg-list a { color: var(--text); display: block; flex: 1; }
.msg-list a:hover { color: var(--primary); }
.msg-list li.unread .msg-title { font-weight: 700; }
.msg-title { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }

/* ===== 表格 ===== */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; background: #fafbff; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table-sm th, .table-sm td { padding: 8px 10px; font-size: 13px; }
.card-no { background: #f2f5fb; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 13px; word-break: break-all; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.7; white-space: nowrap; }
.tag-green { background: #e8f8f0; color: #0f7a4d; }
.tag-red { background: #fdecee; color: #b02a37; }
.tag-warn { background: #fff4df; color: #a15c00; }
.tag-gold { background: #fdf3dc; color: #8a5a00; }
.tag-gray { background: #f1f4f9; color: #6b7a90; }
.tag-blue { background: #e9f0ff; color: #2558d6; }

/* ===== 分页 ===== */
.pager { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.pager a {
    min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--line); color: #445068; font-size: 13px;
}
.pager a:hover { border-color: #c7d6ff; color: var(--primary); }
.pager a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-dots { color: var(--muted); padding: 0 4px; }

/* ===== 兑换 ===== */
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.level-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; }
.level-card.disabled { background: #fafbfe; }
.level-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.level-points { font-weight: 800; font-size: 18px; color: var(--primary); }
.level-card .btn { margin-top: 10px; }
.level-line {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.level-line:last-child { border-bottom: 0; }
.level-line strong { font-size: 16px; color: var(--primary); margin-right: 8px; }

/* ===== 公告 ===== */
.notice-item { border-top: 1px solid var(--line); padding: 10px 0; }
.notice-item:first-of-type { border-top: 0; }
.notice-item summary {
    display: flex; justify-content: space-between; gap: 12px; cursor: pointer;
    font-weight: 600; list-style: none;
}
.notice-item summary::-webkit-details-marker { display: none; }
.notice-text { font-size: 14px; color: #4b5563; line-height: 1.8; padding-top: 8px; }

/* ===== 登录页 ===== */
.auth-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 26px; align-items: start; margin-top: 10px; }
.auth-side { padding: 26px 8px; }
.auth-side h2 { font-size: 32px; margin-bottom: 12px; }
.auth-side p { color: #55637a; font-size: 15px; max-width: 460px; }
.auth-card { padding: 28px; }
.auth-links { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.feature-list { margin: 14px 0 0; padding-left: 20px; color: #4b5563; }
.feature-list li { margin-bottom: 6px; }

/* ===== 成功页 ===== */
.success-card { text-align: center; padding: 34px; }
.success-icon {
    width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%;
    background: #e8f8f0; color: var(--green); font-size: 26px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.success-card .btn-row { justify-content: center; }

/* ===== 后台 ===== */
.admin-body { background: #f2f4f9; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
    width: 232px; flex: none; background: #131a2b; color: #cbd5e1;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; gap: 10px; align-items: center; padding: 22px 20px 16px; color: #fff; }
.admin-brand strong { display: block; font-size: 15px; line-height: 1.4; }
.admin-brand small { color: #8ea0bd; font-size: 12px; }
.admin-nav { display: flex; flex-direction: column; padding: 8px; gap: 2px; overflow-y: auto; }
.admin-nav a { color: #b6c3d9; padding: 10px 14px; border-radius: 9px; font-size: 14px; }
.admin-nav a:hover { background: #1c2740; color: #fff; }
.admin-nav a.on { background: var(--primary); color: #fff; font-weight: 600; }
.admin-side-foot { margin-top: auto; padding: 14px 20px 20px; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; border-top: 1px solid #202b42; }
.admin-side-foot a { color: #8ea0bd; }
.admin-side-foot a:hover { color: #fff; }
.admin-main { flex: 1; padding: 24px 28px 40px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-top h1 { font-size: 22px; margin: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 7px 13px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: #4b5563; font-size: 13px; }
.tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.quick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.quick-link {
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px;
    font-weight: 700; color: var(--text); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
}
.quick-link span { font-weight: 400; color: var(--muted); font-size: 12px; }
.quick-link:hover { border-color: #c7d6ff; color: var(--primary); }
.row-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.row-actions form { display: inline; }
.act-details { margin-top: 4px; }
.act-details summary {
    cursor: pointer; list-style: none; color: var(--primary); font-weight: 600; font-size: 13px;
    display: inline-block; padding: 4px 0;
}
.act-details summary::-webkit-details-marker { display: none; }
.act-panel {
    margin-top: 8px; padding: 12px; background: #fbfcff; border: 1px solid var(--line); border-radius: 10px;
    min-width: 260px; max-width: 320px;
}
.act-panel .mini-form { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.act-panel .mini-form:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.act-panel label { display: block; font-size: 12px; font-weight: 600; margin: 6px 0 4px; color: #4b5563; }
.act-panel input, .act-panel select, .act-panel textarea { padding: 7px 9px; font-size: 13px; }
.mini-form .btn { margin-top: 8px; }

/* ===== 安装 / 登录盒子 ===== */
.install-body {
    margin: 0; min-height: 100vh; display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 16px; background: radial-gradient(circle at 20% 0%, #e7eeff, transparent 45%), var(--bg);
}
.install-box {
    width: 100%; max-width: 620px; background: #fff; border: 1px solid var(--line);
    border-radius: 18px; box-shadow: 0 20px 50px rgba(31, 45, 70, .12); padding: 30px;
}
.login-box { max-width: 420px; }
.install-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.install-head h1 { font-size: 21px; margin: 0; }
.install-head p { margin: 2px 0 0; font-size: 13px; }
.install-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.message-body { font-size: 14px; line-height: 1.9; color: #3f4a5c; white-space: pre-wrap; word-break: break-word; }

/* ===== 页脚 ===== */
.footer { border-top: 1px solid var(--line); background: #fff; padding: 18px 0; margin-top: 10px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #6b7a90; }

/* ===== 首页登记 / 公告 / 积分规则 ===== */
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 12px; }
.center { text-align: center; }
.home-wrap { max-width: 620px; margin: 8px auto 0; }
.home-head { text-align: center; margin: 6px 0 22px; }
.home-badge {
    display: inline-block; padding: 4px 10px; border-radius: 999px;
    background: #eef3ff; color: var(--primary); font-size: 12px; font-weight: 700;
    letter-spacing: .5px; margin-bottom: 10px;
}
.home-head h1 { font-size: clamp(22px, 5vw, 30px); margin-bottom: 8px; }
.home-head p { color: #5b6a80; margin: 0; }
.home-card { padding: 28px; box-shadow: 0 18px 44px rgba(31, 45, 70, .1); }
.home-form input { padding: 14px 16px; font-size: 16px; }
.home-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.home-links { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 24px 0 8px; color: var(--muted); font-size: 13px; }
.home-links a { color: #5b6a80; }
.home-links a:hover { color: var(--primary); }
.home-success { max-width: 620px; margin: 0 auto 20px; }
.home-login-tip { margin-top: 14px; }

.notice-top { margin-bottom: 18px; border-left: 4px solid var(--primary); }
.notice-top-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.notice-top-head h3 { margin: 0; }
.sub-title { font-size: 14px; color: #4b5563; margin: 18px 0 8px; }
.sub-title:first-of-type { margin-top: 12px; }
.rules-table td { line-height: 1.75; }

/* ===== 响应式 ===== */
@media (max-width: 980px) {
    .admin-shell { flex-direction: column; }
    .admin-side { width: 100%; height: auto; position: static; }
    .admin-nav { flex-direction: row; flex-wrap: wrap; }
    .admin-side-foot { border-top: 0; padding-top: 4px; }
    .admin-main { padding: 20px 16px 30px; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-side { padding: 6px 4px; }
}
@media (max-width: 760px) {
    .grid-2 { grid-template-columns: 1fr; }
    .hero-card { flex-direction: column; align-items: flex-start; }
    .hero-right { text-align: left; }
    .topbar-inner { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
    .nav a { padding: 6px 9px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .card { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .install-box { padding: 20px; }
    .home-card { padding: 20px; }
    .home-wrap { margin-top: 0; }
    .home-card-foot { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .info-list { grid-template-columns: 78px 1fr; }
    .home-head h1 { font-size: 22px; }
    .home-head p { font-size: 14px; }
    .home-card { padding: 16px; border-radius: 12px; }
    .btn-lg { width: 100%; }
    .page-head h2 { font-size: 20px; }
    .topbar-inner { height: auto; padding: 10px 0; gap: 8px; }
    .brand { font-size: 15px; }
    .brand-mark { width: 28px; height: 28px; font-size: 14px; }
    .nav { width: 100%; justify-content: flex-start; gap: 2px; }
    .nav a { padding: 5px 8px; font-size: 13px; }
}
