﻿/* ==========================================================================
   同频 · 班级信息共享平台
   白底极简 · 双环标志 · 登录 / 极简主页 / 栏目页 / 侧边栏
   ========================================================================== */

:root {
  --bg: #ffffff;
  --soft: #fafbf8;
  --line: #eaede8;
  --line-strong: #e3e7df;
  --tint: #f2f5ee;
  --ink: #262b27;
  --ink-2: #4a5145;
  --ink-3: #7c8277;
  --ink-4: #a2a79c;
  --ink-5: #c6cac0;
  --accent: #a5b295;
  --accent-ink: #4c5a44;
  --btn: #2f382b;
  --btn-hover: #3b4634;
  --btn-active: #28301f;
  --danger: #a4473d;
  --danger-soft: #fbf1ef;

  --radius: 10px;
  --radius-lg: 16px;

  --shadow-dialog: 0 24px 64px rgba(31, 39, 26, 0.16), 0 4px 12px rgba(31, 39, 26, 0.06);
  --shadow-toast: 0 12px 32px rgba(31, 39, 26, 0.22);
  --shadow-drawer: 24px 0 64px rgba(31, 39, 26, 0.14);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.lock {
  overflow: hidden;
}

::selection {
  background: #dde5d2;
  color: #1f261b;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--accent-ink);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  background: var(--btn);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid #b9c4ae;
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   通用：品牌锁排 / 图标按钮 / 按钮 / 表单
   -------------------------------------------------------------------------- */

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 26px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 58px;
  height: auto;
  flex: 0 0 auto;
  display: block;
}

.brand-name {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1;
  color: var(--ink);
  transform: translateY(1px);
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-3);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.menu-btn:hover {
  background: var(--soft);
  color: var(--ink);
}

.menu-btn .icon {
  width: 22px;
  height: 22px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.icon-btn:hover {
  background: var(--soft);
  color: var(--ink);
}

.icon {
  width: 20px;
  height: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--radius);
  background: var(--btn);
  color: #f7f8f4;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.4px;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), transform 0.12s var(--ease);
}

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

.btn-primary:active {
  background: var(--btn-active);
  transform: translateY(0.5px);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary .icon {
  width: 16px;
  height: 16px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 14.5px;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

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

.btn-text {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  color: var(--ink-3);
  font-size: 13px;
  border-radius: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-5);
}

.btn-text:hover {
  color: var(--ink);
}

.btn-danger {
  color: var(--danger);
  border-color: #eddbd8;
  background: #fff;
}

.btn-danger:hover {
  background: var(--danger-soft);
  border-color: #e3c7c2;
}

.input,
.textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: #b3b7ad;
}

.input:focus,
.textarea:focus {
  outline: 0;
  border-color: #b9c4ae;
  box-shadow: 0 0 0 3px rgba(120, 138, 100, 0.1);
}

.input.invalid,
.textarea.invalid {
  border-color: #d8a9a2;
  box-shadow: 0 0 0 3px rgba(164, 71, 61, 0.08);
}

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

.label,
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--ink-3);
}

.field {
  margin-top: 22px;
}

.field .label {
  margin-bottom: 9px;
}

.field-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-5);
  letter-spacing: 0.3px;
}

.form-error {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--danger);
}

.form-note {
  margin: 20px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--soft);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-4);
  letter-spacing: 0.2px;
}

/* --------------------------------------------------------------------------
   视图
   -------------------------------------------------------------------------- */

.view {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------------------------- 登录页 ------------------------------------ */

.login {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 130px 24px 90px;
}

.login-brand {
  position: absolute;
  top: 34px;
  left: 42px;
}

.login-main {
  width: 100%;
  max-width: 900px;
  text-align: center;
}

.hero-quote {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.hero-sub {
  margin: 20px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  color: var(--ink-4);
}

.login-card {
  width: min(420px, 100%);
  margin: 56px auto 0;
  text-align: left;
}

.login-card .field-label {
  margin: 20px 0 9px;
}

.login-card .field-label:first-child {
  margin-top: 0;
}

.login-card .input {
  height: 52px;
  font-size: 16px;
}

.login-submit {
  width: 100%;
  height: 52px;
  margin-top: 28px;
  font-size: 16px;
  letter-spacing: 0.4em;
}

.login-note {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.9;
  color: var(--ink-5);
  text-align: center;
  letter-spacing: 0.2px;
}

/* ---------------------------- 主页（极简） ------------------------------- */

.home {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 90px;
}

.home-menu {
  position: absolute;
  top: 26px;
  left: 26px;
}

.home-main {
  width: 100%;
  max-width: 900px;
  text-align: center;
}

.home-quote {
  font-size: clamp(28px, 3.4vw, 50px);
}

.home-search {
  display: flex;
  align-items: center;
  width: min(560px, 100%);
  height: 62px;
  margin: 54px auto 0;
  padding: 0 10px 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(31, 39, 26, 0.03);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.home-search:focus-within {
  border-color: #b9c4ae;
  box-shadow: 0 0 0 4px rgba(120, 138, 100, 0.1);
}

.home-search-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #a9ada3;
}

.home-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  color: var(--ink);
}

.home-search-input::placeholder {
  color: #a9ada3;
}

.home-search-input::-webkit-search-cancel-button,
.home-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.home-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 11px;
  background: var(--btn);
  color: #f7f8f4;
  transition: background-color 0.18s var(--ease);
}

.home-search-submit svg {
  width: 19px;
  height: 19px;
}

.home-search-submit:hover {
  background: var(--btn-hover);
}

.home-hint {
  margin: 16px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: #b6bab1;
}

/* ---------------------------- 栏目页 ------------------------------------ */

.board-view {
  padding: 30px 0 90px;
}

.board-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 54px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
}

.page-title {
  flex: 1;
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: 224px;
  height: 56px;
  padding: 0 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.search:focus-within {
  border-color: #c3cdb7;
  box-shadow: 0 0 0 3px rgba(120, 138, 100, 0.1);
}

.search-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #a9ada3;
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
}

.search-input::placeholder {
  color: #a9ada3;
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--tint);
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1;
  padding: 0;
}

.search-clear:hover {
  background: #e8ede2;
  color: var(--ink);
}

.board {
  padding-top: 4px;
  min-height: calc(100vh - 300px);
}

.resultbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0 6px;
  font-size: 13.5px;
  color: var(--ink-4);
  letter-spacing: 0.2px;
}

.resultbar strong {
  font-weight: 500;
  color: var(--ink-2);
}

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

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

.post {
  position: relative;
  padding: 25px 14px 26px;
  margin: 0 -14px;
  border-bottom: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.16s var(--ease);
}

.post:hover {
  background: var(--soft);
}

.post:focus-visible {
  outline: 2px solid #b9c4ae;
  outline-offset: -2px;
}

.post.flash {
  animation: flash 1.6s var(--ease);
}

@keyframes flash {
  0% {
    background: #eef3e6;
  }
  100% {
    background: transparent;
  }
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12.5px;
  color: var(--ink-4);
  letter-spacing: 0.2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--tint);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.post-author {
  color: var(--ink-3);
}

.post-time {
  margin-left: auto;
  color: var(--ink-4);
  white-space: nowrap;
}

.demo-flag {
  padding: 1px 7px;
  border: 1px dashed #dfe3da;
  border-radius: 6px;
  color: var(--ink-5);
  font-size: 11.5px;
  letter-spacing: 0.3px;
}

.post-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: 0.2px;
  overflow-wrap: anywhere;
}

.post-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: #6a7065;
  overflow-wrap: anywhere;
}

/* 骨架 / 空状态 / 错误 */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(96px, 17vh, 190px);
  text-align: center;
}

.skeleton {
  width: 100%;
  padding-top: 10px;
}

.sk-row {
  padding: 24px 14px;
  margin: 0 -14px;
  border-bottom: 1px solid var(--line);
}

.sk-bar {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f3f5f0 25%, #ebeee7 37%, #f3f5f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.sk-bar + .sk-bar {
  margin-top: 12px;
}

.sk-bar.w40 { width: 40%; }
.sk-bar.w70 { width: 70%; }
.sk-bar.w88 { width: 88%; }
.sk-bar.tall { height: 18px; }

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.empty-art {
  width: 165px;
  height: 148px;
  display: block;
  margin: 0 auto;
}

.empty-title {
  margin: 26px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.3px;
}

.empty-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-5);
  letter-spacing: 0.2px;
}

.error-title {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.error-sub {
  margin: 8px 0 22px;
  font-size: 13px;
  color: var(--ink-4);
}

/* --------------------------------------------------------------------------
   侧边栏（抽屉）
   -------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(31, 39, 26, 0.2);
  animation: fade 0.2s var(--ease);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: 344px;
  max-width: 90vw;
  padding: 16px 0 0;
  background: var(--bg);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-drawer);
  transform: translateX(-104%);
  transition: transform 0.3s var(--ease);
}

.sidebar.open {
  transform: translateX(0);
}

.side-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 18px 20px;
}

.side-head .brand-lockup {
  gap: 16px;
}

.side-head .brand-mark {
  width: 42px;
}

.side-head .brand-name {
  font-size: 26px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 14px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8a9185;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-align: left;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: block;
}

.nav-item:hover {
  background: #f7f8f4;
  color: var(--ink-2);
}

.nav-item[aria-current="page"] {
  background: var(--tint);
  color: #323c2c;
}

/* 名单 */

.roster {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 10px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-4);
}

.roster-count {
  color: var(--ink-5);
  letter-spacing: 0.06em;
}

.roster-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 12px 12px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.roster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-2);
}

.roster-idx {
  width: 22px;
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ink-5);
  font-variant-numeric: tabular-nums;
}

.roster-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-item.me {
  background: var(--tint);
  color: #323c2c;
  font-weight: 600;
}

.roster-me-tag {
  margin-left: 2px;
  font-size: 10px;
  font-weight: 400;
  color: var(--accent-ink);
  letter-spacing: 0.1em;
}

.roster-reset {
  margin-left: auto;
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
  color: var(--ink-4);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--ink-5);
}

.roster-reset:hover {
  color: var(--ink);
}

.side-foot {
  border-top: 1px solid var(--line);
  padding: 14px 24px calc(18px + env(safe-area-inset-bottom, 0px));
}

.side-user {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.side-user-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.side-user-meta {
  font-size: 11.5px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}

.role-tag {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  background: var(--tint);
  border-radius: 5px;
  padding: 1px 6px;
}

.side-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.side-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 13px;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.side-btn .icon {
  width: 15px;
  height: 15px;
}

.side-btn:hover {
  background: var(--soft);
  border-color: #d6dbcf;
}

.side-btn.danger {
  margin-left: auto;
  color: var(--danger);
  border-color: #eddbd8;
}

.side-btn.danger:hover {
  background: var(--danger-soft);
}

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

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(31, 39, 26, 0.3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade 0.2s var(--ease);
}

.dialog {
  position: relative;
  width: 100%;
  max-width: 564px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 30px 32px 26px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow-dialog);
  animation: rise 0.24s var(--ease);
}

.dialog:focus {
  outline: none;
}

.dialog-wide {
  max-width: 640px;
}

.dialog-narrow {
  max-width: 468px;
}

@keyframes fade {
  from { opacity: 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.995); }
}

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

.dialog-title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--ink);
}

.dialog-close {
  margin-right: -10px;
}

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

.cat-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink-3);
  font-size: 14px;
  letter-spacing: 0.2px;
  transition: all 0.16s var(--ease);
}

.cat-option .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.cat-option:hover {
  border-color: #cfd6c6;
  color: var(--ink-2);
}

.cat-option[aria-checked="true"] {
  border-color: #b9c4ae;
  background: var(--tint);
  color: #323c2c;
  font-weight: 500;
}

.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.dialog-foot .spacer {
  margin-right: auto;
}

.dialog-foot .btn-primary {
  height: 46px;
  padding: 0 26px;
  font-size: 15px;
}

/* 详情 */

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-4);
}

.detail-title {
  margin: 16px 0 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.3px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.detail-content {
  margin: 20px 0 0;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-content a {
  color: #3f5a2f;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #c2cfb4;
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 200;
  transform: translateX(-50%);
  max-width: min(88vw, 420px);
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--btn);
  color: #f6f7f3;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.2px;
  text-align: center;
  box-shadow: var(--shadow-toast);
  animation: toastIn 0.24s var(--ease);
}

.toast.out {
  animation: toastOut 0.2s var(--ease) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translate(-50%, 6px); }
}

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

@media (max-width: 900px) {
  .board-view {
    padding: 16px 0 80px;
  }

  .board-wrap {
    padding: 0 20px;
  }

  .topbar {
    gap: 12px;
    padding-bottom: 18px;
  }

  .topbar .menu-btn {
    margin-left: -8px;
  }

  .page-title {
    font-size: 26px;
    letter-spacing: 0.4px;
  }

  .topbar .btn-primary {
    order: 3;
    margin-left: auto;
    height: 42px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 9px;
  }

  .topbar .btn-primary .icon {
    width: 14px;
    height: 14px;
  }

  .topbar .search {
    order: 5;
    width: 100%;
    height: 48px;
    margin-left: 0;
  }

  .board {
    min-height: calc(100vh - 260px);
  }

  .resultbar {
    padding: 16px 0 2px;
  }

  .post {
    padding: 21px 12px 22px;
    margin: 0 -12px;
  }

  .post-title {
    font-size: 17.5px;
  }

  .post-excerpt {
    font-size: 14.5px;
    line-height: 1.7;
  }

  .post-meta {
    gap: 8px;
    font-size: 12px;
  }

  .state {
    padding-top: clamp(72px, 16vh, 140px);
  }

  .empty-art {
    width: 145px;
    height: 130px;
  }

  .login {
    padding: 110px 22px 80px;
    justify-content: flex-start;
  }

  .login-brand {
    top: 20px;
    left: 18px;
    gap: 14px;
  }

  .login-brand .brand-mark {
    width: 44px;
  }

  .login-brand .brand-name {
    font-size: 27px;
  }

  .login-main {
    margin-top: 8vh;
  }

  .hero-quote {
    font-size: clamp(26px, 7vw, 32px);
    line-height: 1.7;
    letter-spacing: 0.04em;
  }

  .login-card {
    margin-top: 40px;
  }

  .home {
    padding: 108px 22px 80px;
    justify-content: flex-start;
    padding-top: 24vh;
  }

  .home-menu {
    top: 14px;
    left: 14px;
  }

  .home-quote {
    font-size: clamp(24px, 7.2vw, 30px);
    line-height: 1.75;
  }

  .home-search {
    height: 54px;
    margin-top: 40px;
    padding: 0 8px 0 16px;
    border-radius: 12px;
  }

  .home-search-input {
    font-size: 15.5px;
  }

  .home-search-submit {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .home-search-submit svg {
    width: 17px;
    height: 17px;
  }

  .home-hint {
    font-size: 11.5px;
  }

  .sidebar {
    width: min(86vw, 340px);
  }

  /* 弹窗改底部弹层 */
  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .dialog {
    max-width: none;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 22px 20px 0;
    animation: sheetUp 0.28s var(--ease);
  }

  .dialog-foot {
    position: sticky;
    bottom: 0;
    margin: 24px -20px 0;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--bg);
  }

  .field {
    margin-top: 18px;
  }

  .textarea {
    min-height: 118px;
  }

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

  .cat-option {
    height: 44px;
    font-size: 13.5px;
  }

  .dialog-title {
    font-size: 19px;
  }

  .detail-title {
    font-size: 22px;
  }

  .detail-content {
    font-size: 15px;
    line-height: 1.85;
  }

  .dialog-foot .btn-ghost,
  .dialog-foot .btn-primary {
    flex: 1;
  }

  .toast {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 420px) {
  .page-title {
    font-size: 23px;
  }

  .post-title {
    font-size: 16.5px;
  }

  .hero-quote {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* ======================= v3：主页布局（中线分割 + 搜索栏精准居中） ======================= */

.home {
  position: relative;
  display: block;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  padding: 0;
  overflow: hidden;
}

.home::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #ced5c7;
  z-index: 0;
  pointer-events: none;
}

.home-main {
  position: absolute;
  inset: 0;
  width: auto;
  max-width: none;
  text-align: center;
  z-index: 1;
}

.home-quote {
  position: absolute;
  left: 50%;
  top: 37.5%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: -webkit-max-content;
  width: max-content;
  max-width: calc(100vw - 48px);
  white-space: nowrap;
}

.home-search {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 2;
  width: min(560px, calc(100vw - 44px));
  background: var(--bg);
}

.home-hint {
  position: absolute;
  left: 50%;
  top: calc(50% + 54px);
  transform: translateX(-50%);
  margin: 0;
  z-index: 2;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .home-quote {
    font-size: clamp(22px, 7vw, 30px);
  }

  .home-search {
    height: 54px;
    width: min(560px, calc(100vw - 36px));
  }

  .home-hint {
    top: calc(50% + 48px);
  }
}

@media (max-width: 420px) {
  .home-quote {
    font-size: 22px;
    letter-spacing: 0.03em;
  }
}

/* ======================= 附件 ======================= */

.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  font-size: 13.5px;
}

.attach-btn:hover {
  border-color: #b9c4ae;
  color: var(--ink);
}

.attach-btn svg {
  width: 15px;
  height: 15px;
}

.attach-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft, #f7f8f4);
}

.attach-chip[hidden] {
  display: none;
}

.attach-thumb {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.attach-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.attach-name {
  font-size: 13.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-size {
  font-size: 11.5px;
  color: var(--ink-4);
  margin-top: 2px;
}

.attach-remove {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ink-4);
}

.attach-remove:hover {
  color: #b23b3b;
}

.attach-remove .icon {
  width: 13px;
  height: 13px;
}

.attach-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--ink-5);
}

.attach-hint.error {
  color: #b23b3b;
}

.detail-attach {
  margin: 18px 0 0;
}

.detail-attach[hidden] {
  display: none;
}

.detail-attach-img {
  margin: 0;
}

.detail-attach-img img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.detail-attach-img figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-4);
}

.detail-attach-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink-2, var(--ink-3));
  text-decoration: none;
}

.detail-attach-file:hover {
  border-color: #b9c4ae;
  background: var(--bg-soft, #f7f8f4);
}

.detail-attach-file svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--ink-3);
}

.detail-attach-file .detail-attach-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.detail-attach-file .detail-attach-size {
  font-size: 11.5px;
  color: var(--ink-4);
  flex: 0 0 auto;
}

.detail-attach-loading,
.detail-attach-error {
  font-size: 12.5px;
  color: var(--ink-4);
  margin: 0;
}

.post-attach-flag {
  font-size: 11px;
  color: var(--ink-4);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
}

.home-menu {
  z-index: 5;
}



