/* 知行 · 内部问答 —— 界面样式 */

:root {
  --brand: #0b6bff;
  --brand-dark: #0052d9;
  --brand-soft: #eaf2ff;
  --text: #1a1d23;
  --text-2: #444b56;
  --muted: #7a828f;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e6e9f0;
  --border-strong: #d5dae4;
  --ok: #14a06e;
  --warn: #f0a020;
  --danger: #e5484d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03);
  --shadow-hover: 0 6px 20px rgba(16, 24, 40, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

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

::selection {
  background: #cfe1ff;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

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

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

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 62px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #4d94ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 2px 8px rgba(11, 107, 255, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.brand-text small {
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 6px;
}

.nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14.5px;
}

.nav a:hover {
  background: #f2f5fa;
  color: var(--text);
}

.nav a.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.search {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  margin-left: auto;
  position: relative;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f7f9fc;
  outline: none;
  font-size: 14px;
  transition: 0.15s;
}

.search input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 107, 255, 0.12);
}

.search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 11px;
  width: 15px;
  height: 15px;
  border: 2px solid #9aa3b0;
  border-radius: 50%;
  pointer-events: none;
}

.search::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 25px;
  width: 6px;
  height: 2px;
  background: #9aa3b0;
  transform: rotate(45deg);
  border-radius: 1px;
  pointer-events: none;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------ 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: 0.15s;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(11, 107, 255, 0.25);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text-2);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 13.5px;
}

.btn-text:hover {
  background: #f2f5fa;
  color: var(--text);
}

.btn-text.danger:hover {
  background: #fdecec;
  color: var(--danger);
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 13.5px;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 用户菜单 */

.usermenu {
  position: relative;
}

.usermenu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
}

.usermenu-trigger:hover {
  border-color: var(--border-strong);
  background: #fafbfd;
}

.usermenu-name {
  font-size: 13.5px;
  font-weight: 500;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
  padding: 6px;
  display: none;
}

.dropdown.open {
  display: block;
  animation: pop 0.14s ease-out;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dropdown a,
.dropdown button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
}

.dropdown a:hover,
.dropdown button:hover {
  background: #f4f7fc;
  color: var(--text);
}

.dropdown-head {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.dropdown-head b {
  display: block;
  font-size: 14px;
}

.dropdown-head span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 头像 */

.avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: #9aa3b0;
  user-select: none;
}

.avatar.lg {
  width: 44px;
  height: 44px;
  font-size: 17px;
}

.avatar.xl {
  width: 68px;
  height: 68px;
  font-size: 26px;
  border-radius: 20px;
}

.avatar.anon {
  background: linear-gradient(135deg, #c8cfda, #a8b1bf);
}

/* ------------------------------------------------------------ 布局 */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 16px;
}

.panel-pad {
  padding: 22px 24px;
}

/* 首页欢迎条 */

.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #0b6bff 0%, #3d8bff 55%, #6aa9ff 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(11, 107, 255, 0.22);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.hero h1 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.hero p {
  margin: 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.86);
}

.hero-stats {
  margin-left: auto;
  display: flex;
  gap: 26px;
  position: relative;
  z-index: 1;
}

.hero-stat {
  text-align: center;
}

.hero-stat b {
  display: block;
  font-size: 21px;
  font-weight: 700;
}

.hero-stat span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* 标签栏 */

.tabs {
  display: flex;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 7px 14px;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  white-space: nowrap;
}

.tab:hover {
  background: #f4f7fc;
}

.tab.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.list-head .count {
  margin-left: auto;
  font-size: 12.5px;
}

/* ------------------------------------------------------------ 问题卡片 */

.q-list {
  display: flex;
  flex-direction: column;
}

.q-card {
  display: flex;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #f0f2f7;
  transition: background 0.15s;
}

.q-card:last-child {
  border-bottom: none;
}

.q-card:hover {
  background: #fbfcfe;
}

.q-card .q-body-col {
  flex: 1;
  min-width: 0;
}

.q-card h2 {
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.5;
}

.q-card h2 a:hover {
  color: var(--brand);
}

.q-card .excerpt {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.q-card .q-right {
  flex-shrink: 0;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.q-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f2f5fa;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.9;
}

.pill.solved {
  background: #e8f8f1;
  color: var(--ok);
}

.pill.blue {
  background: var(--brand-soft);
  color: var(--brand);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 6px;
  background: #f2f5fa;
  color: #5b6472;
  font-size: 12.5px;
  transition: 0.15s;
}

a.tag:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.author-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.author-line b {
  color: var(--text-2);
  font-weight: 500;
}

/* ------------------------------------------------------------ 问题详情 */

.q-detail {
  padding: 26px 28px 20px;
}

.q-detail .q-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.q-detail h1 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.42;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.q-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f2f7;
  font-size: 13px;
  color: var(--muted);
}

.q-meta-line .who {
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-meta-line .who b {
  font-weight: 600;
  color: var(--text);
}

.markdown {
  font-size: 15px;
  color: var(--text-2);
  word-break: break-word;
}

.markdown p {
  margin: 0 0 12px;
}

.markdown p:last-child {
  margin-bottom: 0;
}

.markdown ul,
.markdown ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.markdown li {
  margin-bottom: 4px;
}

.markdown strong {
  color: var(--text);
  font-weight: 600;
}

.markdown code {
  background: #f4f6fa;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #b4453f;
}

.markdown pre {
  background: #1c2333;
  color: #e6ebf5;
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 0 0 14px;
}

.markdown pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: 13px;
}

.markdown blockquote {
  margin: 0 0 12px;
  padding: 8px 14px;
  border-left: 3px solid var(--brand);
  background: #f7f9fd;
  color: var(--text-2);
  border-radius: 0 8px 8px 0;
}

.markdown a {
  color: var(--brand);
}

.q-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #f0f2f7;
}

.q-toolbar .spacer {
  flex: 1;
}

/* 回答区 */

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.section-head h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
}

.section-head .count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.section-head .right {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.answer {
  display: flex;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f2f7;
}

.answer:last-child {
  border-bottom: none;
}

.vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  width: 40px;
}

.vote button {
  width: 32px;
  height: 28px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  transition: 0.15s;
  display: grid;
  place-items: center;
}

.vote button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.vote button.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.vote button.on.down {
  background: #6b7280;
  border-color: #6b7280;
}

.vote .score {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  padding: 2px 0;
}

.answer-main {
  flex: 1;
  min-width: 0;
}

.answer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

.answer-head b {
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
}

.answer-head .dept {
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 5px;
  background: #f2f5fa;
}

.badge-accepted {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 5px;
  background: #e8f8f1;
  color: var(--ok);
  font-size: 12px;
  font-weight: 500;
}

.answer-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}

.comments {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f8fafd;
  border-radius: 10px;
  border: 1px solid #eef1f6;
}

.comment {
  font-size: 13.5px;
  color: var(--text-2);
  padding: 4px 0;
  line-height: 1.6;
}

.comment b {
  color: var(--text);
  font-weight: 600;
  margin-right: 6px;
}

.comment time {
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-form input {
  flex: 1;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0 10px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.comment-form input:focus {
  border-color: var(--brand);
}

/* 编辑器 */

.editor {
  padding: 18px 24px 22px;
}

.editor h3 {
  margin: 0 0 12px;
  font-size: 15.5px;
  font-weight: 600;
}

textarea,
input[type="text"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14.5px;
  line-height: 1.7;
  outline: none;
  background: #fff;
  transition: 0.15s;
  resize: vertical;
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 107, 255, 0.1);
}

.editor textarea {
  min-height: 130px;
}

.editor-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

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

.editor-foot .spacer {
  flex: 1;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ------------------------------------------------------------ 侧栏 */

.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.side-card + .side-card {
  margin-top: 16px;
}

.side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid #f0f2f7;
}

.side-head .more {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
}

.side-body {
  padding: 14px 18px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 8px;
  background: #f4f7fc;
  font-size: 13px;
  color: var(--text-2);
  transition: 0.15s;
}

.tag-chip:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.tag-chip .n {
  font-size: 11.5px;
  color: var(--muted);
}

.tag-chip:hover .n {
  color: var(--brand);
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13.5px;
}

.rank-item + .rank-item {
  border-top: 1px dashed #eef1f6;
}

.rank-no {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  background: #f2f5fa;
  color: var(--muted);
  flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-no {
  background: #fff3df;
  color: #d98a10;
}

.rank-item:nth-child(2) .rank-no {
  background: #eef1f6;
  color: #6b7280;
}

.rank-item:nth-child(3) .rank-no {
  background: #fbeadb;
  color: #b87333;
}

.rank-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  font-size: 12px;
  color: var(--muted);
}

.side-note {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.75;
}

.side-note b {
  color: var(--text-2);
}

/* ------------------------------------------------------------ 提问页 / 表单 */

.page-head {
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
}

.field label .req {
  color: var(--danger);
  margin-left: 2px;
}

.field .sub {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  min-height: 46px;
}

.tag-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 107, 255, 0.1);
}

.tag-input input {
  flex: 1;
  min-width: 120px;
  border: none;
  outline: none;
  padding: 3px 2px;
  font-size: 14px;
  background: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
}

.chip button {
  border: none;
  background: none;
  color: var(--brand);
  opacity: 0.6;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
}

.chip button:hover {
  opacity: 1;
}

.tag-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-suggest button {
  border: 1px dashed var(--border-strong);
  background: #fff;
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.tag-suggest button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ------------------------------------------------------------ 登录 / 注册 */

.auth-wrap {
  max-width: 430px;
  margin: 30px auto;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(16, 24, 40, 0.08);
  padding: 30px 32px 28px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
}

.auth-card .auth-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13.5px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f4f7fc;
  border-radius: 11px;
  margin-bottom: 22px;
}

.auth-tabs button {
  flex: 1;
  border: none;
  background: none;
  padding: 8px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
}

.auth-tabs button.active {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row > .field {
  flex: 1;
}

.form-error {
  background: #fdecec;
  color: #c2333a;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

.form-error.show {
  display: block;
}

.auth-tip {
  margin-top: 16px;
  padding: 12px 14px;
  background: #f7f9fd;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.75;
}

/* ------------------------------------------------------------ 个人主页 */

.profile-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 24px 26px;
}

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

.profile-main h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-main .meta {
  color: var(--muted);
  font-size: 13.5px;
}

.profile-main .bio {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--text-2);
}

.profile-stats {
  display: flex;
  gap: 26px;
  margin-top: 14px;
}

.profile-stats div {
  text-align: center;
}

.profile-stats b {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

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

.role-tag {
  font-size: 11.5px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 5px;
  background: #fff3df;
  color: #b0710a;
}

/* ------------------------------------------------------------ 话题页 */

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.tag-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: 0.15s;
  box-shadow: var(--shadow);
}

.tag-card:hover {
  border-color: #bcd4ff;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.tag-card b {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.tag-card span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 通用 */

.loading,
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #dbe2ec;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-icon {
  font-size: 30px;
  opacity: 0.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  background: #1f2733;
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: 0.22s;
  z-index: 200;
  max-width: 86vw;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.err {
  background: #c2333a;
}

.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 40px;
  text-align: center;
  font-size: 12.5px;
  color: #9aa3b0;
}

.footer-dot {
  margin: 0 8px;
}

.divider {
  height: 1px;
  background: #f0f2f7;
  margin: 18px 0;
}

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

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .col-side {
    order: 2;
  }
  .hero-stats {
    display: none;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 16px 14px 48px;
  }
  .topbar-inner {
    height: auto;
    min-height: 58px;
    padding: 8px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .nav {
    order: 3;
    margin-left: 0;
    width: 100%;
  }
  .search {
    max-width: none;
    order: 4;
    width: 100%;
  }
  .brand-text small {
    display: none;
  }
  .q-card {
    flex-direction: column-reverse;
    padding: 16px;
  }
  .q-card .q-right {
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }
  .q-detail {
    padding: 20px 18px 16px;
  }
  .q-detail h1 {
    font-size: 20px;
  }
  .answer {
    padding: 16px;
    gap: 10px;
  }
  .vote {
    width: 34px;
  }
  .vote button {
    width: 28px;
    height: 26px;
  }
  .editor {
    padding: 16px;
  }
  .panel-pad {
    padding: 18px;
  }
  .hero {
    padding: 18px;
  }
  .hero h1 {
    font-size: 17px;
  }
  .profile-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .auth-card {
    padding: 24px 20px;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}
