/* ========== 基础 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --accent: #f6c945;
    --text: #2d2d2d;
    --muted: #8a8a8a;
    --card: #ffffff;
    --bg: #fff5f0;
    --border: #eee;
}
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: 15px; }

.container { max-width: 640px; margin: 0 auto; padding: 14px 14px 40px; }

/* ========== 顶栏 ========== */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.topbar-inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.brand-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.mainnav { display: flex; gap: 4px; }
.mainnav a { padding: 6px 10px; border-radius: 16px; font-size: 14px; opacity: .85; }
.mainnav a.on, .mainnav a:active { background: rgba(255,255,255,.22); opacity: 1; }

/* ========== 皮肤主题 ========== */
.skin-red { --primary: #b03a2e; --primary-dark: #7b241c; --accent: #d4a017; --bg: #fbeae7; }
.skin-blackgold { --primary: #1c1c1c; --primary-dark: #000; --accent: #d4af37; --bg: #f3f0e8; --card: #fff; }
.skin-fresh { --primary: #27ae60; --primary-dark: #1e8449; --accent: #a8e6cf; --bg: #f2faf5; }
.skin-blackgold .topbar { background: #1c1c1c; }

/* ========== 统计条 ========== */
.stats-bar { display: flex; gap: 10px; margin: 14px 0; }
.stat-chip { flex: 1; background: var(--card); border-radius: 14px; padding: 12px 8px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.stat-chip .num { display: block; font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-chip .lbl { font-size: 12px; color: var(--muted); }

.nick-row { display: flex; align-items: center; justify-content: space-between; margin: -6px 2px 12px; }
.nick-name { font-size: 14px; color: #555; }

/* ========== 公告 ========== */
.notice-bar { background: #fff8e6; border: 1px solid #f5d98b; color: #8a6d1a; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }

/* ========== 转盘 ========== */
.wheel-section { text-align: center; padding: 10px 0 20px; }
.wheel-wrap { position: relative; width: 320px; max-width: 88vw; margin: 0 auto 18px; }
#wheelCanvas { width: 100%; height: auto; display: block; }
.wheel-pointer {
    position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent;
    border-top: 26px solid var(--accent); z-index: 5; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3));
}
.wheel-pointer::after { content: ''; position: absolute; top: -30px; left: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.draw-tip { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ========== 按钮 ========== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 12px; padding: 11px 18px; cursor: pointer; font-size: 15px; font-weight: 600; transition: opacity .15s; }
.btn:active { opacity: .85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-draw { background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; font-size: 18px; padding: 14px 40px; border-radius: 30px; box-shadow: 0 6px 18px rgba(231,76,60,.35); }
.btn-draw:disabled { opacity: .5; }
.btn-ghost { background: #f1f1f1; color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-danger { background: #fdecea; color: #c0392b; }

/* ========== 面板 / 列表 ========== */
.panel { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.panel-title { font-size: 16px; margin-bottom: 10px; }
.panel-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.rules-text { font-size: 14px; color: #555; white-space: normal; }

.prize-list { list-style: none; }
.prize-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.prize-item:last-child { border-bottom: none; }
.prize-icon { font-size: 22px; }
.prize-name { flex: 1; font-weight: 600; }
.prize-meta { font-size: 12px; color: var(--muted); }

/* ========== 任务卡片 ========== */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: #fff; }
.task-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.task-title { font-weight: 700; font-size: 15px; }
.tag { font-size: 12px; padding: 3px 8px; border-radius: 10px; background: #f1f1f1; color: #666; }
.tag-type { background: #fff0ec; color: var(--primary); }
.tag-repeat { background: #eafaf1; color: #27ae60; }
.task-image { border-radius: 10px; margin: 8px 0; }
.task-desc { font-size: 13px; color: #555; margin-bottom: 8px; }
.task-reward { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.reward-item { font-size: 13px; font-weight: 600; color: #b9770e; background: #fef5e7; padding: 4px 10px; border-radius: 10px; }
.task-foot { display: flex; align-items: center; justify-content: space-between; }
.task-status { font-size: 13px; font-weight: 600; }
.task-status.status-none { color: var(--muted); }
.task-status.status-pending { color: #b9770e; }
.task-status.status-approved { color: #27ae60; }
.task-status.status-rejected { color: #c0392b; }
.task-done { font-size: 13px; color: #27ae60; }
.task-reject-note { margin-top: 8px; font-size: 12px; color: #c0392b; }

/* ========== 记录列表 ========== */
.record-list { list-style: none; }
.record-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.record-item:last-child { border-bottom: none; }
.record-main { min-width: 0; }
.record-name { display: block; font-weight: 600; font-size: 14px; }
.record-meta { display: block; font-size: 12px; color: var(--muted); }
.record-meta.note { color: #c0392b; }
.record-value { font-weight: 700; white-space: nowrap; }
.record-value.plus { color: #27ae60; }
.record-value.minus { color: #c0392b; }
.record-link { font-size: 13px; color: var(--primary); white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; font-size: 14px; }

/* ========== 兑换 / 邀请 ========== */
.exchange-row { display: flex; gap: 10px; }
.exchange-row select { flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fff; }
.invite-code-box { font-size: 30px; font-weight: 800; letter-spacing: 8px; text-align: center; background: #fff8e6; border: 1px dashed #f5d98b; border-radius: 14px; padding: 18px 0; margin: 10px 0; color: var(--primary); }
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fff; min-width: 0; }
.invite-stats { display: flex; gap: 10px; margin: 14px 0; }
.invite-rules { margin-top: 10px; padding-left: 18px; font-size: 13px; color: #555; }
.invite-rules li { margin-bottom: 6px; }

/* ========== 表单 ========== */
.form-item { margin-bottom: 12px; }
.form-item label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-item input[type=text], .form-item input[type=number], .form-item input[type=password],
.form-item select, .form-item textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: #fff;
}
.form-item textarea { resize: vertical; }
.req { color: #c0392b; }
.preview { margin-top: 8px; border-radius: 10px; max-height: 160px; object-fit: cover; }
.submit-link-box { margin-bottom: 12px; }

/* ========== 弹窗 ========== */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.hidden { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-card { position: relative; background: #fff; border-radius: 18px; padding: 22px; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-card h3 { margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.result-card { text-align: center; }
.result-icon { font-size: 52px; margin-bottom: 10px; }
.result-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.result-desc { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

/* ========== 页脚 ========== */
.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px 30px; }
