/* ============================================
   白袍之外 · MedHub · 极简线条风格
   ============================================ */

:root {
  /* 颜色 — 黑白灰主导,单一橙色强调 */
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --surface: #ffffff;
  --surface-2: #f5f5f5;

  --primary: #c84a2c;
  --primary-soft: #fdf2ec;
  --primary-deep: #a83a20;

  --text-1: #111111;
  --text-2: #555555;
  --text-3: #999999;
  --text-on-primary: #ffffff;

  --border: #e5e5e5;
  --border-strong: #cccccc;

  /* 阴影 — 几乎不用 */
  --shadow-sm: none;

  /* 圆角 — 极小 */
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-full: 999px;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ================= Layout ================= */
html, body { min-height: 100vh; }
body {
  display: flex;
  flex-direction: column;
}
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px 0;
  box-sizing: border-box;
}
#app > nav { flex: 0 0 auto; }
/* view 容器:自然高度即可,让页脚通过 margin-top:auto 贴底 */
#app > div,
#app > section,
#app > article,
#app > form,
#app > .form-page,
#app > .loading,
#app > .empty {
  flex: 0 0 auto;
}

/* ================= Top Nav ================= */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  margin: 0 -40px;
  padding-left: 40px;
  padding-right: 40px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand-divider { color: var(--text-3); font-weight: 400; }

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s;
}

.nav-link:hover { color: var(--text-1); background: var(--surface-2); }
.nav-link.active {
  color: var(--text-1);
  background: var(--surface-2);
  font-weight: 600;
}

/* ================= Hero ================= */
.hero {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.hero-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: 0.2px;
  line-height: 1.4;
}

.hero-title .accent { color: var(--primary-deep); }

.hero-slogan {
  color: var(--text-3);
  font-size: 12px;
  margin: 0;
}

/* ================= Filter Bar(单行)================= */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar .search-input {
  flex: 1;
  min-width: 160px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.12s;
}

.filter-bar .search-input:focus {
  border-color: var(--border-strong);
}

.filter-dropdown {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  position: relative;
  flex-shrink: 0;
}

.filter-dropdown-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-1);
  user-select: none;
  white-space: nowrap;
}

.filter-dropdown-head:hover { background: var(--surface-2); }

.filter-dropdown-label-key { color: var(--text-3); }
.filter-dropdown-label-val { font-weight: 500; }

.filter-dropdown-arrow {
  font-size: 9px;
  color: var(--text-3);
  transition: transform 0.15s;
  margin-left: 2px;
}

.filter-dropdown.open .filter-dropdown-arrow {
  transform: rotate(180deg);
}

.filter-dropdown-body {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 200px;
  max-width: 320px;
  max-height: 320px;
  overflow-y: auto;
}

.filter-dropdown.open .filter-dropdown-body {
  display: block;
}

.filter-dropdown-body .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text-1);
}

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

/* ================= Grid Feed ================= */
.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.post-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 0.12s, background 0.12s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}

.post-card:hover {
  border-color: var(--text-2);
  background: var(--surface-2);
}

.post-card.expired { opacity: 0.55; }

.post-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-3);
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
  background: var(--text-2);
}

.author-name {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-1);
  text-decoration: none;
}
.author-name:hover { color: var(--primary-deep); text-decoration: underline; }

.author-tag {
  display: inline-block;
  padding: 1px 5px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 10px;
  border-radius: 2px;
  font-weight: 500;
}

.author-tag.doctor { color: var(--primary-deep); }
.author-tag.master { color: #2a5a8a; }
.author-tag.bachelor { color: #8a6a2a; }

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: auto;
}

.type-badge.job { background: transparent; color: var(--primary-deep); border: 1px solid var(--primary-soft); }
.type-badge.experience { background: transparent; color: var(--text-2); border: 1px solid var(--border); }

.post-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.5;
  color: var(--text-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 4px;
}

.post-meta-item { display: inline-flex; align-items: center; gap: 3px; }

.post-excerpt {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 6px;
  flex: 1;
}

.post-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 4px; }

.post-tag {
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 10px;
  background: var(--surface-2);
  color: var(--text-2);
}

.deadline-warn {
  font-size: 10px;
  color: var(--primary-deep);
}
.deadline-ok {
  font-size: 10px;
  color: var(--text-3);
}
.expired-tag {
  font-size: 10px;
  color: var(--text-3);
  text-decoration: line-through;
}

.post-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  transition: color 0.12s;
  padding: 1px 3px;
}

.action-btn:hover { color: var(--text-1); }
.action-btn.liked { color: var(--primary-deep); }
.action-btn.favorited { color: #b08020; }
.action-btn .icon { font-size: 12px; line-height: 1; }

/* ================= Comments ================= */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-item {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.comment-item .avatar {
  flex-shrink: 0;
}

.comment-item.warn {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.warn-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.action-btn.warn {
  color: var(--text-3);
}
.action-btn.warn:hover { color: var(--primary-deep); background: var(--primary-soft); }
.action-btn.warn .icon { color: var(--primary-deep); }

/* ================= Image Upload ================= */
.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.image-preview.single {
  grid-template-columns: minmax(120px, 200px);
}

.image-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-remove:hover { background: rgba(0, 0, 0, 0.85); }

.image-add {
  width: 100%;
  aspect-ratio: 1;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s, color 0.12s;
}

.image-add:hover:not(:disabled) {
  border-color: var(--text-1);
  color: var(--text-1);
}

.image-add:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* 帖子详情里的图片 grid */
.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.post-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
  cursor: zoom-in;
}

/* ================= Empty State ================= */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.empty-icon { font-size: 28px; margin-bottom: 8px; opacity: 0.5; }
.empty-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty-text { color: var(--text-2); margin-bottom: 14px; font-size: 12px; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 12px;
  transition: all 0.12s;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--text-1);
  color: #fff;
  border-color: var(--text-1);
}
.btn-primary:hover { background: #000; }

.btn-secondary {
  background: #fff;
  color: var(--text-1);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { color: var(--text-1); }

.btn-block { width: 100%; }
.btn-lg { padding: 10px 20px; font-size: 13px; }

/* ================= Forms ================= */
#app > .form-page,
.form-page { max-width: min(95%, 600px); margin: 0 auto; }
#app > .form-page-wide,
.form-page-wide { max-width: min(98%, 1600px); margin: 0 auto; }

.page-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: 0.2px;
}

.page-sub { color: var(--text-2); margin: 0 0 18px; font-size: 12px; }

.type-switch {
  display: flex;
  background: #fff;
  padding: 3px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  width: fit-content;
}

.type-switch-btn {
  padding: 6px 16px;
  border-radius: 2px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s;
}

.type-switch-btn.active {
  background: var(--text-1);
  color: #fff;
}

.form-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border);
}

.field { margin-bottom: 12px; }

.field-label {
  display: block;
  font-weight: 500;
  font-size: 12px;
  margin-bottom: 5px;
  color: var(--text-1);
}

.field-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
}

.field-input,
.field-textarea,
.field-select {
  width: 100%;
  padding: 8px 11px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-1);
  transition: border-color 0.12s;
  outline: none;
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--text-1);
}

.field-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .row-2 { grid-template-columns: 1fr; }
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.radio-pill {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}

.radio-pill:hover { border-color: var(--border-strong); }
.radio-pill.active {
  border-color: var(--text-1);
  background: var(--text-1);
  color: #fff;
}

/* ================= Profile ================= */
.profile-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-card .avatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.profile-info { flex: 1; min-width: 0; }

.profile-name {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: 0.1px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.profile-tag {
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
}

.profile-intro {
  font-size: 12px;
  color: var(--text-2);
  margin: 4px 0 0;
  line-height: 1.55;
}

.profile-actions { display: flex; flex-direction: column; gap: 4px; }

.profile-contact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}
.profile-contact a { color: var(--primary-deep); }
.profile-contact a:hover { text-decoration: underline; }

/* ================= Section ================= */
.section { margin-bottom: 16px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: var(--text-1);
}

.tab-switch { display: flex; gap: 4px; }

.tab-btn {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
}

.tab-btn:hover { background: var(--surface-2); }
.tab-btn.active {
  background: var(--text-1);
  color: #fff;
  font-weight: 500;
}

/* ================= Topic Hero ================= */
.topic-hero {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.topic-hero .topic-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--surface-2);
  flex-shrink: 0;
}

.topic-hero h2 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.topic-hero p { margin: 0; color: var(--text-2); font-size: 11px; }

/* ================= Detail ================= */
.detail-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 22px 24px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.detail-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.75;
  color: var(--text-1);
  margin-top: 14px;
  font-size: 13px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}
.detail-back:hover { color: var(--text-1); }

/* ================= Modal ================= */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.15s;
}

.modal {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.18s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.modal-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}

/* ================= Toast ================= */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-1);
  color: #fff;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  z-index: 200;
  animation: slideUp 0.18s;
}

/* ================= Responsive ================= */
@media (max-width: 900px) {
  #app { padding: 0 24px 30px; }
  .nav { padding: 12px 24px; margin: 0 -24px; }
  .site-footer { padding: 10px 24px; }
}

@media (max-width: 600px) {
  #app { padding: 0 16px 30px; }
  .nav { padding: 10px 16px; margin: 0 -16px; }
  .site-footer { padding: 10px 16px; }
  .hero { padding: 22px 0 18px; }
  .hero-title { font-size: 18px; }
  .nav-brand-name { font-size: 16px; }
  .profile-card { flex-direction: column; align-items: flex-start; padding: 14px; }
  .post-card { padding: 10px 12px; min-height: 140px; }
  .detail-card { padding: 16px; }
  .form-card { padding: 16px; }
  .filter-bar { flex-wrap: wrap; }
  .auth-page { flex-direction: column; padding: 20px; min-height: auto; }
  .auth-brand { padding: 30px 20px; }
  .auth-form { padding: 30px 20px; }
}

/* ================= Nav (right side) ================= */
.nav-links-right { gap: 8px; }
.nav-link.has-unread { color: var(--primary); font-weight: 600; }

/* ================= Auth Pages ================= */
.auth-page {
  display: flex;
  min-height: calc(100vh - 60px);
  align-items: stretch;
  background: #fff;
  margin: 0 -64px;
}

.auth-brand {
  flex: 1;
  background: linear-gradient(135deg, var(--surface-2) 0%, #fafafa 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 80px;
  border-right: 1px solid var(--border);
}

.auth-brand-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-brand-divider {
  color: var(--text-3);
  font-weight: 400;
}

.auth-brand-hero {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 16px;
  color: var(--text-1);
}

.auth-brand-hero .accent {
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.auth-brand-hero .accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--primary);
}

.auth-brand-slogan {
  color: var(--text-2);
  font-size: 14px;
  margin: 0 0 40px;
}

.auth-brand-meta {
  display: flex;
  gap: 24px;
  color: var(--text-3);
  font-size: 12px;
}

.auth-brand-meta > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 80px;
  max-width: 480px;
}

.auth-form-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
}

.auth-form-sub {
  color: var(--text-2);
  margin: 0 0 28px;
  font-size: 13px;
}

.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}

.auth-switch a {
  color: var(--primary-deep);
  margin-left: 4px;
  font-weight: 500;
}

.auth-switch a:hover { text-decoration: underline; }

.auth-hint {
  margin-top: 16px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}

/* ================= Loading ================= */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 13px;
}

/* ================= Notifications ================= */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  background: #fff;
  cursor: pointer;
  transition: background 0.12s;
}

.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { border-left: 3px solid var(--primary); background: var(--primary-soft); }
.notif-item.banned { opacity: 0.5; }

.notif-icon {
  font-size: 16px;
  color: var(--text-3);
  margin-left: auto;
  flex-shrink: 0;
}

/* ================= Settings ================= */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child { border-bottom: none; }

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.switch input { display: none; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.15s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}
.switch input:checked + .switch-slider { background: var(--text-1); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }

/* ================= Admin ================= */
.admin-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  background: #fff;
}

.admin-user-item.banned { background: var(--surface-2); opacity: 0.7; }

/* ================= Profile tag ================= */
.profile-tag.admin-tag {
  background: var(--text-1);
  color: #fff;
}

/* ================= Danger ================= */
:root { --danger: #c0392b; --qa: #2c5a8a; }

/* ================= Type Badge (qa) ================= */
.type-badge.qa {
  background: #e8eff7;
  color: var(--qa);
}

/* ================= Tip action ================= */
.action-btn.tip { color: var(--primary); }
.action-btn.tip:hover { background: var(--primary-soft); }

/* ================= User Profile Public ================= */
.stat-cell {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}

/* ================= Q&A accepted answer ================= */
.comment-item.accepted-answer {
  background: #f1f8f4;
  border-left: 3px solid #2c8a4a;
}

/* ================= Help page tabs ================= */
.tabs-bar {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.qa-card {
  border-left: 3px solid var(--qa, #2c5a8a);
}
.qa-card.closed {
  border-left-color: var(--text-3);
  opacity: 0.7;
}

.qa-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 6px;
}
.qa-status.solved {
  background: #e8f4ec;
  color: #2c8a4a;
}
.qa-status.closed {
  background: var(--surface-2);
  color: var(--text-3);
}

/* ================= Site Footer ================= */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  padding: 10px 40px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}
/* 给页面内容留出 footer 高度(避免被遮挡) */
body { padding-bottom: 44px; }
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1600px;
  margin: 0 auto;
}
.footer-sponsor {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.12s;
}
.footer-sponsor:hover { color: var(--primary); }

/* ================= Sponsor Page ================= */
.sponsor-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  max-width: 520px;
  margin: 0 auto;
}
.sponsor-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.sponsor-avatar {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #c84a2c 0%, #a83a20 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.sponsor-intro {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0 0 16px;
}
.sponsor-qr-block {
  text-align: center;
  margin: 20px 0 12px;
}
.sponsor-qr-img {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sponsor-disclaimer {
  background: #fdf2ec;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
  margin-top: 16px;
}
.sponsor-disclaimer strong {
  color: var(--primary-deep);
  display: block;
  margin-bottom: 4px;
}
.sponsor-disclaimer p { margin: 4px 0; }

/* ================= City Picker ================= */
.city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 4px;
}
.city-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  border-radius: 999px;
  font-size: 12px;
}
.city-chip-x {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}
.city-quick {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.city-quick-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-md);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-2);
}
.city-quick-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 城市筛选下拉中的省份 / 城市 chip 区分 */
.chip.chip-province {
  font-weight: 600;
  color: var(--text-1);
  border-color: var(--border-strong);
}
.chip.chip-city {
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-2);
}

/* ================= 两列城市选择面板 ================= */
.city2-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  min-height: 280px;
  max-height: 360px;
}
.city2-left {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface-2);
}
.city2-right {
  overflow-y: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.city2-right-title {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
}
.city2-group-title {
  padding: 8px 14px 4px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-3);
}
.city2-province {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text-1);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: background 0.12s;
}
.city2-province:hover { background: var(--surface-3); }
.city2-province.active {
  background: #fff;
  border-left-color: var(--primary);
  color: var(--primary-deep);
  font-weight: 600;
}
.city2-province-count {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
}
.city2-province.active .city2-province-count { color: var(--primary-deep); }

.city2-cities {
  padding: 4px 0;
  flex: 1;
}
.city2-city {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text-1);
  font-size: 13px;
  border-bottom: 1px solid var(--surface-2);
}
.city2-city:hover { background: var(--primary-soft); color: var(--primary-deep); }
.city2-city.active {
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-weight: 600;
}
.city2-city-action {
  font-size: 11px;
  color: var(--text-3);
}
.city2-city:hover .city2-city-action,
.city2-city.active .city2-city-action { color: var(--primary-deep); }
.city2-province-cell {
  background: var(--surface-2);
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.city2-province-cell:hover {
  background: var(--primary-soft);
  color: var(--primary-deep);
}

/* 多选 chip 区 */
.city-chips-empty {
  font-size: 12px;
  color: var(--text-3);
  padding: 6px 0;
}
.city-chip-label { font-weight: 500; }
.city2-multi-head {
  font-size: 12px;
  color: var(--text-3);
  margin: 8px 0;
}
.city2-multi-count {
  color: var(--primary-deep);
  font-weight: 600;
}

/* 筛选下拉里嵌入两列 */
.city2-dropdown .filter-dropdown-body { padding: 0; min-width: 460px; }
.city2-filter-body { padding: 8px; }
.city2-quick { display: flex; gap: 6px; margin-bottom: 8px; }
.city2-dropdown .city2-panel { min-height: 240px; max-height: 320px; }

/* 响应式 — 小屏下两列改为上下堆叠 */
@media (max-width: 720px) {
  .city2-panel { grid-template-columns: 1fr; min-height: auto; max-height: 480px; }
  .city2-left { max-height: 160px; border-right: 0; border-bottom: 1px solid var(--border); }
  .city2-dropdown .filter-dropdown-body { min-width: 0; }
}

/* ================= 紧凑投稿页 ================= */
.form-page-compact {
  max-width: min(95%, 1080px);
  margin: 0 auto;
  padding: 16px 0 24px;
}
.submit-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.submit-head > div:first-child { flex: 1 1 auto; min-width: 220px; }
.submit-head .page-title { font-size: 16px; margin: 0 0 2px; }
.submit-head .page-sub { margin: 0; font-size: 11px; color: var(--text-3); }
.type-switch-inline { flex: 0 0 auto; }

.form-card-compact {
  padding: 20px 24px 18px;
}
.form-card-compact .field { margin-bottom: 14px; }
.form-card-compact .field-label { font-size: 12px; margin-bottom: 6px; color: var(--text-2); }
.form-card-compact .field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}
.form-counter { font-size: 10px; color: var(--text-3); }
.field-counter {
  font-size: 10px;
  color: var(--text-3);
}
.row-2-tight { gap: 10px; margin-bottom: 8px; }
.row-2-tight > .field { margin-bottom: 0; }
.radio-group-compact { gap: 4px; }
.radio-group-compact .radio-pill { padding: 3px 10px; font-size: 11px; }
.form-card-compact .field-input,
.form-card-compact .field-textarea,
.form-card-compact .field-select { padding: 9px 12px; font-size: 13px; }
.form-card-compact .field-textarea { min-height: 120px; }

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 12px;
}
.submit-tip {
  font-size: 10px;
  color: var(--text-3);
}
.submit-btn {
  padding: 6px 22px;
  font-size: 13px;
  flex: 0 0 auto;
}

/* 投稿里的城市面板用更紧凑的高度 */
.form-card-compact .city2-panel {
  min-height: 200px;
  max-height: 240px;
}

/* ================= 城市选择器 v2 (Modal) ================= */
.city-picker-trigger-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.city-picker-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.12s;
  width: 100%;
  text-align: left;
}
.city-picker-trigger:hover { border-color: var(--border-strong); }
.city-picker-trigger.has-value { color: var(--text-1); border-color: var(--border-strong); }
.city-picker-trigger-multi { font-weight: 500; }
.city-picker-trigger-icon { font-size: 12px; color: var(--text-3); }
.city-picker-trigger-val { flex: 1 1 auto; }
.city-picker-trigger-arrow { font-size: 9px; color: var(--text-3); }

.city-picker-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; }

/* Modal overlay */
.city-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.14s;
  padding: 20px;
}
.city-modal-overlay.city-modal-open { opacity: 1; }

.city-modal {
  background: #fff;
  border-radius: 6px;
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.14s;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}
.city-modal-overlay.city-modal-open .city-modal { transform: translateY(0) scale(1); }
.city-modal-closing { opacity: 0 !important; }

.city-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.city-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.city-modal-close {
  width: 26px;
  height: 26px;
  font-size: 18px;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.city-modal-close:hover { background: var(--surface-2); color: var(--text-1); }

.city-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.city-modal-inner { display: flex; flex-direction: column; gap: 14px; }

.city-modal-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.city-modal-search-row:focus-within { border-color: var(--text-1); background: #fff; }
.city-modal-search-icon { color: var(--text-3); font-size: 13px; }
.city-modal-search {
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text-1);
}
.city-modal-search::placeholder { color: var(--text-3); }

.city-modal-section { display: flex; flex-direction: column; gap: 6px; }
.city-modal-section-label {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}
.city-modal-hot { display: flex; flex-wrap: wrap; gap: 6px; }
.city-modal-quick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.city-modal-quick-all { cursor: pointer; }
.city-modal-quick-all.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.city-modal-hot-chip {
  cursor: pointer;
  transition: all 0.12s;
}
.city-modal-hot-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.city-modal-hot-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.city-modal-panel {
  display: grid;
  grid-template-columns: 180px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 320px;
  max-height: 420px;
}
.city-modal-left {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface-2);
}
.city-modal-right {
  overflow-y: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.city-modal-group-title {
  padding: 8px 12px 4px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text-3);
  background: var(--surface-2);
  position: sticky;
  top: 0;
}
.city-modal-province {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text-1);
  font-size: 12px;
  border-left: 2px solid transparent;
  transition: background 0.12s;
}
.city-modal-province:hover { background: rgba(255,255,255,0.6); }
.city-modal-province.active {
  background: #fff;
  border-left-color: var(--primary);
  color: var(--primary-deep);
  font-weight: 600;
}
.city-modal-province-label { font-weight: inherit; }
.city-modal-province-count {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 400;
}
.city-modal-province.active .city-modal-province-count { color: var(--primary-deep); }

.city-modal-right-title {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
}
.city-modal-cities { padding: 4px 0; flex: 1; }
.city-modal-city {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text-1);
  font-size: 12px;
  border-bottom: 1px solid var(--surface-2);
}
.city-modal-city:hover { background: var(--primary-soft); color: var(--primary-deep); }
.city-modal-city.active { background: var(--primary-soft); color: var(--primary-deep); font-weight: 600; }
.city-modal-city.active .city-modal-city-action { color: var(--primary-deep); }
.city-modal-city-label { font-weight: 500; }
.city-modal-city-action { font-size: 11px; color: var(--text-3); }
.city-modal-city:hover .city-modal-city-action { color: var(--primary-deep); }
.city-modal-province-cell {
  background: var(--surface-2);
  font-weight: 500;
  color: var(--text-2);
}
.city-modal-province-cell:hover { background: var(--primary-soft); color: var(--primary-deep); }

.city-modal-search-results { display: none; }
.city-modal-no-result {
  padding: 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}
.city-modal-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--surface-2);
  font-size: 12px;
}
.city-modal-result-row:hover { background: var(--primary-soft); }
.city-modal-result-row.active { background: var(--primary-soft); color: var(--primary-deep); font-weight: 600; }
.city-modal-result-province { color: var(--text-3); font-size: 11px; }
.city-modal-result-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 700;
}
.city-modal-result-row.active .city-modal-result-check { background: var(--primary); color: #fff; }

.city-modal-selected {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.city-modal-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 100px;
  overflow-y: auto;
}
.city-chip-in-modal { background: #fff; }

.city-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.city-modal-count { font-size: 12px; color: var(--text-3); margin-right: auto; }
.city-modal-clear-btn {
  background: transparent;
  color: var(--text-3);
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius-md);
}
.city-modal-clear-btn:hover { color: var(--text-1); border-color: var(--text-3); }

@media (max-width: 600px) {
  .city-modal-overlay { padding: 10px; }
  .city-modal { max-height: 92vh; }
  .city-modal-panel { grid-template-columns: 130px 1fr; }
}

/* ================= 投稿页两列布局 ================= */
.form-page-wide {
  padding: 14px 0 24px;
}
.form-card-wide {
  padding: 20px 26px;
}
.form-2col {
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}
.form-2col-left {
  flex: 0 0 calc(42% - 12px);
  width: calc(42% - 12px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.form-2col-right {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.form-2col-left .field,
.form-2col-right .field { margin-bottom: 14px; }
.form-2col-right .field-textarea {
  min-height: 420px;
  font-size: 13px;
  line-height: 1.7;
}
.form-2col .radio-group-compact { gap: 4px; }
.form-2col .radio-group-compact .radio-pill { padding: 4px 10px; font-size: 11px; }
.form-2col .form-card-compact .city2-panel {
  min-height: 180px;
  max-height: 220px;
}
@media (max-width: 640px) {
  .form-2col { flex-direction: column; gap: 0; }
  .form-2col-left,
  .form-2col-right { flex: 1 1 auto; width: 100%; }
}