/* ---------------------------------------------------------------
   SVELT Studio 站点样式
   设计约束：黑白两套主题、无渐变、无发光、无圆角过度、三端自适应
---------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f5;
  --fg: #0b0b0b;
  --muted: #666666;
  --line: #dcdcdc;
  --line-strong: #0b0b0b;
  --btn-bg: #0b0b0b;
  --btn-fg: #ffffff;
  --danger: #b00020;
  --radius: 4px;
  --max: 1120px;
  --pad: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0b0b;
  --bg-soft: #131313;
  --fg: #f2f2f2;
  --muted: #9b9b9b;
  --line: #2b2b2b;
  --line-strong: #f2f2f2;
  --btn-bg: #f2f2f2;
  --btn-fg: #0b0b0b;
  --danger: #ff6b81;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

img,
svg {
  max-width: 100%;
  vertical-align: middle;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(28px, 4.2vw, 42px);
}

h2 {
  font-size: clamp(20px, 2.4vw, 26px);
}

h3 {
  font-size: clamp(17px, 2vw, 19px);
}

p {
  margin: 0 0 16px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.muted {
  color: var(--muted);
}

.pre-wrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.center-block {
  text-align: center;
}

.center-actions {
  justify-content: center;
}

/* ----------------------------- 基础布局 ----------------------------- */

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.site-main {
  min-height: 60vh;
}

.section {
  padding: clamp(40px, 6vw, 64px) 0;
}

.section-alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.section-head h2 {
  margin: 0;
}

.narrow {
  max-width: 760px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--btn-bg);
  color: var(--btn-fg);
  padding: 8px 14px;
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ----------------------------- 页头 ----------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 17px;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 13px;
  height: 13px;
  background: var(--fg);
  display: inline-block;
}

.brand-name {
  font-weight: 800;
}

.brand-logo {
  height: 24px;
  width: auto;
  max-width: 46px;
  object-fit: contain;
  display: block;
}

.brand-sub {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-left: 9px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 26px);
  font-size: 14px;
  color: var(--muted);
}

.site-nav a {
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--fg);
  text-decoration: none;
}

.site-nav a.is-active {
  color: var(--fg);
  border-bottom-color: var(--fg);
  font-weight: 600;
}

.nav-admin {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  white-space: nowrap;
}

.user-link {
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-entry {
  color: var(--fg);
  font-weight: 600;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.text-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.text-btn:hover {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
}

.icon-btn:hover {
  border-color: var(--fg);
  text-decoration: none;
}

.bell .dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  background: transparent;
  color: var(--fg);
  border-color: var(--fg);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--fg);
  border-color: var(--fg);
}

.btn-outline:hover {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-color: var(--btn-bg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
}

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

/* ----------------------------- 首页 ----------------------------- */

.hero {
  padding: clamp(56px, 9vw, 96px) 0 clamp(40px, 6vw, 64px);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: var(--max);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-title {
  font-size: clamp(40px, 8vw, 84px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  line-height: 1.05;
}

.hero-sub {
  margin: -6px 0 20px;
  font-size: clamp(17px, 2.6vw, 26px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hero-lead {
  max-width: 620px;
  font-size: clamp(16px, 2.2vw, 18px);
  color: var(--muted);
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}

.hero-banner {
  margin: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.hero-banner img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 160px));
  gap: 24px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: 560px;
}

.stat-value {
  display: block;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.notice-bar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 24px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 14px;
}

.notice-label {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.join-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--fg);
  padding: clamp(24px, 4vw, 40px);
}

.join-band h2 {
  margin-bottom: 6px;
}

/* ----------------------------- 卡片 ----------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: var(--fg);
}

.card h3 {
  margin: 4px 0 2px;
}

.card h3 a:hover {
  text-decoration: underline;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card .muted {
  font-size: 14px;
  flex: 1;
}

.card .text-link {
  margin-top: 6px;
  font-size: 13px;
}

.activity-card {
  min-height: 170px;
}

/* ----------------------------- 标签/链接 ----------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.6;
  white-space: nowrap;
}

.tag-open {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-color: var(--btn-bg);
}

.tag-closed {
  color: var(--muted);
}

.tag-soft {
  background: var(--bg-soft);
  color: var(--muted);
  border-color: var(--line);
}

.text-link {
  color: var(--fg);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.text-link:hover {
  text-decoration: none;
  opacity: 0.7;
}

/* ----------------------------- 列表/表格 ----------------------------- */

.thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.thread-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.thread-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-title:hover {
  text-decoration: underline;
}

.thread-meta {
  display: flex;
  gap: 16px;
  flex: none;
  font-size: 12.5px;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  word-break: break-word;
}

.table tr:last-child td {
  border-bottom: 0;
}

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

.admin-main .table td {
  white-space: nowrap;
}

.admin-main .table td.cell-wrap {
  white-space: normal;
  word-break: break-word;
  min-width: 180px;
}

.action-cell {
  white-space: nowrap;
}

.action-cell .btn {
  margin-left: 6px;
}

.action-cell .inline-form:first-child .btn {
  margin-left: 0;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

/* ----------------------------- 版块 ----------------------------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.category-card {
  display: block;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.category-card:hover {
  border-color: var(--fg);
  text-decoration: none;
}

.category-card h3 {
  margin-bottom: 8px;
}

.category-card .muted {
  font-size: 13.5px;
  min-height: 44px;
}

.category-meta {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* ----------------------------- 页面头部/面包屑 ----------------------------- */

.page-head {
  padding: clamp(36px, 5vw, 56px) 0 8px;
}

.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--fg);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
}

/* ----------------------------- 面板 ----------------------------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 20px;
  background: var(--bg);
  overflow-x: auto;
}

.panel h2 {
  margin-top: 0;
}

.muted-panel {
  background: var(--bg-soft);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.two-col .panel {
  margin-bottom: 0;
}

.prose {
  max-width: 820px;
}

.prose h2 {
  margin-top: 28px;
}

.prose h2:first-child {
  margin-top: 0;
}

.steps {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.steps li {
  margin-bottom: 6px;
}

.info-list {
  margin: 0;
}

.info-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.info-list > div:last-child {
  border-bottom: 0;
}

.info-list dt {
  color: var(--muted);
  flex: none;
}

.info-list dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

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

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.form label span {
  display: block;
  margin-bottom: 6px;
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form input[type="url"],
.form select,
.form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: var(--fg);
}

.form textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.key-input {
  flex: 1 1 320px;
  min-width: 220px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

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

.auth-page {
  padding: clamp(40px, 7vw, 72px) 0;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.auth-card h1 {
  margin-bottom: 8px;
}

.auth-card > .muted {
  margin-bottom: 24px;
  font-size: 14px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

/* ----------------------------- 消息 ----------------------------- */

.message-list {
  border-top: 1px solid var(--line);
}

.message-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.message-item.is-unread {
  border-left: 3px solid var(--fg);
  padding-left: 16px;
}

.message-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.message-head h3 {
  margin: 0;
  font-size: 16px;
}

.message-item .pre-wrap {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ----------------------------- 帖子 ----------------------------- */

.post {
  padding: 20px 24px;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.post-body {
  font-size: 15px;
}

/* ----------------------------- 后台 ----------------------------- */

.role-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.role-note-grid strong {
  display: block;
  margin-bottom: 4px;
}

.role-note-grid p {
  margin: 0;
  font-size: 13.5px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.image-card .muted {
  min-height: 44px;
  font-size: 13px;
}

.image-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}

.preview-favicon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.preview-logo {
  max-width: 200px;
  max-height: 56px;
  object-fit: contain;
}

.preview-hero {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
}

.image-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.image-form input[type="file"] {
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
}

.image-form input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: 72px;
}

.admin-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  border-right: 1px solid var(--line);
  padding-right: 20px;
  min-height: 320px;
}

.sidebar-title {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav a {
  padding: 8px 10px;
  border-radius: 2px;
  font-size: 14px;
  color: var(--muted);
}

.admin-nav a:hover {
  color: var(--fg);
  background: var(--bg-soft);
  text-decoration: none;
}

.admin-nav a.is-active {
  color: var(--fg);
  font-weight: 700;
  background: var(--bg-soft);
}

.sidebar-back {
  display: inline-block;
  margin-top: 24px;
  font-size: 13px;
}

.admin-main {
  min-width: 0;
}

.admin-head {
  margin-bottom: 24px;
}

.admin-head h1 {
  margin-bottom: 6px;
}

.admin-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--bg);
}

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

.tab {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 13px;
  color: var(--muted);
}

.tab:hover {
  border-color: var(--fg);
  color: var(--fg);
  text-decoration: none;
}

.tab.is-active {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-color: var(--btn-bg);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 32px;
  align-items: start;
}

.footer-brand .brand-name {
  font-size: 18px;
  margin-bottom: 4px;
}

.footer-brand p {
  margin: 0;
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--fg);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

/* ----------------------------- 弹窗 ----------------------------- */

.join-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
}

.join-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.dialog-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 20px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.dialog-actions .btn {
  flex: 1 1 160px;
}

/* ----------------------------- 提示信息 ----------------------------- */

.flash-stack {
  margin-top: 20px;
}

.flash {
  padding: 10px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--fg);
  background: var(--bg-soft);
  font-size: 13.5px;
}

.flash-error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.flash-success {
  border-left-color: var(--fg);
}

.empty {
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

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

@media (max-width: 960px) {
  .image-grid {
    grid-template-columns: 1fr;
  }

  .header-main {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand actions"
      "nav nav";
    row-gap: 10px;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .brand {
    grid-area: brand;
  }

  .header-actions {
    grid-area: actions;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
  }

  .site-nav {
    grid-area: nav;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .role-note-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .admin-sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 16px;
    min-height: 0;
  }

  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .footer-join {
    grid-column: span 2;
  }
}

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

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: none;
  }

  .stat-label {
    letter-spacing: 0.04em;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .thread-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .thread-main {
    flex-wrap: wrap;
  }

  .thread-title {
    white-space: normal;
  }

  .thread-meta {
    gap: 12px;
  }

  .page-head-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .join-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .join-band .btn {
    width: 100%;
  }

  .card-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

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

  .form-grid .span-2 {
    grid-column: span 1;
  }

  .auth-links {
    flex-direction: column;
    gap: 10px;
  }

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

  .footer-join {
    grid-column: span 1;
  }

  .footer-join .btn {
    width: 100%;
  }

  .dialog-actions {
    flex-direction: column;
  }

  .dialog-actions .btn {
    width: 100%;
  }

  .admin-main .table {
    min-width: 620px;
  }

  .table th,
  .table td {
    padding-right: 10px;
  }

  .header-actions {
    gap: 8px;
    font-size: 12.5px;
  }

  .brand-sub {
    display: none;
  }

  .header-actions .admin-entry {
    display: none;
  }

  .nav-admin {
    display: inline;
  }

  .user-link {
    max-width: 84px;
  }

  .stat-card {
    padding: 14px;
  }

  .message-head {
    flex-direction: column;
    gap: 4px;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
