/* 第一印象 · 样式：移动端优先，简洁清爽，暖色纸张质感（去 AI 化） */

:root {
  --paper: #faf7f0;         /* 纸张底色 */
  --card: #ffffff;
  --ink: #2b2b28;           /* 墨色 */
  --muted: #8a857a;         /* 灰 */
  --line: #e9e2d5;          /* 分隔线 */
  --accent: #c96f4a;        /* 暖陶土色（主按钮） */
  --accent-deep: #a95638;
  --good: #4f8a6b;          /* 通过 */
  --warn: #d29a3d;          /* 审核中 */
  --bad: #c0554a;           /* 不通过 */
  --star: #e6b23c;          /* 星级 */
  --shadow: 0 1px 3px rgba(60, 50, 40, .06), 0 6px 24px rgba(60, 50, 40, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ===== 通用 ===== */
.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 96px; /* 底部给 tabbar 留白 */
}

h1.brand {
  font-size: 32px;
  letter-spacing: 2px;
  margin: 0 0 4px;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14px;
}

h2 { font-size: 22px; margin: 8px 0 4px; }
h3.subhead { font-size: 16px; margin: 24px 0 8px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 12px; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: transform .05s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.primary:disabled { background: #d9c6b8; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: #f7e6e3; color: var(--bad); }
.btn.block { width: 100%; }

/* ===== 登录/注册 ===== */
#auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.seg {
  display: flex;
  background: #f1ece2;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  font-size: 15px;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
}
.seg-btn.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

.auth-form label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.auth-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  background: #fdfbf7;
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
.form-msg { font-size: 13px; min-height: 20px; margin: 10px 0 0; }
.form-msg.err { color: var(--bad); }
.form-msg.ok { color: var(--good); }

/* ===== 顶栏 / 底部导航 ===== */
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(250, 247, 240, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.topbar-brand { font-weight: 700; letter-spacing: 1px; }
.topbar-user { margin-left: auto; color: var(--muted); font-size: 13px; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 13px 0;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.tab.active { color: var(--accent); font-weight: 600; }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

/* ===== 上传 ===== */
.upload-box {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.upload-placeholder { text-align: center; color: var(--muted); }
.upload-plus { font-size: 44px; line-height: 1; color: var(--line); }
#upload-preview { width: 100%; max-height: 380px; object-fit: contain; display: block; }
.upload-actions { margin-top: 12px; }

/* 审核状态标签 */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.status-chip.pending { background: #faf0dc; color: var(--warn); }
.status-chip.approved { background: #e4f0e9; color: var(--good); }
.status-chip.rejected { background: #f7e6e3; color: var(--bad); }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--warn);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 广场 ===== */
.photo-frame {
  border-radius: var(--radius);
  overflow: hidden;
  background: #efe9dd;
  margin-bottom: 16px;
}
.photo-frame img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
}

.stars { display: flex; gap: 8px; justify-content: center; margin: 8px 0 4px; }
.star {
  font-size: 34px;
  cursor: pointer;
  color: #ddd4c4;
  user-select: none;
  transition: transform .08s ease;
}
.star.on { color: var(--star); }
.star:active { transform: scale(1.25); }
.rating-label { text-align: center; color: var(--muted); font-size: 13px; min-height: 20px; }

.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.tag-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fdfbf7;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}
.tag-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fdfbf7;
  resize: none;
}
textarea:focus { outline: none; border-color: var(--accent); }
.char-count { text-align: right; color: var(--muted); font-size: 12px; }

/* ===== 我的结果 ===== */
.stat-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0;
}
.stat-avg { font-size: 30px; font-weight: 700; }
.stat-stars { color: var(--star); letter-spacing: 2px; }
.tag-bar { margin: 8px 0; }
.tag-bar .tb-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.tag-bar .tb-track { height: 8px; background: #f1ece2; border-radius: 999px; overflow: hidden; }
.tag-bar .tb-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.review-item {
  border-top: 1px solid var(--line);
  padding: 10px 0;
  font-size: 14px;
}
.review-item .r-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.review-item .r-comment { margin: 4px 0 0; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 14px;
}

/* ===== 我的照片管理 ===== */
.manage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.manage-item:first-child { border-top: none; }
.manage-item img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.manage-item .mi-info { flex: 1; }
.manage-item .mi-meta { color: var(--muted); font-size: 12px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(43, 43, 40, .92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 99;
  max-width: 90vw;
  text-align: center;
}

/* ===== 首页 ===== */
.home-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}
.home-inner {
  width: 100%;
  max-width: 440px;
  text-align: center;
}
.home-inner .brand { font-size: 40px; letter-spacing: 4px; margin-bottom: 6px; }
.tagline { color: var(--muted); font-size: 15px; margin: 0 0 28px; letter-spacing: 1px; }
.intro-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: left;
  margin-bottom: 24px;
}
.intro-card p { margin: 0 0 10px; font-size: 15px; }
.intro-card p:last-child { margin-bottom: 0; }
.steps { text-align: left; margin-bottom: 28px; }
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 15px;
  color: var(--ink);
}
.step-n {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn.big { padding: 16px 24px; font-size: 17px; border-radius: 14px; }
.tos-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
}

/* ===== 广场（一张一屏） ===== */
.feed-card { padding: 14px; }
.feed-card .photo-frame { margin-bottom: 12px; }
.feed-card .photo-frame img { max-height: 480px; }

.feed-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.avg-score { font-size: 18px; font-weight: 700; color: var(--accent); }
.avg-count { font-size: 13px; color: var(--muted); }

.score-row { margin-bottom: 16px; }
.score-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.score-label { font-size: 14px; font-weight: 600; }
.score-value { font-size: 22px; font-weight: 700; color: var(--accent); }
.score-ends {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 6px;
  cursor: pointer;
}

.tag-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tag-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  background: #fdfbf7;
}
.tag-input-row input:focus { outline: none; border-color: var(--accent); }
.tag-chip.custom { border-style: dashed; }
