/* ==========================================================================
   体悟集 · Insight — views.css（页面级布局与响应式）
   ========================================================================== */

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { min-height: calc(100vh - var(--topbar-h)); display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-side { position: relative; padding: 52px; display: flex; flex-direction: column; justify-content: center; gap: 20px; background: linear-gradient(160deg, var(--accent-soft), transparent 55%), var(--surface-2); border-right: 1px solid var(--line); overflow: hidden; }
.auth-side__title { font-family: var(--font-serif); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.3; margin: 0; }
.auth-side__quote { font-family: var(--font-serif); color: var(--muted); max-width: 34em; }
.auth-side__deco { position: absolute; font-family: var(--font-serif); font-size: 260px; color: var(--ink); opacity: .04; right: -30px; bottom: -70px; pointer-events: none; line-height: 1; }
.auth-main { display: grid; place-items: center; padding: 40px 22px; }
.auth-card { width: min(432px, 100%); }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; padding: 9px; border: none; border-bottom: 2px solid var(--line); background: transparent; cursor: pointer; color: var(--muted); font-size: 15px; }
.auth-tabs button.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.feature-list { display: flex; flex-direction: column; gap: 11px; }
.feature { display: flex; gap: 11px; align-items: flex-start; }
.feature__dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); flex: none; font-size: 13px; }

/* ---------- 个人主页 ---------- */
.profile-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 24px; border-radius: var(--radius-l); background: linear-gradient(150deg, var(--accent-soft), transparent 60%), var(--surface); border: 1px solid var(--line); }
.profile-hero__meta { min-width: 0; flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- 首页 Hero ---------- */
.hero { padding: 26px 24px; border-radius: var(--radius-l); border: 1px solid var(--line); background: linear-gradient(140deg, var(--accent-soft), transparent 55%), linear-gradient(320deg, var(--jade-soft), transparent 45%), var(--surface); }
.hero__title { font-family: var(--font-serif); font-size: clamp(22px, 2.6vw, 32px); margin: 0 0 6px; }
.hero__sub { color: var(--muted); margin: 0; max-width: 46em; }

/* ---------- 后台 ---------- */
.admin-shell { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: start; }
.admin-shell > * { min-width: 0; }
.admin-nav { display: flex; flex-direction: column; gap: 3px; }
.admin-nav button { text-align: left; padding: 9px 13px; border-radius: var(--radius-s); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.admin-nav button:hover { background: var(--surface-2); }
.admin-nav button.is-active { background: var(--surface); border-color: var(--line); font-weight: 600; color: var(--ink); box-shadow: var(--shadow-1); }
.code-chip { font-family: var(--font-mono); font-size: 13px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px dashed var(--line-strong); cursor: pointer; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 52px; gap: 10px; align-items: center; font-size: 13px; }

/* ---------- 邀请码 · 模块权限 ---------- */
.invite-module-cell { width: 230px; max-width: 230px; vertical-align: top !important; white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.invite-module-item + .invite-module-item { margin-top: 3px; }
.table-wrap:has(.invite-module-cell) { overflow-x: auto; }
.table-wrap:has(.invite-module-cell) > .table { min-width: 760px; }
.perm-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); font-size: 13px; }
.perm-row.is-on { border-color: var(--line-strong); background: var(--surface); }
.perm-row__pick, .perm-row__title { flex: none; min-width: 150px; font-weight: 600; }
.perm-row__opts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; }
.perm-row__days { width: 132px; min-width: 104px; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .editor__split { grid-template-columns: 1fr; }
  .editor__preview { min-height: 200px; max-height: 40vh; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; overflow-x: auto; }
}
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .page { padding: 16px 12px 80px; }
  .admin-shell { width: 100%; min-width: 0; }
  .admin-shell > [data-role="panel"] { width: 100%; min-width: 0; }
  .topbar { height: auto; padding: 8px 0; }
  .topbar__inner { width: 100%; max-width: none; flex: 0 0 100%; padding: 0 12px; flex-wrap: wrap; }
  .brand__sub { display: none; }
  .navtabs { order: 3; width: 100%; }
  .grid--cards { grid-template-columns: 1fr; }
  .comment--reply { margin-left: 18px; }
  .prose { font-size: 16px; }
  .modal { width: calc(100vw - 16px); max-height: 92vh; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .hero { padding: 18px 16px; }
  .stat__value { font-size: 22px; }
  .table-wrap:has(.invite-module-cell) > .table { min-width: 760px; }
  .invite-module-cell { width: 190px; max-width: 190px; line-height: 1.35; }
  .invite-module-cell > div,
  .invite-module-item { white-space: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .invite-module-item + .invite-module-item { margin-top: 1px; }
}

/* ---------- 打印 ---------- */
@media print {
  .topbar, .reactbar, .composer, .comment__actions, .toast-stack, .admin-nav { display: none !important; }
  body { background: #fff; }
  body::before { display: none; }
  .page { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  /* 无限循环动画用极小 duration 会变成每秒十万次抖动（比正常还刺眼），
     载入指示与载入标记在这里保留各自的正常时长 */
  .spinner { animation-duration: 2s !important; }
  .boot-mark { animation-duration: 1.5s !important; }
}
