/* 净心打卡 · 全局样式（移动端优先） */
:root {
  --primary: #0e7c66;
  --primary-dark: #0a5c4c;
  --primary-light: #e6f4f0;
  --gold: #c9902f;
  --gold-light: #fbf3e3;
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #1f2d2a;
  --text-2: #5c6f6a;
  --border: #e3ebe8;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(14, 124, 102, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--primary); text-decoration: none; }
ul, ol { list-style: none; }

/* 顶部导航 */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 720px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--primary-dark); }
.logo-badge {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-user { font-size: 14px; color: var(--text-2); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 布局 */
.container { max-width: 720px; margin: 0 auto; padding: 0 16px 56px; }
.page { max-width: 720px; margin: 0 auto; padding: 16px 16px 56px; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.card h2 { font-size: 17px; margin-bottom: 12px; color: var(--text); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; font-size: 15px; font-weight: 600;
  padding: 10px 18px; border-radius: 12px; transition: all 0.15s ease;
  background: var(--primary); color: #fff; font-family: inherit;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 17px; border-radius: 14px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }

/* Hero 区 */
.hero { padding: 40px 0 28px; text-align: center; }
.hero h1 { font-size: 30px; line-height: 1.35; color: var(--primary-dark); letter-spacing: 0.5px; }
.hero p { margin-top: 12px; color: var(--text-2); font-size: 16px; max-width: 460px; margin-left: auto; margin-right: auto; }
.hero .btn { margin-top: 22px; }
.hero .hero-note { margin-top: 12px; font-size: 13px; color: var(--text-2); }

/* 区块标题 */
.section-title { font-size: 21px; margin: 32px 0 6px; color: var(--text); }
.section-sub { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }

/* 危害科普卡片 */
.harm-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.harm-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; display: flex; gap: 14px; align-items: flex-start;
}
.harm-icon {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px;
  background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.harm-card h3 { font-size: 15.5px; margin-bottom: 4px; }
.harm-card p { font-size: 13.5px; color: var(--text-2); }

/* 理性看待 / 行动建议 */
.perspective { background: var(--gold-light); border: 1px solid #eed9b0; border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.perspective h3 { color: #8a6119; font-size: 15.5px; margin-bottom: 6px; }
.perspective p, .perspective li { font-size: 13.5px; color: #6d5219; }
.perspective ul { margin-top: 6px; }
.steps { display: grid; grid-template-columns: 1fr; gap: 12px; }
.step { display: flex; gap: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.step-num {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.step h3 { font-size: 15px; margin-bottom: 2px; }
.step p { font-size: 13.5px; color: var(--text-2); }

/* 表单 */
.form-card { max-width: 400px; margin: 40px auto 0; }
.form-card h1 { font-size: 24px; text-align: center; color: var(--primary-dark); margin-bottom: 4px; }
.form-card .form-sub { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.input {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 12px; background: #fbfdfc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease; font-family: inherit;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.14); }
.form-error {
  background: #fdecea; color: var(--danger); border-radius: 10px;
  font-size: 13.5px; padding: 10px 12px; margin-bottom: 14px; display: none;
}
.form-error.show { display: block; }
.form-foot { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-2); }

/* 打卡面板 */
.greet { font-size: 14px; color: var(--text-2); margin: 24px 0 14px; text-align: center; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 10px; text-align: center;
}
.stat-card .num { font-size: 30px; font-weight: 800; color: var(--primary-dark); line-height: 1.2; }
.stat-card .num.gold { color: var(--gold); }
.stat-card .label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.checkin-zone { text-align: center; padding: 10px 0 4px; }
.checkin-btn {
  width: 100%; max-width: 340px; padding: 18px; font-size: 18px; font-weight: 700;
  border-radius: 18px; border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 8px 24px rgba(14, 124, 102, 0.28);
}
.checkin-btn:active { transform: scale(0.97); }
.checkin-btn.done { background: #e8efe9; color: #7c938c; box-shadow: none; cursor: default; }
.checkin-note { margin-top: 14px; }
.milestone { margin-top: 12px; font-size: 13.5px; color: var(--gold); font-weight: 600; }

/* 日历 */
.calendar { padding: 16px; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-title { font-weight: 700; font-size: 15px; }
.cal-nav { font-size: 14px; color: var(--text-2); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--text-2); font-size: 12px; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 13px; color: var(--text-2);
}
.cal-cell.empty { visibility: hidden; }
.cal-cell.today { outline: 2px solid var(--gold); outline-offset: -2px; }
.cal-cell.checked { background: var(--primary); color: #fff; font-weight: 600; }

/* 打卡记录 */
.record-list { display: flex; flex-direction: column; }
.record {
  display: flex; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); align-items: flex-start;
}
.record:last-child { border-bottom: none; }
.record-date { flex: 0 0 92px; font-weight: 600; font-size: 14px; color: var(--text); }
.record-note { font-size: 13.5px; color: var(--text-2); flex: 1; }
.record-empty { text-align: center; color: var(--text-2); font-size: 14px; padding: 20px 0; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: #1f2d2a; color: #fff; padding: 10px 18px; border-radius: 12px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 99; max-width: 86vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); }

.footer { text-align: center; padding: 32px 16px 20px; color: #9db0aa; font-size: 12.5px; }

/* 管理后台 */
.flex-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.flex-bar h2 { margin-bottom: 0; }
.search-bar { display: flex; gap: 8px; width: 100%; max-width: 320px; }
.search-bar .input { flex: 1; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-admin { background: var(--gold-light); color: #8a6119; }
.badge-banned { background: #fdecea; color: var(--danger); }
.badge-normal { background: var(--primary-light); color: var(--primary-dark); }
.ops { display: flex; gap: 6px; }
.ops .btn { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 21, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 78vh;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700;
}
.modal-head a { color: var(--text-2); font-size: 16px; }
.modal .record-list { overflow-y: auto; padding: 6px 18px 14px; }

/* 社群广场 */
.page-head { text-align: center; padding: 18px 0 6px; }
.page-head h1 { margin-bottom: 6px; }
.page-head .sub { color: var(--text-2); max-width: 520px; margin: 0 auto; }
.composer { margin-bottom: 18px; }
.textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; font-size: 14.5px; font-family: inherit;
  resize: vertical; min-height: 72px; box-sizing: border-box; color: var(--text);
  background: #fff; transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease;
}
.textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.composer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.counter { font-size: 12px; color: var(--text-2); }
.feed { display: flex; flex-direction: column; gap: 12px; }
.post { padding: 14px 16px; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-author { font-weight: 700; font-size: 14px; }
.post-time { color: var(--text-2); font-size: 12px; }
.post-del {
  margin-left: auto; color: var(--danger); font-size: 12px; cursor: pointer;
  opacity: 0.75; transition: opacity var(--dur-fast) ease;
}
.post-del:hover { opacity: 1; }
.post-content { font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.post-foot { margin-top: 10px; }
.reply-toggle { opacity: 0.85; }
.empty { text-align: center; color: var(--text-2); padding: 30px 0; font-size: 13.5px; }
.modal-body { overflow-y: auto; padding: 14px 18px 18px; font-size: 14px; }
.modal-post { font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.modal-time { color: var(--text-2); font-size: 12px; margin: 6px 0 14px; }
.replies { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--border); padding-top: 14px; }
.reply { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: baseline; }
.reply-author { font-weight: 600; font-size: 13px; color: var(--primary-dark); }
.reply-text { font-size: 14px; line-height: 1.6; word-break: break-word; }
.reply-time { grid-column: 2; color: var(--text-2); font-size: 11.5px; }
.reply-box { margin-top: 14px; }
.reply-login { margin-top: 14px; color: var(--text-2); font-size: 13px; }
.link { color: var(--primary); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* 自律榜单 */
.lb-head { text-align: center; padding: 18px 0 6px; }
.lb-meta { color: var(--text-2); font-size: 13px; text-align: center; margin-bottom: 18px; }
.lb-list { display: flex; flex-direction: column; gap: 10px; }
.lb-item {
  display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border); background: #fff;
}
.lb-rank { font-weight: 800; color: var(--text-2); font-size: 15px; text-align: center; }
.lb-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-total { color: var(--text-2); font-size: 12.5px; }
.lb-streak { text-align: right; font-weight: 800; font-size: 16px; color: var(--primary-dark); }
.lb-streak small { font-weight: 600; font-size: 11px; color: var(--text-2); }
.lb-me { box-shadow: 0 0 0 2px var(--primary); }
.lb-note { text-align: center; color: var(--text-2); font-size: 12px; margin-top: 16px; }

@media (min-width: 640px) {
  .harm-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 38px; }
}