/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:      #0b0b0f;
  --surface: #13131a;
  --card:    #1b1b24;
  --hover:   #21212e;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --gold:    #e8a000;
  --gold2:   #f5c842;
  --text:    #ede9e3;
  --muted:   #7c7a75;
  --dim:     #3a3a44;
  --green:   #34c78a;
  --red:     #e85454;
  --yellow:  #f0b429;
  --blue:    #4fa3e0;
  --r-sm:    8px;
  --r-md:    12px;
  --r-lg:    18px;
  --sidebar: 240px;
  font-size: 15px;
}
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; overflow: hidden; }
button, input, textarea, select { font-family: inherit; }
a { color: var(--gold); text-decoration: none; }

/* ─── SCREENS ──────────────────────────────────────────────── */
.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; }

/* ─── LOGIN ────────────────────────────────────────────────── */
#login { align-items: center; justify-content: center; background: var(--bg); position: relative; overflow: hidden; flex-direction: column; }
.login-grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 60px 60px; mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 100%); }
.login-glow { position: absolute; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(circle, rgba(232,160,0,0.1) 0%, transparent 65%); top: 50%; left: 50%; transform: translate(-50%, -55%); pointer-events: none; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 400px; margin: 1rem; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--r-lg); padding: 2.5rem 2.5rem 2rem; box-shadow: 0 40px 80px rgba(0,0,0,0.5); animation: fadeUp 0.4s ease; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 2rem; }
.login-logo-mark { width: 40px; height: 40px; background: var(--gold); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.login-logo-mark svg { width: 22px; height: 22px; fill: #0b0b0f; }
.logo-name { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; }
.logo-sub { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.login-title { font-family: 'Playfair Display', serif; font-size: 1.65rem; font-weight: 700; margin-bottom: 0.3rem; }
.login-sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 1.75rem; }
.tabs { display: flex; gap: 4px; background: var(--card); border-radius: var(--r-sm); padding: 4px; margin-bottom: 1.5rem; }
.tab-btn { flex: 1; padding: 0.45rem; border: none; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s; }
.tab-btn.active { background: var(--surface); color: var(--text); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 6px; }
.field-wrap { position: relative; }
.field input { width: 100%; background: var(--card); border: 1px solid var(--border2); border-radius: var(--r-sm); color: var(--text); font-size: 0.95rem; padding: 0.72rem 1rem; outline: none; transition: border-color 0.2s; }
.field input:focus { border-color: var(--gold); }
.field input::placeholder { color: var(--dim); }
.field input.has-eye { padding-right: 2.8rem; }
.eye-btn { position: absolute; right: 0; top: 0; height: 100%; padding: 0 0.85rem; background: none; border: none; cursor: pointer; color: var(--muted); display: flex; align-items: center; transition: color 0.15s; }
.eye-btn:hover { color: var(--text); }
.eye-btn svg { width: 18px; height: 18px; }
.form-error { font-size: 0.82rem; color: var(--red); min-height: 1.2em; margin-bottom: 0.5rem; }
.btn-primary { width: 100%; background: var(--gold); color: #0b0b0f; border: none; border-radius: var(--r-sm); font-size: 0.95rem; font-weight: 500; padding: 0.8rem; cursor: pointer; transition: background 0.2s, transform 0.1s; }
.btn-primary:hover { background: var(--gold2); }
.btn-primary:active { transform: scale(0.98); }
.login-footer { margin-top: 1.25rem; font-size: 0.75rem; color: var(--muted); text-align: center; }
.login-footer span { color: var(--gold); }

/* ─── APP SHELL ────────────────────────────────────────────── */
#app { flex-direction: row; overflow: hidden; }
.sidebar { width: var(--sidebar); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 1.3rem 1.2rem 1rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.s-logo-mark { width: 30px; height: 30px; background: var(--gold); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.s-logo-mark svg { width: 16px; height: 16px; fill: #0b0b0f; }
.s-logo-mark span { font-family: 'Playfair Display', serif; font-size: 1rem; white-space: nowrap; }
.nav { flex: 1; padding: 0.75rem; overflow-y: auto; }
.nav-section-label { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; padding: 0.5rem 0.65rem 0.3rem; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 0.58rem 0.75rem; border-radius: var(--r-sm); cursor: pointer; color: var(--muted); font-size: 0.88rem; transition: background 0.15s, color 0.15s; white-space: nowrap; user-select: none; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: rgba(232,160,0,0.12); color: var(--gold); }
.nav-sep { height: 1px; background: var(--border); margin: 0.5rem 0; }
.sidebar-user { padding: 0.9rem 1rem; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: #0b0b0f; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 500; flex-shrink: 0; text-transform: uppercase; }
.avatar.lg { width: 44px; height: 44px; font-size: 1rem; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.72rem; color: var(--muted); }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 5px; border-radius: 5px; transition: color 0.15s, background 0.15s; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--red); background: rgba(232,84,84,0.1); }
.icon-btn svg { width: 15px; height: 15px; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 0 1.25rem; height: 54px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
.menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: var(--r-sm); transition: color 0.15s, background 0.15s; }
.menu-btn:hover { color: var(--text); background: var(--hover); }
.menu-btn svg { width: 20px; height: 20px; display: block; }
.topbar-title { font-weight: 500; font-size: 0.95rem; flex: 1; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border2); border-radius: var(--r-sm); padding: 0.42rem 0.85rem; width: 200px; transition: border-color 0.2s; }
.search-box:focus-within { border-color: var(--gold); }
.search-box svg { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 0.83rem; width: 100%; }
.search-box input::placeholder { color: var(--dim); }
.tag-strip { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding: 0.65rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); scrollbar-width: none; flex-shrink: 0; }
.tag-strip::-webkit-scrollbar { display: none; }
.tag { flex-shrink: 0; padding: 0.3rem 0.85rem; border: 1px solid var(--border2); border-radius: 999px; font-size: 0.78rem; cursor: pointer; color: var(--muted); transition: all 0.15s; user-select: none; }
.tag:hover { border-color: var(--gold); color: var(--gold); }
.tag.on { background: rgba(232,160,0,0.15); border-color: var(--gold); color: var(--gold); }
.content { flex: 1; overflow-y: auto; padding: 1.25rem; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 3px; }

/* announcement banner */
.ann-banner { background: rgba(232,160,0,0.1); border: 1px solid rgba(232,160,0,0.25); border-radius: var(--r-sm); padding: 0.65rem 1rem; margin-bottom: 1rem; display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; }
.ann-banner-icon { color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.ann-banner-title { font-weight: 500; color: var(--gold); margin-bottom: 2px; }
.ann-banner-body { color: var(--muted); line-height: 1.5; }
.ann-banner-close { margin-left: auto; flex-shrink: 0; cursor: pointer; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.ann-banner-close:hover { color: var(--text); }

/* membership expired */
.expired-banner { background: rgba(232,84,84,0.1); border: 1px solid rgba(232,84,84,0.25); border-radius: var(--r-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 12px; font-size: 0.85rem; }
.expired-banner .eb-text { flex: 1; }
.expired-banner .eb-title { font-weight: 500; color: var(--red); margin-bottom: 2px; }
.expired-banner .eb-sub { color: var(--muted); }
.btn-renew { background: var(--gold); color: #0b0b0f; border: none; border-radius: var(--r-sm); padding: 0.5rem 1.2rem; font-size: 0.85rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background 0.15s; }
.btn-renew:hover { background: var(--gold2); }

/* stats row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.25rem; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1rem 1.1rem; }
.stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-num { font-size: 1.5rem; font-weight: 500; }
.stat-num.gold { color: var(--gold); }
.stat-num.green { color: var(--green); }
.stat-num.red { color: var(--red); }
.stat-num.blue { color: var(--blue); }

/* anchor / recording list */
.anchor-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 10px; transition: border-color 0.15s; }
.anchor-card:hover { border-color: var(--border2); }
.anchor-head { display: flex; align-items: center; gap: 12px; padding: 0.9rem 1.1rem; cursor: pointer; user-select: none; }
.anc-av { width: 38px; height: 38px; border-radius: 50%; background: var(--dim); color: var(--text); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.anc-meta { flex: 1; min-width: 0; }
.anc-name { font-weight: 500; font-size: 0.92rem; }
.anc-sub { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }
.anc-sub .done { color: var(--green); }
.anc-chevron { width: 20px; height: 20px; color: var(--muted); transition: transform 0.25s; flex-shrink: 0; }
.anc-chevron.open { transform: rotate(180deg); }
.sessions { border-top: 1px solid var(--border); }
.session-item { display: flex; align-items: center; gap: 12px; padding: 0.75rem 1.1rem; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.12s; }
.session-item:last-child { border-bottom: none; }
.session-item:hover { background: rgba(255,255,255,0.03); }
.s-bar { width: 3px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.s-bar.done { background: var(--green); }
.s-bar.pend { background: var(--dim); }
.s-bar.trans { background: var(--yellow); }
.s-info { flex: 1; min-width: 0; }
.s-date { font-size: 0.83rem; font-weight: 500; }
.s-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { font-size: 0.68rem; padding: 2px 7px; border-radius: 4px; font-weight: 500; }
.chip-done { background: rgba(52,199,138,0.15); color: var(--green); }
.chip-pend { background: rgba(58,58,68,0.8); color: var(--muted); }
.chip-trans { background: rgba(240,180,41,0.15); color: var(--yellow); }
.chip-media { background: rgba(232,160,0,0.12); color: var(--gold); }
.s-words { font-size: 0.76rem; color: var(--muted); flex-shrink: 0; }
.s-arrow { color: var(--dim); font-size: 1.1rem; flex-shrink: 0; }

/* ─── STATE BOXES ──────────────────────────────────────────── */
.state-box { padding: 3.5rem 1rem; text-align: center; color: var(--muted); }
.state-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.state-msg { font-size: 0.9rem; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:0.4} }
.dot { display: inline-block; animation: pulse 1.2s infinite; }
.dot:nth-child(2) { animation-delay:.2s }
.dot:nth-child(3) { animation-delay:.4s }

/* ─── ADMIN PANEL ──────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 10px; }
.page-header h2 { font-size: 1.1rem; font-weight: 500; }

/* table */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th { text-align: left; padding: 0.75rem 1rem; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); background: var(--surface); font-weight: 500; }
.data-table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; cursor: default; }
.data-table tbody tr:hover { background: var(--hover); }
.data-table .empty-row td { text-align: center; color: var(--muted); padding: 2.5rem; }

/* badges */
.badge { display: inline-flex; align-items: center; font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; font-weight: 500; white-space: nowrap; }
.badge-green { background: rgba(52,199,138,0.15); color: var(--green); }
.badge-yellow { background: rgba(240,180,41,0.15); color: var(--yellow); }
.badge-gray { background: rgba(58,58,68,0.8); color: var(--muted); }
.badge-red { background: rgba(232,84,84,0.15); color: var(--red); }
.badge-gold { background: rgba(232,160,0,0.15); color: var(--gold); }
.badge-blue { background: rgba(79,163,224,0.15); color: var(--blue); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 0.45rem 0.9rem; border-radius: var(--r-sm); font-size: 0.83rem; font-weight: 500; cursor: pointer; border: 1px solid; transition: all 0.15s; }
.btn-ghost { background: none; border-color: var(--border2); color: var(--muted); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: rgba(232,84,84,0.1); border-color: rgba(232,84,84,0.3); color: var(--red); }
.btn-danger:hover { background: rgba(232,84,84,0.2); }
.btn-success { background: rgba(52,199,138,0.1); border-color: rgba(52,199,138,0.3); color: var(--green); }
.btn-success:hover { background: rgba(52,199,138,0.2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #0b0b0f; }
.btn-gold:hover { background: var(--gold2); border-color: var(--gold2); }
.btn svg { width: 14px; height: 14px; }

/* pagination */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 1rem; font-size: 0.83rem; color: var(--muted); }
.page-btn { background: var(--card); border: 1px solid var(--border2); color: var(--muted); padding: 0.35rem 0.7rem; border-radius: 6px; cursor: pointer; transition: all 0.15s; }
.page-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn.current { background: rgba(232,160,0,0.15); border-color: var(--gold); color: var(--gold); }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 2rem 0; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--r-lg); padding: 1.75rem; width: 100%; max-width: 420px; margin: 1rem; animation: fadeUp 0.25s ease; flex-shrink: 0; }
.modal-title { font-size: 1rem; font-weight: 500; margin-bottom: 1.25rem; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.5rem; }
.modal-body { display: flex; flex-direction: column; gap: 0.9rem; }
.modal-body textarea { width: 100%; background: var(--card); border: 1px solid var(--border2); border-radius: var(--r-sm); color: var(--text); font-size: 0.9rem; padding: 0.65rem 0.9rem; outline: none; resize: vertical; min-height: 80px; transition: border-color 0.2s; }
.modal-body textarea:focus { border-color: var(--gold); }
.modal-body label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 5px; }
.modal-body input { width: 100%; background: var(--card); border: 1px solid var(--border2); border-radius: var(--r-sm); color: var(--text); font-size: 0.9rem; padding: 0.65rem 0.9rem; outline: none; transition: border-color 0.2s; }
.modal-body input:focus { border-color: var(--gold); }
.modal-body .hint { font-size: 0.78rem; color: var(--muted); }
.modal-error { font-size: 0.82rem; color: var(--red); min-height: 1em; }

/* login rank */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.rank-item:last-child { border-bottom: none; }
.rank-num { width: 24px; font-size: 0.85rem; color: var(--muted); text-align: right; flex-shrink: 0; }
.rank-num.top { color: var(--gold); font-weight: 500; }
.rank-bar-wrap { flex: 1; height: 6px; background: var(--dim); border-radius: 3px; overflow: hidden; }
.rank-bar { height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.5s ease; }
.rank-count { font-size: 0.83rem; font-weight: 500; min-width: 32px; text-align: right; flex-shrink: 0; }

/* announcement editor */
.ann-list { display: flex; flex-direction: column; gap: 8px; }
.ann-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1rem 1.1rem; display: flex; align-items: flex-start; gap: 12px; }
.ann-item-body { flex: 1; min-width: 0; }
.ann-item-title { font-weight: 500; font-size: 0.92rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.ann-item-content { font-size: 0.83rem; color: var(--muted); line-height: 1.55; white-space: pre-wrap; }
.ann-item-meta { font-size: 0.72rem; color: var(--dim); margin-top: 6px; }
.ann-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* toggle switch */
.toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }

/* session detail */
.detail-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0.9rem; }

/* session admin */
.session-hidden { opacity: 0.5; }
.s-admin-btns { display: flex; gap: 4px; flex-shrink: 0; }

/* log box */
.log-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.75rem; font-family: monospace; font-size: 0.75rem; color: var(--muted); line-height: 1.6; max-height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }
.detail-label { font-size: 0.82rem; font-weight: 500; margin-bottom: 0.6rem; }
.detail-text-preview { font-size: 0.83rem; color: var(--muted); line-height: 1.7; max-height: 4.5em; overflow: hidden; white-space: pre-wrap; word-break: break-all; position: relative; }
.detail-text-preview::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2em; background: linear-gradient(transparent, var(--card)); pointer-events: none; }
.detail-text-full { font-size: 0.83rem; color: var(--muted); line-height: 1.7; max-height: 400px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
.detail-text-full::-webkit-scrollbar { width: 4px; }
.detail-text-full::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 2px; }
.detail-text-full strong { color: var(--text); font-weight: 600; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--dim); border-radius: 10px; cursor: pointer; transition: background 0.2s; }
.toggle input:checked + .toggle-track { background: var(--green); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: white; border-radius: 50%; transition: transform 0.2s; pointer-events: none; }
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); }

/* orders */
.order-amount { font-weight: 500; color: var(--green); }

/* mobile overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 99; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

/* membership modal */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan-card { background: var(--card); border: 1px solid var(--border2); border-radius: var(--r-md); padding: 1rem; text-align: center; cursor: pointer; transition: all 0.15s; }
.plan-card:hover, .plan-card.selected { border-color: var(--gold); background: rgba(232,160,0,0.08); }
.plan-name { font-size: 0.85rem; font-weight: 500; margin-bottom: 4px; }
.plan-price { font-size: 1.3rem; font-weight: 500; color: var(--gold); }
.plan-price span { font-size: 0.75rem; color: var(--muted); }
.plan-days { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ─── FONT SIZE TOGGLE ─────────────────────────────────────── */
.font-size-btn { background: var(--card); border: 1px solid var(--border2); color: var(--muted); cursor: pointer; padding: 0.3rem 0.55rem; border-radius: var(--r-sm); font-size: 0.78rem; font-weight: 500; transition: all 0.15s; flex-shrink: 0; }
.font-size-btn:hover { border-color: var(--gold); color: var(--gold); }
.font-size-btn span { pointer-events: none; }

/* 三档字体 */
html.font-sm { font-size: 16px; }
html.font-md { font-size: 18px; }
html.font-lg { font-size: 20px; }

/* ─── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeUp { from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)} }
@keyframes shake { 0%,100%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-5px)}80%{transform:translateX(5px)} }

/* ─── ROLE VISUAL ──────────────────────────────────────────── */
/* 管理员：红色头像 */
.av-admin { background: var(--red) !important; }
.name-admin { color: var(--red); }

/* 永久会员 / VIP：金色头像+金色边框 */
.av-vip { background: var(--gold) !important; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }
.name-vip { color: var(--gold); }

/* 付费会员：金色头像 */
.av-member { background: var(--gold) !important; }
.name-member { color: var(--gold); }

/* ─── RESPONSIVE ───────────────────────────────────────────── */

/* 大屏 */
@media (min-width: 1280px) {
  :root { --sidebar: 260px; }
}

/* 平板竖屏 / 小屏笔记本 */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar: 200px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .search-box { width: 150px; }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 手机 */
@media (max-width: 640px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; width: 260px !important; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .menu-btn { display: flex; }

  /* 搜索框：默认隐藏，点击展开为topbar内嵌 */
  .search-box { display: none; }
  .search-box.mobile-open {
    display: flex;
    flex: 1;
    width: auto;
    border: none;
    background: transparent;
    padding: 0;
  }
  .search-box.mobile-open input { font-size: 0.9rem; }
  .mobile-search-btn { display: flex !important; }
  .mobile-search-close { display: flex !important; }
  .topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-box.mobile-open ~ .topbar-title,
  .topbar-title.search-hide { display: none; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 0.9rem; }
  .tag-strip { padding: 0.6rem 0.9rem; }
  .topbar { padding: 0 1rem; }
  .login-card { padding: 2rem 1.5rem; }
  .plan-grid { grid-template-columns: 1fr; }

  /* 表格横向滚动代替隐藏列 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }

  /* 弹窗适配 */
  .modal { max-height: 90vh; overflow-y: auto; margin: 0.5rem; }

  /* 分页紧凑 */
  .pagination { flex-wrap: wrap; font-size: 0.78rem; }

  /* 管理后台操作按钮紧凑 */
  .ann-actions { flex-direction: column; }
}

/* 移动端搜索按钮/关闭默认隐藏 */
.mobile-search-btn { display: none; background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: var(--r-sm); transition: color 0.15s; }
.mobile-search-btn:hover { color: var(--text); }
.mobile-search-btn svg { width: 18px; height: 18px; display: block; }
.mobile-search-close { display: none; background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; font-size: 1.2rem; flex-shrink: 0; }
.mobile-search-close:hover { color: var(--text); }
