/* YouMakeBetter 站点样式
 * ============================================================================
 * 一份样式表管三个页面（index.html / case.html），靠 body 上的类区分。
 * 不引任何外部字体和 CDN —— 站点要能在断网环境完整打开。
 *
 * 组织顺序：变量 → 基础 → 通用组件（按钮/徽章/进度条）→ 顶栏 → 首页各区块
 *           → 详情页 → 弹窗与表单 → 响应式
 * ========================================================================== */

:root {
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e4e7ec;
  --line-2: #f2f4f7;
  --paper: #ffffff;
  --surface: #f7f8fb;
  --surface-2: #fbfbfd;
  --accent: #ff5c35;
  --accent-dark: #d93f19;
  --accent-soft: #fff1ec;
  --green: #12805c;
  --green-soft: #e9f7f1;
  --blue: #175cd3;
  --blue-soft: #eff4ff;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.12);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --content: 1200px;
}

* {
  box-sizing: border-box;
}

/* 【踩过的坑】这一条必须有。
 * HTML 的 `hidden` 属性靠浏览器默认样式 `display:none` 生效，而那条默认样式的
 * 优先级**低于**任何类选择器 —— 也就是说，只要某个元素同时有 `hidden`
 * 和一个设了 `display` 的类（比如 `.auth-dialog{display:grid}`、
 * `.mobile-nav{display:grid}`、`.user-chip{display:flex}`），
 * `hidden` 就会失效，弹窗和菜单会在页面加载时直接摊开。
 * 用 !important 是这里唯一正确的选择：它的语义就是"说了要隐藏就必须隐藏"。 */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  /* 顶栏是 sticky 的，锚点跳转时要给它留出高度，否则标题被压在栏下面 */
  scroll-padding-top: 88px;
}

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

h1, h2, h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

svg {
  display: block;
  width: 100%;
  height: auto;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- 通用组件 */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button-secondary {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

.button-secondary:hover {
  border-color: var(--ink);
}

.button-quiet {
  color: var(--ink-2);
  background: transparent;
}

.button-quiet:hover {
  background: var(--line-2);
}

.button-large {
  padding: 13px 26px;
  font-size: 15px;
}

.button-tiny {
  padding: 6px 13px;
  font-size: 13px;
}

.button:disabled,
.button.is-done {
  cursor: default;
  opacity: 0.65;
  transform: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-soft {
  color: var(--muted);
  background: var(--line-2);
  font-weight: 600;
}

.badge-mine {
  color: var(--blue);
  background: var(--blue-soft);
}

.progress-track {
  position: relative;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--line-2);
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ff8a5c);
  transition: width 0.5s ease;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.form-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--green);
  font-size: 13px;
}

.form-status.is-error {
  color: #b42318;
}

.inline-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state a {
  color: var(--accent-dark);
  font-weight: 700;
}

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(12px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(calc(100% - 40px), var(--content));
  min-height: 70px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: var(--ink);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.brand-text strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.brand-text small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.mainnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.mainnav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.mainnav a:hover {
  color: var(--ink);
  background: var(--line-2);
}

.searchbar {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 120px;
  max-width: 300px;
  margin-left: auto;
}

.searchbar input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  outline: none;
}

.searchbar input:focus {
  border-color: var(--accent);
  background: var(--paper);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted-2);
  font-size: 15px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.user-meta strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.user-meta small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.menu-toggle {
  display: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
}

.mobile-nav {
  display: grid;
  gap: 2px;
  padding: 8px 20px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.mobile-nav a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.mobile-nav a:hover {
  background: var(--line-2);
}

/* ---------------------------------------------------------------- 首屏 */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 48px;
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 64px 0 56px;
}

.hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.hero-summary {
  max-width: 560px;
  color: var(--ink-2);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.trust-list {
  display: grid;
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.trust-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
}

.trust-list li::before {
  content: "—";
  color: var(--accent);
  font-weight: 800;
}

.trust-list strong {
  flex: none;
}

.trust-list span {
  color: var(--muted);
}

.stat-board {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.stat-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.stat-board-head h2 {
  font-size: 17px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.live-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat-grid li {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
}

.stat-grid strong {
  display: block;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.stat-grid span {
  color: var(--muted);
  font-size: 12px;
}

.stat-note {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.stat-note strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.stat-note p {
  color: var(--muted);
  font-size: 13px;
}

.mini-stages {
  display: grid;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.mini-stages li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.mini-no {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--line-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mini-stages small {
  color: var(--muted);
}

/* ---------------------------------------------------------------- 分类条 */

.category-bar {
  position: sticky;
  z-index: 90;
  top: 70px;
  display: flex;
  gap: 8px;
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 16px 0;
  overflow-x: auto;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-chip em {
  color: var(--muted-2);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.cat-chip:hover {
  border-color: var(--ink);
}

.cat-chip.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.cat-chip.active em {
  color: rgba(255, 255, 255, 0.7);
}

/* ---------------------------------------------------------------- 区块 */

.section {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 56px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 900;
}

.section-hint {
  max-width: 380px;
  color: var(--muted);
  font-size: 13px;
}

.section-tools select {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------------------------------------------------------------- 案卷卡片 */

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
}

.case-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.case-card:hover {
  border-color: #d0d5dd;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.case-card.is-mine {
  border-color: #b2ccff;
  background: linear-gradient(180deg, var(--blue-soft), var(--paper) 42%);
}

.case-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.case-title {
  margin-bottom: 6px;
  font-size: 19px;
  font-weight: 800;
}

.case-title a {
  text-decoration: none;
}

.case-title a:hover {
  color: var(--accent-dark);
}

.case-tagline {
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.case-pain {
  flex: 1;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13.5px;
}

.progress-line {
  margin-bottom: 14px;
}

.progress-text {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.progress-text strong {
  color: var(--ink);
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 12px;
}

.case-meta strong {
  color: var(--ink);
}

.case-when {
  margin-left: auto;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.case-tags span {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ---------------------------------------------------------------- 八步闭环 */

.loop-section {
  padding-top: 64px;
}

.loop-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.loop-steps li {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.step-no {
  display: block;
  margin-bottom: 10px;
  color: var(--line);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.loop-steps h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.loop-steps p {
  color: var(--muted);
  font-size: 13.5px;
}

.loop-steps small {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11.5px;
  font-weight: 700;
}

.redlines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 28px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
}

.redlines strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.redlines p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

/* ---------------------------------------------------------------- 社区 + 榜 */

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 40px;
  align-items: start;
}

.feed {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed li {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
}

.feed li:hover {
  background: var(--surface-2);
}

.feed p {
  font-size: 14px;
}

.feed a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.feed a:hover {
  text-decoration: underline;
}

.feed small {
  color: var(--muted-2);
  font-size: 12px;
}

.community-note {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.community-note h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.community-note p {
  color: var(--muted);
  font-size: 13.5px;
}

.board {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.board li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.rank {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--line-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rank-1 { background: #fff1ec; color: var(--accent-dark); }
.rank-2 { background: #eff4ff; color: var(--blue); }
.rank-3 { background: #fffaeb; color: var(--amber); }

.board-body {
  flex: 1;
  min-width: 0;
}

.board-body p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.board-title {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.board-body small {
  color: var(--muted);
  font-size: 12px;
}

.board-exp {
  flex: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 800;
}

/* ---------------------------------------------------------------- 发起案卷 */

.start-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 1fr);
  gap: 48px;
  align-items: start;
  padding: 56px 40px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.start-copy h2 {
  margin-bottom: 16px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 900;
}

.start-copy > p {
  max-width: 460px;
  color: var(--ink-2);
}

.start-tips {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
}

.start-tips li {
  display: flex;
  gap: 10px;
}

.start-tips li::before {
  content: "→";
  color: var(--accent);
  font-weight: 800;
}

.start-tips strong {
  flex: none;
}

.start-tips li {
  color: var(--muted);
}

.start-tips strong {
  color: var(--ink);
}

/* ---------------------------------------------------------------- 表单 */

.pitch-form,
.auth-card form {
  display: grid;
  gap: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.field {
  position: relative;
  display: grid;
  gap: 7px;
}

.field label,
.field-label {
  font-size: 13px;
  font-weight: 700;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="search"],
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
  outline: none;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: var(--paper);
}

.counter {
  position: absolute;
  right: 2px;
  top: 0;
  color: var(--muted-2);
  font-size: 12px;
}

.counter em {
  font-style: normal;
  font-weight: 700;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-radio input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.chip-radio span {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.chip-radio input:checked + span {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.chip-radio input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.checkline input {
  margin-top: 3px;
  flex: none;
}

/* ---------------------------------------------------------------- 品牌收尾 */

.closing {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 72px 0 88px;
  text-align: center;
}

.closing h2 {
  margin-bottom: 16px;
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.closing > p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--ink-2);
}

.closing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

/* ---------------------------------------------------------------- 页脚 */

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1fr;
  gap: 40px;
  padding: 52px max(20px, calc((100% - var(--content)) / 2));
  background: var(--ink);
  color: #fff;
}

.footer-brand strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer-nav h3 {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.footer-nav a {
  display: block;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  text-decoration: none;
}

.footer-nav a:hover {
  color: #fff;
}

.footer-close {
  text-align: right;
}

.footer-close span {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.footer-close strong {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

/* ---------------------------------------------------------------- 登录弹窗 */

.auth-dialog {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(3px);
}

.dialog-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--line-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  background: var(--line);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
}

.auth-tabs button {
  flex: 1;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.auth-card h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

.auth-intro {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13.5px;
}

.auth-card form {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.role-field {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.role-field legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 700;
}

.role-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.role-option:hover {
  background: var(--surface-2);
}

.role-option input {
  margin-top: 4px;
  flex: none;
}

.role-option strong {
  display: block;
  font-size: 14px;
}

.role-option small {
  color: var(--muted);
  font-size: 12.5px;
}

.auth-foot {
  margin: 0;
  color: var(--muted-2);
  font-size: 12px;
}

.noscript-warning {
  padding: 16px 20px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 14px;
  text-align: center;
}

/* ================================================================ 详情页 */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 20px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.not-found {
  width: min(calc(100% - 40px), var(--content));
  margin: 40px auto;
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

.case-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 40px;
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.case-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.case-hero-copy h1 {
  margin-bottom: 12px;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 900;
}

.case-hero-tagline {
  margin-bottom: 18px;
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 700;
}

.case-hero-pain {
  max-width: 620px;
  color: var(--ink-2);
}

.case-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.case-hero-meta {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

/* 关卡面板 */

.stage-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.stage-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.stage-panel-head h2 {
  font-size: 17px;
}

.stage-progress-big {
  margin-bottom: 22px;
}

.stage-progress-big p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.stage-progress-big strong {
  color: var(--ink);
}

.stage-roadmap {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-roadmap li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.stage-roadmap li.done {
  color: var(--muted);
}

.stage-roadmap li.active {
  background: var(--paper);
  border: 1px solid var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.stage-roadmap li.locked {
  color: var(--muted-2);
}

.roadmap-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--line-2);
  font-size: 11px;
  font-weight: 800;
}

.stage-roadmap li.done .roadmap-mark {
  color: #fff;
  background: var(--green);
}

.stage-roadmap li.active .roadmap-mark {
  color: #fff;
  background: var(--accent);
}

.stage-roadmap li div {
  flex: 1;
  min-width: 0;
}

.stage-roadmap li small {
  display: block;
  color: var(--muted-2);
  font-size: 11.5px;
}

.roadmap-side {
  flex: none;
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 700;
}

.stage-foot {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

/* 双栏主体 */

.case-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 28px;
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding-bottom: 72px;
  align-items: start;
}

.case-main-column,
.case-side-column {
  display: grid;
  gap: 20px;
}

.panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.panel h2 {
  margin-bottom: 14px;
  font-size: 17px;
}

.panel p {
  color: var(--ink-2);
  font-size: 14.5px;
}

.panel-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.panel-tight {
  padding: 20px;
}

.timeline {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
}

.timeline-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.timeline strong {
  font-size: 13px;
}

.timeline p {
  color: var(--muted);
  font-size: 13.5px;
}

/* 讨论 */

.threads {
  display: grid;
  gap: 16px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.threads li {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-2);
}

.threads li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.thread-body {
  flex: 1;
  min-width: 0;
}

.thread-role,
.thread-when {
  margin-left: 8px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.thread-role {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--line-2);
  color: var(--muted);
  font-weight: 700;
}

.thread-text {
  margin: 4px 0 8px;
  color: var(--ink-2);
  font-size: 14px;
}

.like-button {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12px;
  cursor: pointer;
}

.like-button:hover:not(:disabled) {
  border-color: var(--ink);
}

.like-button em {
  font-style: normal;
  font-weight: 700;
}

.reply-form {
  display: grid;
  gap: 10px;
}

.reply-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 14px;
  outline: none;
  resize: vertical;
}

.reply-form textarea:focus {
  border-color: var(--accent);
  background: var(--paper);
}

.reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reply-actions .counter {
  position: static;
}

.people-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.rule-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.rule-list li {
  display: flex;
  gap: 8px;
}

.rule-list li::before {
  content: "·";
  color: var(--accent);
  font-weight: 900;
}

.other-cases {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.other-cases a {
  display: block;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.other-cases a:hover {
  color: var(--accent-dark);
}

.other-cases small {
  color: var(--muted);
  font-size: 12px;
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 1080px) {
  .hero,
  .case-hero,
  .split-section,
  .start-section {
    grid-template-columns: 1fr;
  }

  .case-columns {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 36px;
    padding-top: 44px;
  }

  .start-section {
    padding: 40px 28px;
    gap: 32px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-close {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .mainnav,
  .searchbar {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .topbar-inner {
    gap: 12px;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .user-meta {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14.5px;
  }

  .topbar-inner,
  .hero,
  .section,
  .closing,
  .breadcrumb,
  .case-hero,
  .case-columns,
  .category-bar {
    width: min(calc(100% - 32px), var(--content));
  }

  .brand-text {
    display: none;
  }

  .hero {
    padding: 32px 0 36px;
  }

  .hero-actions .button,
  .case-hero-actions .button,
  .closing-actions .button {
    flex: 1 1 auto;
  }

  .stat-grid strong {
    font-size: 22px;
  }

  .case-grid {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    grid-template-columns: 1fr 1fr;
  }

  .category-bar {
    top: 70px;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .panel,
  .case-card,
  .dialog-card {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
