:root {
  --bg: #141416;
  --bg-elev: #1e1e22;
  --bg-elev2: #2a2a30;
  --text: #f0f0f2;
  --text-dim: #9a9aa2;
  --accent: #e8b04b;
  --accent-soft: rgba(232, 176, 75, 0.16);
  --danger: #e05c5c;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  min-height: 100%;
}

body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

/* ---------- 登录页 ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--bg-elev);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
}
.login-logo { font-size: 44px; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; font-weight: 600; }
.login-sub { color: var(--text-dim); font-size: 13px; margin: 8px 0 22px; }
.login-error {
  background: rgba(224, 92, 92, 0.15);
  color: var(--danger);
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.login-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--bg-elev2);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  margin-bottom: 14px;
  outline: none;
}
.login-input:focus { border-color: var(--accent); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(20, 20, 22, 0.92);
  backdrop-filter: blur(10px);
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
}
.topbar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
.search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1px solid var(--bg-elev2);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }

/* ---------- 筛选 ---------- */
.filter-bar {
  padding: 10px 14px 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 18px;
  border: 1px solid var(--bg-elev2);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.chip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

/* ---------- 图片网格 ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px 14px;
}
.photo-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  aspect-ratio: 3 / 4;
  cursor: pointer;
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-badges {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.badge {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
}
.empty-tip {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
  font-size: 14px;
}

/* ---------- 悬浮按钮 ---------- */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #1a1a1a;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 4px 18px rgba(232, 176, 75, 0.4);
  cursor: pointer;
  z-index: 30;
}

/* ---------- 弹层 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
/* .sheet-mask 的 display:flex 会覆盖 hidden 属性默认的 display:none，必须显式声明 */
.sheet-mask[hidden] { display: none; }
.sheet {
  background: var(--bg-elev);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.22s ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-elev2);
  flex-shrink: 0;
}
.sheet-title { font-size: 16px; font-weight: 600; }
.sheet-body {
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.text-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
}
.text-btn.accent { color: var(--accent); font-weight: 600; }
.text-btn.danger { color: var(--danger); }
.detail-actions { display: flex; gap: 4px; }

/* ---------- 上传表单 ---------- */
.upload-area {
  border: 1.5px dashed var(--bg-elev2);
  border-radius: var(--radius);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg);
}
.upload-area.has-img { border-style: solid; }
.upload-area img { max-width: 100%; max-height: 320px; object-fit: contain; }
.upload-hint { color: var(--text-dim); text-align: center; font-size: 14px; line-height: 1.7; }
.upload-hint small { font-size: 12px; opacity: 0.7; }

.form-label { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.text-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--bg-elev2);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
  resize: vertical;
}
.text-input:focus { border-color: var(--accent); }
.suggest-row { flex-wrap: wrap; overflow: visible; }
.suggest-row .chip { font-size: 12px; padding: 4px 10px; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #1a1a1a; font-weight: 600; }
.btn-block { width: 100%; }

/* ---------- 详情 ---------- */
.detail-sheet { max-width: 640px; }
.detail-img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg);
}
.detail-meta { display: flex; flex-direction: column; gap: 10px; padding-bottom: 10px; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-note { color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.meta-empty { color: var(--text-dim); font-size: 13px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 14px;
  z-index: 99;
  animation: slideUp 0.2s ease;
}
