:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #eef5ff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --text: #142033;
  --muted: #64748b;
  --line: #dbe3ef;
  --blue: #1f6feb;
  --blue-dark: #164bb2;
  --green: #1f9d74;
  --red: #df3b4f;
  --amber: #b7791f;
  --shadow: 0 18px 55px rgba(31, 59, 101, 0.12);
  --glow: 0 18px 48px rgba(31, 111, 235, 0.12);
}

body[data-theme="dark"] {
  --bg: #0f172a;
  --panel: #162033;
  --panel-soft: #1d2b45;
  --glass: rgba(22, 32, 51, 0.72);
  --glass-strong: rgba(22, 32, 51, 0.88);
  --text: #e5edf8;
  --muted: #9fb0c7;
  --line: #2b3b55;
  --blue: #5b9cff;
  --blue-dark: #8ab8ff;
  --green: #31c48d;
  --red: #ff7182;
  --amber: #f2b84b;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  --glow: 0 18px 48px rgba(91, 156, 255, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31, 111, 235, 0.1), transparent 30%),
    linear-gradient(215deg, rgba(31, 157, 116, 0.1), transparent 32%),
    repeating-linear-gradient(90deg, rgba(31, 111, 235, 0.05) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(31, 157, 116, 0.04) 0 1px, transparent 1px 46px),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body[data-theme="dark"] {
  background:
    linear-gradient(135deg, rgba(91, 156, 255, 0.1), transparent 30%),
    linear-gradient(215deg, rgba(49, 196, 141, 0.09), transparent 32%),
    repeating-linear-gradient(90deg, rgba(91, 156, 255, 0.07) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(49, 196, 141, 0.05) 0 1px, transparent 1px 46px),
    var(--bg);
  background-attachment: fixed;
}

body[data-theme="dark"] .topbar {
  background: rgba(15, 23, 42, 0.78);
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .search-box,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .icon-button,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .form-panel input,
body[data-theme="dark"] .form-panel select,
body[data-theme="dark"] .form-panel textarea {
  background: #111c2f;
  color: var(--text);
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #7588a4;
}

body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .icon-button {
  border-color: var(--line);
}

body[data-theme="dark"] .hero-panel {
  color: var(--text);
  background:
    linear-gradient(128deg, rgba(8, 18, 35, 0.98) 0%, rgba(16, 33, 67, 0.97) 45%, rgba(25, 42, 91, 0.95) 100%),
    linear-gradient(35deg, rgba(91, 156, 255, 0.12), transparent 42%),
    repeating-linear-gradient(90deg, rgba(91, 156, 255, 0.08) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(139, 179, 255, 0.05) 0 1px, transparent 1px 42px);
  border-color: rgba(139, 179, 255, 0.18);
  box-shadow: 0 24px 60px rgba(2, 8, 23, 0.34);
}

body[data-theme="dark"] .hero-stats img,
body[data-theme="dark"] .hero-metrics span {
  background: rgba(17, 28, 47, 0.78);
  border-color: rgba(91, 156, 255, 0.18);
}

body[data-theme="dark"] .post-card p,
body[data-theme="dark"] .board-card p,
body[data-theme="dark"] .mall-card p {
  color: var(--muted);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .post-card,
body[data-theme="dark"] .board-card,
body[data-theme="dark"] .mall-card,
body[data-theme="dark"] .admin-card,
body[data-theme="dark"] .form-panel,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .captcha-card,
body[data-theme="dark"] .agreement-panel,
body[data-theme="dark"] .agreement-html.compact-html,
body[data-theme="dark"] .reply {
  background: var(--glass);
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

body[data-theme="dark"] .tag,
body[data-theme="dark"] .chip,
body[data-theme="dark"] .status {
  background: rgba(91, 156, 255, 0.13);
  color: #b8d4ff;
  border: 1px solid rgba(91, 156, 255, 0.18);
}

body[data-theme="dark"] .status.ok {
  background: rgba(49, 196, 141, 0.14);
  color: #8ee7c4;
  border-color: rgba(49, 196, 141, 0.2);
}

body[data-theme="dark"] .status.warn {
  background: rgba(242, 184, 75, 0.15);
  color: #ffd98a;
  border-color: rgba(242, 184, 75, 0.22);
}

body[data-theme="dark"] .status.danger {
  background: rgba(255, 113, 130, 0.15);
  color: #ffb3bf;
  border-color: rgba(255, 113, 130, 0.22);
}

body[data-theme="dark"] .filter-button:hover,
body[data-theme="dark"] .contact-choice label:hover span {
  border-color: rgba(91, 156, 255, 0.45);
  box-shadow: 0 8px 18px rgba(91, 156, 255, 0.12);
}

body[data-theme="dark"] .post-card:hover,
body[data-theme="dark"] .board-card:hover,
body[data-theme="dark"] .mall-card:hover,
body[data-theme="dark"] .user-result-card:hover {
  border-color: rgba(91, 156, 255, 0.28);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.32);
}

body[data-theme="dark"] .contact-choice span,
body[data-theme="dark"] .badge-pill {
  background: #111c2f;
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="dark"] th,
body[data-theme="dark"] td {
  border-color: var(--line);
}

body[data-theme="dark"] .captcha-image {
  background-color: #111c2f;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  grid-template-rows: 72px 1fr;
}

.topbar {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  background: var(--glass-strong);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 32px rgba(31, 59, 101, 0.08);
  backdrop-filter: blur(18px) saturate(1.25);
}

.brand {
  min-width: 245px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 96px;
  height: 42px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.search-box {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  color: var(--muted);
  backdrop-filter: blur(12px);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

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

.sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(1.18);
}

.nav-item {
  width: 100%;
  margin-bottom: 8px;
  padding: 13px 14px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--blue);
  background: rgba(31, 111, 235, 0.1);
  box-shadow: inset 3px 0 0 var(--blue);
  transform: translateX(2px);
}

.content {
  padding: 24px;
  overflow: hidden;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: center;
  gap: 24px;
  min-height: 190px;
  margin-bottom: 24px;
  padding: 30px;
  color: var(--text);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 250, 247, 0.92) 48%, rgba(238, 245, 255, 0.94)),
    repeating-linear-gradient(90deg, rgba(31, 111, 235, 0.08) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(31, 157, 116, 0.07) 0 1px, transparent 1px 42px);
  border: 1px solid rgba(31, 111, 235, 0.12);
  box-shadow: var(--glow);
  backdrop-filter: blur(18px) saturate(1.18);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.42) 42%, transparent 66%);
  transform: translateX(-70%);
  animation: glassSheen 8s ease-in-out infinite;
  pointer-events: none;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0 18%, rgba(31, 111, 235, 0.08) 24%, transparent 32%),
    linear-gradient(110deg, transparent 0 48%, rgba(31, 157, 116, 0.08) 56%, transparent 66%);
  background-size: 220% 100%;
  animation: heroLightFlow 10s ease-in-out infinite;
  pointer-events: none;
}

body[data-theme="dark"] .hero-panel::after {
  background:
    linear-gradient(110deg, transparent 0 18%, rgba(91, 156, 255, 0.13) 24%, transparent 32%),
    linear-gradient(110deg, transparent 0 48%, rgba(49, 196, 141, 0.11) 56%, transparent 66%);
}

.hero-panel > * {
  position: relative;
  z-index: 1;
}

.hero-panel h1 {
  max-width: 760px;
  margin: 6px 0 10px;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.12;
}

.hero-panel p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.eyebrow {
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0;
}

.hero-stats {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
}

.hero-stats img {
  width: min(300px, 100%);
  max-width: 100%;
  height: auto;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(31, 111, 235, 0.12);
  box-shadow: 0 10px 28px rgba(31, 59, 101, 0.08);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 10px;
  width: 100%;
}

.hero-metrics span {
  padding: 12px;
  border: 1px solid rgba(31, 111, 235, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
  color: var(--muted);
  box-shadow: 0 8px 20px rgba(31, 59, 101, 0.06);
}

.hero-metrics strong {
  display: block;
  font-size: 24px;
  color: var(--blue-dark);
}

.view {
  display: grid;
  gap: 18px;
}

.site-footer {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  padding: 22px 12px 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

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

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
}

.profile-grid {
  align-items: start;
}

.profile-grid > .form-panel,
.profile-grid > .panel {
  align-self: start;
}

.home-layout {
  align-items: start;
}

.home-aside {
  align-self: start;
  align-content: start;
  grid-auto-rows: max-content;
}

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

.panel,
.post-card,
.board-card,
.mall-card,
.admin-card,
.form-panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(31, 59, 101, 0.08);
  backdrop-filter: blur(16px) saturate(1.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.panel,
.admin-card,
.form-panel {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2,
.section-head h3,
.form-panel h2,
.form-panel h3 {
  margin: 0;
}

.sorts,
.chips,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.board-card .row-actions {
  margin-top: 12px;
}

.post-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.post-card:hover,
.board-card:hover,
.mall-card:hover,
.user-result-card:hover {
  transform: translateY(-3px);
  border-color: rgba(31, 111, 235, 0.24);
  box-shadow: 0 20px 44px rgba(31, 59, 101, 0.14);
}

.post-card h3 {
  margin: 0;
  font-size: 20px;
}

.post-title-link,
.post-excerpt-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.post-title-link {
  color: var(--text);
  font-size: inherit;
  font-weight: 800;
  line-height: 1.35;
}

.post-excerpt-link {
  color: var(--muted);
  line-height: 1.75;
}

.post-title-link:hover {
  color: var(--blue);
}

.post-excerpt-link:hover {
  color: var(--blue-dark);
}

.post-author-row {
  width: fit-content;
  max-width: 100%;
  padding: 2px 0;
  color: var(--muted);
}

.post-author-row .author-link {
  color: var(--text);
}

.post-author-row .author-link:hover {
  color: var(--blue);
}

.post-card p {
  margin: 0;
  color: var(--muted);
}

.meta,
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.author-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.author-link:hover {
  color: var(--blue);
}

.user-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef5ff;
  overflow: visible;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-avatar b {
  font-size: 12px;
  color: var(--blue-dark);
}

.user-avatar.has-frame::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 1;
  border: 2px solid var(--frame-color, var(--blue));
  border-radius: 50%;
  pointer-events: none;
}

.user-avatar i {
  position: absolute;
  right: -5px;
  bottom: -5px;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--frame-color, var(--blue));
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(20, 32, 51, 0.18);
}

.avatar-xs {
  width: 22px;
  height: 22px;
}

.avatar-xs.has-frame::after {
  inset: -1px;
  border-width: 1px;
}

.avatar-lg {
  width: 72px;
  height: 72px;
}

.profile-avatar-preview,
.user-home-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-home-head h2 {
  margin: 0;
}

.dress-center {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.security-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0 16px;
}

.security-row,
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.security-row {
  min-height: 74px;
}

.profile-grid > .form-panel:nth-child(2) {
  display: grid;
  gap: 12px;
}

.profile-grid > .form-panel:nth-child(2) h2 {
  margin-top: 0;
}

.security-row div,
.status-card {
  min-width: 0;
}

.security-row strong,
.status-card strong {
  display: block;
  color: var(--text);
}

.security-row span,
.status-card span {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.security-row .ghost-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.status-card {
  align-items: flex-start;
  flex-direction: column;
}

.ok-card {
  border-color: rgba(31, 111, 235, 0.24);
  background: rgba(31, 111, 235, 0.08);
}

.real-auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.real-auth-modal-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
  width: min(780px, calc(100vw - 44px));
}

.real-auth-aside {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(31, 111, 235, 0.16), transparent 34%),
    var(--panel-soft);
}

.real-auth-aside h2 {
  margin: 0;
}

.real-auth-status {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(31, 111, 235, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.real-auth-status strong {
  color: var(--text);
}

.real-auth-status span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.real-auth-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 245, 255, 0.82)),
    var(--panel-soft);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.real-auth-button:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 111, 235, 0.32);
  box-shadow: 0 14px 28px rgba(31, 59, 101, 0.12);
}

.real-auth-button b {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 15px;
  overflow: hidden;
}

.real-auth-button b img {
  width: 100%;
  height: 100%;
  display: block;
}

.real-auth-button span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.real-auth-button strong {
  color: var(--text);
  font-size: 14px;
}

.real-auth-button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.settings-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(238, 245, 255, 0.78)),
    var(--panel-soft);
  color: var(--text);
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.settings-card:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 111, 235, 0.32);
  box-shadow: 0 16px 34px rgba(31, 59, 101, 0.12);
}

.settings-card b {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: 0 12px 22px rgba(31, 111, 235, 0.2);
  overflow: hidden;
}

.settings-card b img {
  width: 100%;
  height: 100%;
  display: block;
}

.settings-card > span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.settings-card strong {
  font-size: 15px;
}

.settings-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.setting-check-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.setting-check-group > strong {
  color: var(--text);
}

.admin-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(238, 245, 255, 0.74)),
    var(--panel-soft);
}

.admin-search-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.admin-search-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--blue);
  background: #ffffff;
  border: 1px solid rgba(31, 111, 235, 0.14);
  box-shadow: 0 10px 22px rgba(31, 59, 101, 0.08);
  font-size: 18px;
  font-weight: 800;
}

.admin-search-main label {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-search-main input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
}

.admin-search-count {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: rgba(31, 111, 235, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.mall-admin-layout {
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  align-items: start;
}

.admin-card {
  min-width: 0;
  overflow: hidden;
}

.frame-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.frame-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.frame-card strong {
  color: var(--text);
}

.frame-card small {
  color: var(--muted);
  line-height: 1.5;
}

.user-result-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

body[data-theme="dark"] .frame-card,
body[data-theme="dark"] .user-result-card,
body[data-theme="dark"] .dress-center {
  background: #111c2f;
  border-color: var(--line);
}

body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .admin-search-toolbar,
body[data-theme="dark"] .real-auth-button,
body[data-theme="dark"] .real-auth-aside {
  background: linear-gradient(135deg, rgba(17, 28, 47, 0.94), rgba(23, 37, 62, 0.86));
  border-color: var(--line);
}

body[data-theme="dark"] .real-auth-status {
  background: rgba(15, 23, 42, 0.66);
  border-color: var(--line);
}

body[data-theme="dark"] .admin-search-icon,
body[data-theme="dark"] .admin-search-main input {
  background: rgba(15, 23, 42, 0.76);
  border-color: var(--line);
}

body[data-theme="dark"] .admin-search-count {
  color: #bfdbfe;
  background: rgba(73, 145, 255, 0.16);
}

.badge-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.badge-pill {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 4px 10px;
  align-items: center;
  min-height: 78px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}

.badge-pill::after {
  content: "";
  position: absolute;
  inset: auto -22px -28px auto;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
}

.badge-pill b {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--blue);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.12), 0 8px 18px rgba(31, 111, 235, 0.14);
  font-size: 20px;
}

.badge-pill span {
  position: relative;
  z-index: 1;
  font-weight: 700;
  color: var(--text);
}

.badge-pill small {
  position: relative;
  z-index: 1;
  grid-column: 2;
  color: var(--muted);
  line-height: 1.5;
}

.badge-official {
  border-color: rgba(31, 111, 235, 0.24);
  background: linear-gradient(135deg, #eaf3ff, #ffffff);
}

.badge-official span {
  color: #164bb2;
}

.badge-official small {
  color: #335f9f;
}

.badge-official b {
  color: #ffffff;
  background: linear-gradient(135deg, #1f6feb, #164bb2);
}

.badge-creator {
  border-color: rgba(31, 157, 116, 0.24);
  background: linear-gradient(135deg, #e7fbf3, #ffffff);
}

.badge-creator span {
  color: #0f766e;
}

.badge-creator small {
  color: #287a67;
}

.badge-creator b {
  color: #ffffff;
  background: linear-gradient(135deg, #1f9d74, #0f766e);
}

.badge-expert {
  border-color: rgba(183, 121, 31, 0.28);
  background: linear-gradient(135deg, #fff7df, #ffffff);
}

.badge-expert span {
  color: #9a6400;
}

.badge-expert small {
  color: #8a5a10;
}

.badge-expert b {
  color: #ffffff;
  background: linear-gradient(135deg, #b7791f, #9a3412);
}

.author-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.reply > strong.author-line,
.reply .author-line {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.reply > strong.author-line .author-link,
.reply .author-line .author-link,
.reply > strong.author-line .mini-badge,
.reply .author-line .mini-badge {
  flex: 0 0 auto;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 7px 2px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.mini-badge b {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--blue);
  font-size: 11px;
}

.mini-badge.badge-official {
  border-color: rgba(31, 111, 235, 0.28);
  background: #edf4ff;
  color: var(--blue-dark);
}

.mini-badge.badge-official b {
  color: #ffffff;
  background: var(--blue);
}

.mini-badge.badge-creator {
  border-color: rgba(31, 157, 116, 0.28);
  background: #e7fbf3;
  color: #0f766e;
}

.mini-badge.badge-creator b {
  color: #ffffff;
  background: var(--green);
}

.mini-badge.badge-expert {
  border-color: rgba(183, 121, 31, 0.28);
  background: #fff7df;
  color: #9a6400;
}

.mini-badge.badge-expert b {
  color: #ffffff;
  background: var(--amber);
}

.mini-badge.vanity-id-badge {
  width: auto;
  min-height: 24px;
  padding: 2px 8px 2px 3px;
  justify-content: center;
  border-color: rgba(223, 59, 79, 0.24);
  background: #fff0f3;
  color: #b4233b;
  font-weight: 800;
}

.mini-badge.vanity-id-badge b {
  width: 20px;
  height: 20px;
  color: #ffffff;
  background: linear-gradient(135deg, #df3b4f, #b7791f);
}

.vanity-display-badge {
  border-color: rgba(223, 59, 79, 0.26);
  background: linear-gradient(135deg, #fff0f3, #fff8e8);
}

.vanity-display-badge span {
  color: #b4233b;
}

.vanity-display-badge small {
  color: #9a3412;
}

.vanity-display-badge b {
  color: #ffffff;
  background: linear-gradient(135deg, #df3b4f, #b7791f);
}

body[data-theme="dark"] .mini-badge.vanity-id-badge {
  border-color: rgba(255, 113, 130, 0.35);
  background: rgba(255, 113, 130, 0.14);
  color: #ffb3bf;
}

body[data-theme="dark"] .vanity-display-badge {
  border-color: rgba(255, 113, 130, 0.3);
  background: linear-gradient(135deg, rgba(255, 113, 130, 0.14), rgba(242, 184, 75, 0.12));
}

body[data-theme="dark"] .vanity-display-badge span,
body[data-theme="dark"] .vanity-display-badge small {
  color: #ffb3bf;
}

body[data-theme="dark"] .badge-official span,
body[data-theme="dark"] .badge-official small {
  color: #b8d4ff;
}

body[data-theme="dark"] .badge-creator span,
body[data-theme="dark"] .badge-creator small {
  color: #8ee7c4;
}

body[data-theme="dark"] .badge-expert span,
body[data-theme="dark"] .badge-expert small {
  color: #ffd98a;
}

.tag,
.status,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(31, 111, 235, 0.12);
  background: rgba(237, 244, 255, 0.72);
  color: var(--blue-dark);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
}

.status.warn {
  color: var(--amber);
  background: #fff7df;
}

.status.danger {
  color: var(--red);
  background: #fff0f3;
}

.status.ok {
  color: var(--green);
  background: #e7fbf3;
}

.board-card,
.mall-card {
  padding: 16px;
}

.mall-card {
  display: grid;
  gap: 12px;
}

.board-card h3,
.mall-card h3 {
  margin: 0 0 8px;
}

.board-card p,
.mall-card p {
  margin: 0;
  color: var(--muted);
}

.mall-card .row-actions {
  margin-top: 8px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 12px 24px rgba(31, 111, 235, 0.18);
}

.primary-button:hover {
  filter: saturate(1.08);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(31, 111, 235, 0.24);
}

.ghost-button,
.icon-button {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(12px);
}

.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 111, 235, 0.28);
  box-shadow: 0 12px 24px rgba(31, 59, 101, 0.1);
}

.theme-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-inline: 10px 12px;
  overflow: hidden;
}

.theme-toggle-icon {
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  font-size: 12px;
  line-height: 1;
}

.theme-toggle-text {
  line-height: 1;
}

.theme-toggle-button.selected .theme-toggle-icon {
  background: linear-gradient(135deg, var(--amber), var(--blue));
}

#authButton {
  color: #ffffff;
  border-color: rgba(31, 111, 235, 0.2);
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.18);
}

#authButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31, 111, 235, 0.24);
}

body[data-theme="dark"] #authButton {
  color: #ffffff;
  border-color: rgba(91, 156, 255, 0.35);
  background: linear-gradient(135deg, #2f7df4, #1d4ed8);
  box-shadow: 0 8px 18px rgba(91, 156, 255, 0.14);
}

.filter-button:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 111, 235, 0.45);
  color: var(--blue-dark);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.12);
}

.filter-button.selected {
  color: #ffffff;
  border-color: var(--blue);
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.25);
}

.filter-button.selected:hover {
  transform: translateY(-1px);
  color: #ffffff;
  background: var(--blue-dark);
}

.tabs .filter-button,
.sorts .filter-button {
  color: var(--blue-dark);
  border-color: rgba(31, 111, 235, 0.18);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.tabs .filter-button.selected,
.sorts .filter-button.selected {
  color: #ffffff;
  border-color: rgba(31, 111, 235, 0.72);
  background: linear-gradient(135deg, #1f6feb, #164bb2);
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.22);
}

.post-card .primary-button {
  color: #ffffff;
  border-color: rgba(31, 111, 235, 0.38);
  background: linear-gradient(135deg, #1f6feb, #164bb2);
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.18);
}

.post-card .primary-button:hover {
  background: linear-gradient(135deg, #2f7df4, #1f6feb);
}

.auth-layout .primary-button {
  color: #ffffff;
  border-color: rgba(31, 111, 235, 0.38);
  background: linear-gradient(135deg, #1f6feb, #164bb2);
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.18);
}

.auth-layout .primary-button:hover {
  background: linear-gradient(135deg, #2f7df4, #1f6feb);
  box-shadow: 0 14px 26px rgba(31, 111, 235, 0.24);
}

body[data-theme="dark"] .tabs .filter-button,
body[data-theme="dark"] .sorts .filter-button {
  color: #b8d4ff;
  border-color: rgba(91, 156, 255, 0.22);
  background: rgba(17, 28, 47, 0.88);
  box-shadow: none;
}

body[data-theme="dark"] .tabs .filter-button:hover,
body[data-theme="dark"] .sorts .filter-button:hover {
  color: #ffffff;
  border-color: rgba(139, 179, 255, 0.42);
  background: rgba(24, 45, 83, 0.96);
}

body[data-theme="dark"] .tabs .filter-button.selected,
body[data-theme="dark"] .sorts .filter-button.selected,
body[data-theme="dark"] .post-card .primary-button,
body[data-theme="dark"] .auth-layout .primary-button {
  color: #ffffff;
  border-color: rgba(139, 179, 255, 0.42);
  background: linear-gradient(135deg, #2f7df4, #1d4ed8);
  box-shadow: 0 10px 22px rgba(47, 125, 244, 0.18);
}

body[data-theme="dark"] .auth-layout .ghost-button {
  color: #b8d4ff;
  border-color: rgba(91, 156, 255, 0.3);
  background: rgba(91, 156, 255, 0.1);
}

body[data-theme="dark"] .auth-layout .ghost-button:hover {
  color: #ffffff;
  border-color: rgba(139, 179, 255, 0.48);
  background: rgba(47, 125, 244, 0.24);
}

.danger-button {
  color: #ffffff;
  background: var(--red);
}

.full {
  width: 100%;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.nav-toggle {
  display: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.tabs button {
  width: auto;
  min-width: max-content;
  justify-content: center;
  white-space: normal;
}

.compact-tabs {
  margin: 10px 0 16px;
}

.form-panel {
  display: grid;
  gap: 12px;
}

.form-panel.compact {
  max-width: 460px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 360px);
  gap: 0;
  align-items: stretch;
  max-height: calc(100vh - 110px);
  background: #ffffff;
}

.agreement-panel {
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.agreement-html h3,
.agreement-html p {
  margin: 0;
}

.agreement-html {
  display: grid;
  gap: 10px;
}

.agreement-html.compact-html {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.agreement-html p,
.agreement-html li {
  color: var(--muted);
  line-height: 1.7;
}

.agreement-html a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.agreement-check,
.form-panel .agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}

.agreement-check input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 3px;
}

.agreement-check a,
.agreement-html a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.form-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-section-note {
  margin: 2px 0 -4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.field-error {
  min-height: 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.auth-layout .field-error:empty {
  display: none;
  min-height: 0;
}

.auth-layout .field-error:not(:empty) {
  display: block;
  margin-top: 2px;
}

.field-invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(223, 59, 79, 0.1);
}

body[data-theme="dark"] .field-error {
  color: #ffb3bf;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

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

.inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.inline-fields .ghost-button {
  min-width: 112px;
}

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

.contact-choice label {
  display: block;
  position: relative;
}

.contact-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.contact-choice span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.contact-choice input:checked + span {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.2);
}

.contact-choice label:hover span {
  transform: translateY(-1px);
  border-color: rgba(31, 111, 235, 0.45);
}

.form-panel .agreement-check input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.post-detail {
  display: grid;
  gap: 16px;
}

.post-body {
  line-height: 1.8;
  white-space: pre-wrap;
}

.code-block {
  position: relative;
  margin: 14px 0;
  padding: 16px;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #22304a;
  background: #101827;
  color: #d8e4ff;
  line-height: 1.65;
  white-space: pre;
}

.code-block code {
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 13px;
}

.code-block code::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 12px;
  color: #8ea4c8;
  font-size: 12px;
}

.reply {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.reply strong {
  display: block;
  margin-bottom: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
}

.modal.show {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(900px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.18);
}

.modal-card:has(.auth-layout) {
  width: min(860px, 100%);
  overflow: hidden;
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 1px solid rgba(31, 111, 235, 0.12);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 40, 82, 0.22);
  backdrop-filter: none;
}

.modal-card:has(.auth-layout)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.modal-card:has(.auth-layout) .modal-close {
  top: 14px;
  right: 14px;
  color: #1f6feb;
  border-color: rgba(31, 111, 235, 0.16);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 59, 101, 0.14);
}

.modal-card:has(.auth-layout) .modal-close:hover {
  color: #ffffff;
  border-color: rgba(31, 111, 235, 0.42);
  background: linear-gradient(135deg, #1f6feb, #164bb2);
  box-shadow: 0 12px 26px rgba(31, 111, 235, 0.22);
}

.auth-layout .form-panel {
  gap: 10px;
  max-width: none;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 28px 30px 26px;
  border: 0;
  border-left: 1px solid rgba(219, 227, 239, 0.9);
  border-radius: 0 14px 14px 0;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

.auth-layout .form-panel input,
.auth-layout .form-panel select {
  min-height: 38px;
  border-color: #d7e1ef;
  background: #f7faff;
  backdrop-filter: none;
}

.auth-layout .form-panel input:focus,
.auth-layout .form-panel select:focus {
  outline: none;
  border-color: rgba(31, 111, 235, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.1);
}

.modal-card:has(.auth-layout) .agreement-panel {
  min-height: 100%;
  overflow: hidden;
  padding: 30px 26px 26px;
  border: 0;
  border-radius: 14px 0 0 14px;
  background:
    linear-gradient(145deg, rgba(31, 111, 235, 0.1), transparent 42%),
    linear-gradient(330deg, rgba(31, 157, 116, 0.12), transparent 45%),
    #f4f8ff;
}

.modal-card:has(.auth-layout) .agreement-html.compact-html {
  padding: 14px;
  border-color: rgba(31, 111, 235, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.modal-card:has(.auth-layout) .agreement-html h3 {
  color: #12366b;
}

body[data-theme="dark"] .modal-card:has(.auth-layout) {
  border-color: rgba(91, 156, 255, 0.18);
  background: #121d30;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

body[data-theme="dark"] .modal-card:has(.auth-layout) .modal-close {
  color: #b8d4ff;
  border-color: rgba(139, 179, 255, 0.2);
  background: #0f192b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"] .modal-card:has(.auth-layout) .modal-close:hover {
  color: #ffffff;
  border-color: rgba(139, 179, 255, 0.42);
  background: linear-gradient(135deg, #2f7df4, #1d4ed8);
}

body[data-theme="dark"] .auth-layout {
  background: #121d30;
}

body[data-theme="dark"] .auth-layout .form-panel {
  border-left-color: rgba(43, 59, 85, 0.95);
  background: #121d30;
  box-shadow: none;
}

body[data-theme="dark"] .auth-layout .form-panel input,
body[data-theme="dark"] .auth-layout .form-panel select {
  border-color: #2b3b55;
  background: #0f192b;
}

body[data-theme="dark"] .auth-layout .form-panel input:focus,
body[data-theme="dark"] .auth-layout .form-panel select:focus {
  border-color: rgba(91, 156, 255, 0.65);
  background: #111c2f;
  box-shadow: 0 0 0 4px rgba(91, 156, 255, 0.13);
}

body[data-theme="dark"] .modal-card:has(.auth-layout) .agreement-panel {
  background:
    linear-gradient(145deg, rgba(91, 156, 255, 0.16), transparent 42%),
    linear-gradient(330deg, rgba(49, 196, 141, 0.13), transparent 45%),
    #0f192b;
}

body[data-theme="dark"] .modal-card:has(.auth-layout) .agreement-html.compact-html {
  border-color: rgba(91, 156, 255, 0.16);
  background: rgba(18, 29, 48, 0.86);
}

body[data-theme="dark"] .modal-card:has(.auth-layout) .agreement-html h3 {
  color: #b8d4ff;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  border-color: rgba(31, 111, 235, 0.18);
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 10px 24px rgba(31, 111, 235, 0.2);
}

.modal-close:hover {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(31, 111, 235, 0.28);
}

body[data-theme="dark"] .modal-close {
  color: #08111f;
  background: linear-gradient(135deg, #8ab8ff, #31c48d);
}

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

#regPasswordHint,
#profilePasswordHint {
  margin: -4px 0 0;
  color: var(--amber);
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(16, 33, 63, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.captcha-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.5);
}

.captcha-card {
  width: min(430px, 100%);
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.captcha-card .section-head {
  margin-bottom: 8px;
}

.captcha-image {
  position: relative;
  width: min(var(--captcha-width, 360px), 100%);
  height: var(--captcha-height, 106px);
  margin: 12px auto;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef5ff url("assets/captcha-logo.png") center / 100% 100% no-repeat;
}

.captcha-gap,
.captcha-piece {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 8px;
}

.captcha-gap {
  background: rgba(255, 255, 255, 0.82);
  border: 2px dashed rgba(20, 32, 51, 0.45);
  box-shadow: inset 0 0 18px rgba(20, 32, 51, 0.2);
}

.captcha-piece {
  left: 0;
  z-index: 2;
  border: 2px solid #ffffff;
  background: #eef5ff url("assets/captcha-logo.png") 0 0 / var(--captcha-width, 360px) var(--captcha-height, 106px) no-repeat;
  box-shadow: 0 8px 18px rgba(20, 32, 51, 0.28);
}

.captcha-track {
  position: relative;
  height: 44px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f4f7fb;
}

.captcha-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(31, 111, 235, 0.16);
}

.captcha-handle {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 46px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(31, 111, 235, 0.22);
  cursor: grab;
  transition: background 0.16s ease;
}

.captcha-handle:active {
  cursor: grabbing;
}

.captcha-tip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.captcha-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

body[data-theme="dark"] .captcha-message {
  color: #ffb3bf;
}

.captcha-passed .captcha-track {
  border-color: rgba(31, 157, 116, 0.5);
}

.captcha-passed .captcha-handle,
.captcha-passed .captcha-progress {
  background: var(--green);
}

.captcha-failed .captcha-track {
  border-color: rgba(223, 59, 79, 0.55);
  animation: captchaShake 0.26s ease;
}

.captcha-locked .captcha-track {
  opacity: 0.7;
  border-color: rgba(223, 59, 79, 0.55);
}

.captcha-locked .captcha-handle {
  background: var(--red);
  cursor: not-allowed;
}

@keyframes captchaShake {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-6px);
  }
  70% {
    transform: translateX(6px);
  }
}

@keyframes glassSheen {
  0%,
  42% {
    transform: translateX(-80%);
    opacity: 0;
  }
  52% {
    opacity: 1;
  }
  70%,
  100% {
    transform: translateX(80%);
    opacity: 0;
  }
}

@keyframes heroLightFlow {
  0%,
  100% {
    background-position: 0% 50%;
    opacity: 0.65;
  }
  50% {
    background-position: 100% 50%;
    opacity: 1;
  }
}

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

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

  .topbar {
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .brand {
    min-width: 0;
    flex: 1;
  }

  .brand img {
    width: 82px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .top-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .search-box {
    order: 3;
    flex-basis: 100%;
  }

  .sidebar {
    position: fixed;
    inset: 72px auto 0 0;
    z-index: 30;
    width: 260px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }

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

  .content {
    padding: 16px;
  }

  .hero-panel {
    display: grid;
    grid-template-columns: 1fr;
    padding: 22px;
    background: linear-gradient(115deg, rgba(14, 38, 84, 0.94), rgba(22, 75, 178, 0.78));
  }

  .hero-stats {
    justify-items: stretch;
  }

  .hero-stats img {
    justify-self: center;
    width: min(280px, 100%);
  }

  .hero-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .security-row {
    align-items: stretch;
    flex-direction: column;
  }

  .security-row .ghost-button {
    width: 100%;
  }

  .admin-search-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-search-count {
    width: fit-content;
  }

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

  .real-auth-modal-grid {
    grid-template-columns: 1fr;
    width: min(100%, calc(100vw - 44px));
  }

}

@media (max-width: 700px) {
  .auth-layout {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 36px);
  }

  .modal-card:has(.auth-layout) .agreement-panel {
    min-height: auto;
    border-radius: 14px 14px 0 0;
    padding: 22px 20px 18px;
  }

  .auth-layout .form-panel {
    max-height: none;
    border-left: 0;
    border-top: 1px solid rgba(219, 227, 239, 0.9);
    border-radius: 0 0 14px 14px;
    padding: 22px 20px;
  }

  body[data-theme="dark"] .auth-layout .form-panel {
    border-top-color: rgba(43, 59, 85, 0.95);
  }
}

@media (max-width: 560px) {
  .brand span {
    display: none;
  }

  .hero-panel h1 {
    font-size: 28px;
  }

  .hero-stats img {
    width: 100%;
    max-width: 260px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .row-actions button,
  .sorts button {
    flex: 1;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }
}
