/* ==========================================================================
   回声 · 班级问题信箱 — 老师数据后台
   ========================================================================== */

:root {
  --paper: #f4f0e7;
  --card: #fffdf8;
  --ink: #1c2721;
  --ink-soft: #405048;
  --muted: #7b857e;
  --line: #e5ded1;
  --line-strong: #d5caba;
  --jade: #1c5c47;
  --jade-deep: #14271f;
  --jade-soft: #e5efe9;
  --clay: #c46e44;
  --clay-soft: #f8e8df;
  --gold: #bc8c3f;
  --gold-soft: #f7eeda;
  --danger: #a8432f;
  --danger-soft: #fbece7;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --shadow: 0 1px 2px rgba(28, 39, 33, 0.03), 0 12px 32px -16px rgba(28, 39, 33, 0.18);
  --shadow-lg: 0 24px 70px -20px rgba(20, 39, 31, 0.4);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, blockquote, dl, dd, dt {
  margin: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  display: block;
}

::selection {
  background: rgba(28, 92, 71, 0.18);
}

:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   品牌
   -------------------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  color: #e9dcc4;
  border: 1px solid rgba(233, 220, 196, 0.26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.1em;
  color: #f6efdf;
}

.brand-text small {
  padding-left: 9px;
  font-size: 10.5px;
  letter-spacing: 0.15em;
  color: rgba(233, 220, 196, 0.55);
  border-left: 1px solid rgba(233, 220, 196, 0.2);
}

.brand-compact .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.brand-compact .brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-compact .brand-text strong {
  font-size: 19px;
}

.brand-compact .brand-text small {
  font-size: 9.5px;
}

/* --------------------------------------------------------------------------
   查看码入口
   -------------------------------------------------------------------------- */

.gate {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  min-height: 100vh;
  background: var(--paper);
}

.gate-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(30px, 4vw, 52px);
  overflow: hidden;
  color: #f3ecdc;
  background:
    radial-gradient(circle at 18% 88%, rgba(188, 140, 63, 0.18), transparent 26rem),
    radial-gradient(circle at 82% 12%, rgba(126, 173, 147, 0.14), transparent 28rem),
    linear-gradient(150deg, #183329 0%, #10231b 68%, #0d1c16 100%);
}

.gate-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(233, 220, 196, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 220, 196, 0.1) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 40%, black, transparent 78%);
}

.gate-rings {
  position: absolute;
  right: -15%;
  bottom: -26%;
  width: min(620px, 78%);
  aspect-ratio: 1;
  pointer-events: none;
}

.gate-rings span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(233, 220, 196, 0.1);
  border-radius: 50%;
}

.gate-rings span:nth-child(2) {
  inset: 14%;
  border-color: rgba(233, 220, 196, 0.13);
}

.gate-rings span:nth-child(3) {
  inset: 29%;
  border-color: rgba(188, 140, 63, 0.22);
}

.gate-visual-top {
  position: relative;
  z-index: 1;
}

.gate-visual-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
  padding: 48px 0;
  max-width: 540px;
}

.gate-eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: #cda76b;
}

.gate-visual blockquote {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(34px, 3.3vw, 46px);
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: #f7f0e0;
}

.gate-desc {
  max-width: 27em;
  margin-top: 24px;
  font-size: 13px;
  line-height: 1.95;
  color: rgba(233, 220, 196, 0.62);
}

.gate-visual-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: rgba(233, 220, 196, 0.42);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7fb795;
  box-shadow: 0 0 0 4px rgba(127, 183, 149, 0.12);
}

.gate-panel {
  display: grid;
  place-items: center;
  padding: 48px clamp(28px, 5vw, 72px);
  background:
    radial-gradient(circle at 85% 8%, rgba(188, 140, 63, 0.09), transparent 22rem),
    var(--paper);
}

.gate-form-wrap {
  width: min(390px, 100%);
  animation: gate-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.gate-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--gold);
}

.gate-kicker span {
  width: 20px;
  height: 1px;
  background: var(--gold);
}

.gate-form-wrap h1 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(32px, 3.4vw, 40px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.gate-intro {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}

#login-form {
  margin-top: 32px;
}

#login-form label {
  display: block;
  margin-bottom: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.code-field {
  position: relative;
}

.code-field input {
  width: 100%;
  padding: 14px 50px 14px 16px;
  font-size: 17px;
  letter-spacing: 0.22em;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.code-field input::placeholder {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #a8a294;
}

.code-field input:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(28, 92, 71, 0.1);
}

.code-field button {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  transform: translateY(-50%);
}

.code-field button:hover {
  color: var(--jade);
  background: var(--jade-soft);
}

.code-field button svg {
  width: 19px;
  height: 19px;
}

.code-field .eye-closed {
  display: none;
}

.code-field.is-visible .eye-open {
  display: none;
}

.code-field.is-visible .eye-closed {
  display: block;
}

.login-error {
  margin-top: 11px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #f0d2c7;
  border-radius: 8px;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 18px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fbf6e9;
  background: var(--jade);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 22px -12px rgba(28, 92, 71, 0.8);
  transition: background 0.2s ease, transform 0.2s ease;
}

.login-btn:hover {
  background: var(--jade-deep);
}

.login-btn:active {
  transform: translateY(1px);
}

.login-btn svg {
  width: 19px;
  height: 19px;
}

.login-btn:disabled {
  opacity: 0.72;
  cursor: default;
}

.login-loading {
  display: none;
}

.login-btn.is-loading .login-label,
.login-btn.is-loading svg {
  display: none;
}

.login-btn.is-loading .login-loading {
  display: inline;
}

.gate-foot {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.gate-foot p {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.gate-foot a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  font-size: 11.5px;
  color: var(--jade);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.gate-foot a:hover {
  border-color: var(--jade);
}

.gate-foot svg {
  width: 14px;
  height: 14px;
}

@keyframes gate-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.gate-shake {
  animation: gate-shake 0.35s ease;
}

/* --------------------------------------------------------------------------
   后台顶栏
   -------------------------------------------------------------------------- */

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 10px 30px;
  color: #f3ecdc;
  background: rgba(20, 39, 31, 0.97);
  border-bottom: 1px solid rgba(233, 220, 196, 0.1);
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.topbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(233, 220, 196, 0.18);
}

.topbar-page {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(233, 220, 196, 0.62);
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
  font-size: 10.5px;
  color: rgba(233, 220, 196, 0.48);
  white-space: nowrap;
}

.sync-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7fb795;
}

.sync-status.is-loading .sync-dot {
  background: #cda76b;
  animation: pulse 1s ease infinite;
}

.sync-status.is-error .sync-dot {
  background: #df8c74;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(243, 236, 220, 0.78);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(233, 220, 196, 0.16);
  border-radius: 8px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

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

.top-btn:hover {
  color: #fff8e8;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(233, 220, 196, 0.28);
}

.top-btn-accent {
  color: #14271f;
  background: #d9b877;
  border-color: #d9b877;
}

.top-btn-accent:hover {
  color: #14271f;
  background: #e6c98f;
  border-color: #e6c98f;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: rgba(243, 236, 220, 0.6);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   后台主体
   -------------------------------------------------------------------------- */

.admin-main {
  width: min(1320px, calc(100% - 56px));
  margin: 0 auto;
  padding: 38px 0 56px;
}

.admin-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.admin-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--clay);
}

.admin-eyebrow span {
  width: 20px;
  height: 1px;
  background: var(--clay);
}

.admin-intro h1 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.admin-subtitle {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.intro-share {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.intro-share-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--jade);
  background: var(--jade-soft);
  border-radius: 9px;
}

.intro-share-icon svg {
  width: 20px;
  height: 20px;
}

.intro-share span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.intro-share button {
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--jade);
  background: transparent;
  border: 0;
}

.intro-share button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   数据卡片
   -------------------------------------------------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  padding: 18px 20px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(28, 92, 71, 0.06);
  border-radius: 50%;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 2px rgba(28, 39, 33, 0.03), 0 18px 34px -20px rgba(28, 39, 33, 0.3);
}

.stat-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat-icon-jade {
  color: var(--jade);
  background: var(--jade-soft);
}

.stat-icon-clay {
  color: var(--clay);
  background: var(--clay-soft);
}

.stat-icon-gold {
  color: var(--gold);
  background: var(--gold-soft);
}

.stat-icon-ink {
  color: #536a5e;
  background: #eef1ed;
}

.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.stat-value {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-foot {
  margin-top: 2px;
  font-size: 10px;
  color: #9a9f98;
}

/* --------------------------------------------------------------------------
   面板与清单
   -------------------------------------------------------------------------- */

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

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

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 15px;
}

.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.title-count {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 20px;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--jade);
  background: var(--jade-soft);
  border-radius: 999px;
}

.panel-head p {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
}

.search-box {
  position: relative;
  display: block;
  width: 224px;
  flex: none;
}

.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: #a8a294;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 33px;
  font-size: 12px;
  background: #faf7ef;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-box input::placeholder {
  color: #aaa496;
}

.search-box input:focus {
  background: #fffdf9;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(28, 92, 71, 0.08);
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 22px 15px;
  border-bottom: 1px solid var(--line);
}

.filter-bar select {
  padding: 7px 26px 7px 10px;
  max-width: 150px;
  font-size: 11.5px;
  color: var(--ink-soft);
  background-color: #faf7ef;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%237b857e' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.filter-bar select:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(28, 92, 71, 0.08);
}

.filter-result {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.submission-list {
  min-height: 80px;
}

.submission {
  position: relative;
  padding: 17px 22px 15px;
  border-bottom: 1px solid #eee8dc;
  transition: background 0.16s ease;
  cursor: pointer;
}

.submission:last-child {
  border-bottom: 0;
}

.submission:hover {
  background: #fbf8f0;
}

.submission::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 2px;
  background: transparent;
  border-radius: 0 2px 2px 0;
  transition: background 0.16s ease;
}

.submission:hover::before {
  background: rgba(28, 92, 71, 0.35);
}

.submission.is-starred::before {
  background: var(--gold);
}

.sub-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.class-pill {
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--jade);
  background: var(--jade-soft);
  border-radius: 5px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-badge {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  color: #6c6250;
  background: #f4efe3;
  border-radius: 5px;
  white-space: nowrap;
}

.cat-badge[data-category="study"],
.cat-badge[data-category="method"] {
  color: #36604f;
  background: #eaf1ec;
}

.cat-badge[data-category="life"] {
  color: #8a5439;
  background: #f8ece4;
}

.cat-badge[data-category="relation"] {
  color: #7b5a3b;
  background: #f5edde;
}

.cat-badge[data-category="classroom"] {
  color: #4a5b72;
  background: #edf0f5;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 9.5px;
  font-weight: 500;
  color: #8c6a2e;
  background: var(--gold-soft);
  border-radius: 5px;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.is-done {
  color: #4f7460;
  background: #eaf1ec;
}

.star-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: auto;
  padding: 0;
  color: #bbb3a4;
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition: color 0.16s ease, background 0.16s ease;
}

.star-btn svg {
  width: 17px;
  height: 17px;
}

.star-btn:hover {
  color: var(--gold);
  background: var(--gold-soft);
}

.star-btn.is-active {
  color: var(--gold);
}

.star-btn.is-active svg {
  fill: rgba(188, 140, 63, 0.24);
}

.sub-summary {
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.sub-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  font-size: 10px;
  color: #9b9e97;
}

.ticket-no {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: #a9a294;
}

.meta-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #bdb6a8;
}

.nickname {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-open {
  margin-left: auto;
  padding: 3px 7px;
  font-size: 10px;
  color: var(--jade);
  background: transparent;
  border: 0;
  border-radius: 5px;
  opacity: 0.55;
  transition: opacity 0.16s ease, background 0.16s ease;
}

.submission:hover .sub-open,
.submission:focus-within .sub-open {
  opacity: 1;
}

.sub-open:hover {
  background: var(--jade-soft);
}

/* 空状态 */

.empty-state {
  padding: 58px 28px 62px;
  text-align: center;
}

.empty-illustration {
  width: 96px;
  margin: 0 auto 16px;
  color: #b9b1a1;
}

.empty-state h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.empty-state p {
  max-width: 30em;
  margin: 6px auto 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.text-btn {
  margin-top: 16px;
  padding: 8px 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--jade);
  background: transparent;
  border: 1px solid rgba(28, 92, 71, 0.3);
  border-radius: 999px;
}

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

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

.admin-side {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 16px;
}

.side-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 18px 0;
}

.side-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: none;
  color: var(--jade);
  background: var(--jade-soft);
  border-radius: 9px;
}

.side-icon-clay {
  color: var(--clay);
  background: var(--clay-soft);
}

.side-icon-gold {
  color: var(--gold);
  background: var(--gold-soft);
}

.side-icon svg {
  width: 19px;
  height: 19px;
}

.side-head h2 {
  font-size: 13.5px;
  font-weight: 650;
}

.side-head p {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}

.share-link-row {
  display: flex;
  gap: 6px;
  padding: 14px 18px 0;
}

.share-link-row input {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  font-size: 10.5px;
  color: var(--ink-soft);
  background: #faf7ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  text-overflow: ellipsis;
}

.share-link-row input:focus {
  border-color: var(--jade);
}

.share-link-row button {
  display: grid;
  place-items: center;
  width: 36px;
  flex: none;
  padding: 0;
  color: var(--jade);
  background: var(--jade-soft);
  border: 1px solid transparent;
  border-radius: 8px;
}

.share-link-row button:hover {
  color: #fff;
  background: var(--jade);
}

.share-link-row svg {
  width: 17px;
  height: 17px;
}

.share-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 0;
}

.side-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--jade);
  background: transparent;
  border: 1px solid rgba(28, 92, 71, 0.25);
  border-radius: 6px;
}

.side-btn:hover {
  color: #fff;
  background: var(--jade);
}

.side-btn svg {
  width: 12px;
  height: 12px;
}

#share-hint {
  font-size: 9.5px;
  color: #9a9f97;
}

.share-warning {
  margin: 12px 18px 0;
  padding: 9px 10px;
  font-size: 10px;
  line-height: 1.65;
  color: #8a5c2e;
  background: #faf1df;
  border: 1px solid #eddfc0;
  border-radius: 7px;
}

.share-code-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 18px 17px;
  padding-top: 11px;
  font-size: 9.5px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
}

.share-code-note svg {
  width: 13px;
  height: 13px;
  flex: none;
  color: var(--gold);
}

.dist-list {
  display: grid;
  gap: 11px;
  padding: 15px 18px 18px;
}

.dist-row {
  display: grid;
  gap: 5px;
}

.dist-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-soft);
}

.dist-label span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dist-bar {
  height: 5px;
  background: #f0ebe0;
  border-radius: 999px;
  overflow: hidden;
}

.dist-fill {
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, #2a7059, #6ba089);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.dist-row:nth-child(3n + 2) .dist-fill {
  background: linear-gradient(90deg, #b97b50, #d7a77e);
}

.dist-row:nth-child(3n + 3) .dist-fill {
  background: linear-gradient(90deg, #b08a45, #d3b77e);
}

.class-list {
  display: grid;
  gap: 1px;
  padding: 10px 18px 14px;
}

.class-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed #eee8dc;
}

.class-row:last-child {
  border-bottom: 0;
}

.class-rank {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  font-family: var(--serif);
  font-size: 9px;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 5px;
}

.class-name {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-count {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.side-empty {
  padding: 4px 0 6px;
  font-size: 10px;
  color: var(--muted);
}

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

.admin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1320px, calc(100% - 56px));
  margin: 0 auto;
  padding: 20px 0 28px;
  font-size: 9.5px;
  color: #9da198;
  border-top: 1px solid rgba(213, 202, 186, 0.55);
}

.admin-footer code {
  padding: 1px 4px;
  font-size: 9px;
  background: #eae4d8;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   详情弹窗
   -------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 28, 22, 0.52);
  backdrop-filter: blur(3px);
  animation: fade-in 0.2s ease both;
}

.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  max-height: min(86vh, 820px);
  background: var(--card);
  border: 1px solid rgba(213, 202, 186, 0.8);
  border-radius: 19px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 0.26s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
}

.modal-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal-close:hover {
  color: var(--ink);
  background: #f5f0e6;
}

.modal-close svg {
  width: 17px;
  height: 17px;
}

.modal-body {
  padding: 14px 24px 24px;
  overflow-y: auto;
}

.modal-ticket {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #a9a294;
}

.modal-body h2 {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.4;
}

.detail-text {
  margin-top: 13px;
  padding: 15px 17px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fbf8f0;
  border: 1px solid #ede6d8;
  border-radius: 11px;
}

.detail-text-muted {
  color: #6f786f;
  background: #faf8f2;
}

.detail-text.is-empty {
  color: #a7a294;
  font-style: normal;
}

.detail-section {
  margin-top: 22px;
}

.detail-section h3 {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.detail-meta div {
  padding: 10px 13px;
  background: #fdfbf5;
}

.detail-meta dt {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.detail-meta dd {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 24px;
  background: #fbf8f0;
  border-top: 1px solid var(--line);
}

.modal-foot-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.modal-btn svg {
  width: 14px;
  height: 14px;
}

.modal-btn:hover {
  background: #f3ede2;
}

.modal-btn.is-active {
  color: var(--gold);
  background: var(--gold-soft);
  border-color: #e7d5ad;
}

.modal-btn.is-active svg {
  fill: rgba(188, 140, 63, 0.25);
}

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

.modal-primary {
  padding: 9px 17px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: var(--jade);
  border: 1px solid var(--jade);
  border-radius: 8px;
  white-space: nowrap;
}

.modal-primary:hover {
  background: var(--jade-deep);
}

.modal-primary.is-done {
  color: var(--jade);
  background: transparent;
  border-color: rgba(28, 92, 71, 0.35);
}

body.modal-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 200;
  padding: 11px 20px;
  font-size: 12.5px;
  color: #fbf6e9;
  background: rgba(20, 39, 31, 0.96);
  border: 1px solid rgba(233, 220, 196, 0.16);
  border-radius: 999px;
  box-shadow: 0 16px 36px -12px rgba(20, 39, 31, 0.5);
  transform: translate(-50%, 14px);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

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

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

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

  .admin-side {
    position: static;
    top: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .share-panel {
    grid-column: span 1;
  }
}

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

  .gate-visual {
    min-height: 280px;
    padding: 28px 32px;
  }

  .gate-visual-copy {
    padding: 34px 0 26px;
  }

  .gate-visual blockquote {
    margin-top: 12px;
    font-size: 32px;
  }

  .gate-desc {
    display: none;
  }

  .gate-visual-foot {
    margin-top: auto;
  }

  .gate-rings {
    right: -8%;
    bottom: -70%;
  }

  .gate-panel {
    padding: 40px 26px 52px;
  }

  .admin-topbar {
    padding: 10px 20px;
  }

  .admin-main,
  .admin-footer {
    width: calc(100% - 40px);
  }

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

  .admin-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar-page,
  .topbar-divider,
  .brand-compact .brand-text small,
  .sync-status {
    display: none;
  }

  .admin-topbar {
    padding: 9px 14px;
    min-height: 60px;
  }

  .top-btn {
    padding: 8px 9px;
  }

  .top-btn span {
    display: none;
  }

  .top-btn svg {
    width: 17px;
    height: 17px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .admin-main {
    width: calc(100% - 28px);
    padding-top: 26px;
  }

  .admin-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .admin-intro h1 {
    font-size: 31px;
  }

  .intro-share {
    width: 100%;
    justify-content: space-between;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 14px 15px 13px;
  }

  .stat-value {
    font-size: 30px;
  }

  .panel-head {
    flex-direction: column;
    gap: 12px;
    padding: 17px 16px 13px;
  }

  .search-box {
    width: 100%;
  }

  .filter-bar {
    padding: 0 16px 13px;
  }

  .filter-bar label {
    flex: 1 1 100px;
    min-width: 0;
  }

  .filter-bar select {
    width: 100%;
    max-width: none;
    font-size: 16px;
  }

  .search-box input {
    font-size: 16px;
  }

  .share-link-row input {
    font-size: 16px;
  }

  .filter-result {
    width: 100%;
    margin-left: 0;
  }

  .submission {
    padding: 15px 16px 13px;
  }

  .sub-open {
    opacity: 1;
  }

  .sub-summary {
    font-size: 13px;
  }

  .sub-foot {
    flex-wrap: wrap;
  }

  .modal {
    padding: 12px;
  }

  .modal-card {
    max-height: 92vh;
    border-radius: 16px;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 18px;
    padding-right: 18px;
  }

  .modal-body h2 {
    font-size: 22px;
  }

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

  .modal-foot {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-foot-left {
    justify-content: space-between;
  }

  .modal-primary {
    width: 100%;
    padding: 11px;
  }

  .admin-footer {
    width: calc(100% - 28px);
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .gate-visual {
    min-height: 235px;
    padding: 22px 22px;
  }

  .gate-visual blockquote {
    font-size: 26px;
  }

  .gate-visual-copy {
    padding: 24px 0 18px;
  }

  .gate-panel {
    padding: 32px 22px 42px;
  }

  .gate-form-wrap h1 {
    font-size: 31px;
  }

  .admin-side {
    gap: 12px;
  }
}

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