:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #34d399;
  --accent: #06b6d4;
  --amber: #d97706;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: rgba(148, 163, 184, .18);
  --border-strong: rgba(148, 163, 184, .32);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .04);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, .03), 0 12px 32px rgba(15, 23, 42, .07);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Manrope", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(ellipse 70% 45% at 10% 0%, rgba(5, 150, 105, .06), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 4%, rgba(6, 182, 212, .05), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[v-cloak] { display: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; }
button { cursor: pointer; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(244, 247, 251, .88);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-divider { width: 1px; height: 26px; background: var(--border); }
.page-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { font-size: 10px; color: var(--faint); margin-top: 2px; letter-spacing: .12em; }
.topbar-spacer { flex: 1; }
.topbar-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px;
  color: var(--muted); font-size: 12.5px; font-weight: 700; transition: .16s ease; white-space: nowrap;
}
.topbar-link .mdi { font-size: 16px; }
.topbar-link:hover { color: var(--primary-dark); background: #fff; box-shadow: var(--shadow-sm); }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 9px 5px 5px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .72); cursor: pointer;
  position: relative; transition: .18s ease;
}
.user-chip:hover { background: #fff; box-shadow: var(--shadow-sm); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 13px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 12px rgba(5, 150, 105, .2);
}
.user-name { font-size: 13px; font-weight: 700; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: var(--faint); font-size: 15px; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 190px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 6px; overflow: hidden; z-index: 40;
}
.menu-item { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.menu-item:hover { background: #f8fafc; color: var(--text); }
.menu-item .mdi { font-size: 17px; }
.menu-item.danger { color: #dc2626; }
.menu-divider { height: 1px; background: var(--border); margin: 4px 6px; }

.content { max-width: 1320px; margin: 0 auto; padding: 22px 24px 64px; }

/* ── Stats ── */
.stats-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 13px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-size: 12.5px; color: var(--muted); font-weight: 600;
}
.stat-pill b { font-size: 16px; color: var(--text); font-weight: 800; letter-spacing: -.02em; }
.stat-pill .mdi { font-size: 18px; color: var(--primary); }
.stat-pill.blue .mdi { color: #2563eb; }
.stat-pill.cyan .mdi { color: #0891b2; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 15px; border-radius: 11px; border: 1px solid transparent;
  font-size: 13px; font-weight: 700; transition: .18s ease; white-space: nowrap;
}
.btn .mdi { font-size: 17px; }
.btn-primary { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; box-shadow: 0 6px 16px rgba(5, 150, 105, .2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(5, 150, 105, .26); }
.btn-ghost { background: #fff; border-color: var(--border-strong); color: var(--text-2); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.btn-ghost:hover { border-color: rgba(5, 150, 105, .45); color: var(--primary-dark); background: #f8fdfb; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(5, 150, 105, .14); }
.btn-ghost:active { transform: translateY(0); }
.btn-sm { min-height: 33px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn:focus-visible, .icon-btn:focus-visible, .segment-btn:focus-visible, .switch:focus-visible { outline: 2px solid rgba(5, 150, 105, .5); outline-offset: 2px; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); display: inline-grid; place-items: center; font-size: 15px; transition: .15s ease; }
.icon-btn.danger:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card + .card { margin-top: 18px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-title { font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.section-title .mdi { color: var(--primary); font-size: 20px; }
.section-desc { font-size: 12px; color: var(--faint); margin-top: 5px; line-height: 1.7; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field { margin-bottom: 16px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field-label { display: block; font-size: 12px; font-weight: 800; color: var(--text-2); margin-bottom: 7px; }
.field-hint { font-size: 11px; color: var(--faint); margin-top: 5px; line-height: 1.65; }
.input, .textarea {
  width: 100%; border: 1.5px solid rgba(148, 163, 184, .2); background: #fff; color: var(--text);
  border-radius: 11px; font-size: 13px; outline: none; transition: .18s ease;
}
.input { height: 40px; padding: 0 13px; }
.textarea { padding: 11px 13px; resize: vertical; line-height: 1.7; min-height: 90px; }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(5, 150, 105, .09); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:disabled, .textarea:disabled { background: #f8fafc; color: var(--muted); }
.secret-wrap { position: relative; }
.secret-wrap .input { padding-right: 44px; }
.secret-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: var(--faint); border-radius: 8px; display: grid; place-items: center; font-size: 17px; }
.secret-eye:hover { color: var(--primary-dark); background: #f1f5f9; }
.secret-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -4px; }

/* ── Badge / alert ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.badge-green { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-amber { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-rose { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.alert { display: flex; align-items: flex-start; gap: 8px; padding: 11px 13px; border-radius: 11px; font-size: 12.5px; line-height: 1.7; }
.alert .mdi { font-size: 17px; flex: 0 0 auto; margin-top: 1px; }
.alert.warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Banners ── */
.empty-banner { padding: 34px 16px; text-align: center; color: var(--faint); font-size: 12.5px; border: 1.5px dashed rgba(148, 163, 184, .3); border-radius: 13px; }
.empty-banner .mdi { display: block; font-size: 34px; color: #cbd5e1; margin-bottom: 8px; }
.banner-list { display: flex; flex-direction: column; gap: 12px; }
.banner-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fcfdff; }
.banner-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.banner-index { font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.banner-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; padding: 16px; }
.banner-preview {
  border-radius: 12px; min-height: 118px; display: flex; flex-direction: column; justify-content: center;
  padding: 16px; color: #fff; overflow: hidden; position: relative; background: #059669;
}
.banner-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview-title { font-size: 15px; font-weight: 800; line-height: 1.4; }
.preview-sub { font-size: 11.5px; opacity: .85; margin-top: 4px; line-height: 1.5; }
.banner-fields { min-width: 0; }
.banner-fields .field:last-child { margin-bottom: 0; }
.upload-row { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-btn { cursor: pointer; }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-dot { width: 24px; height: 24px; border-radius: 8px; border: 1px solid rgba(15, 23, 42, .1); flex: 0 0 auto; }
.color-row .input { flex: 1; min-width: 0; }
.color-presets { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.color-preset { width: 20px; height: 20px; border-radius: 7px; border: 1px solid rgba(15, 23, 42, .1); padding: 0; transition: .15s ease; }
.color-preset:hover { transform: translateY(-1px) scale(1.05); box-shadow: 0 4px 10px rgba(15, 23, 42, .12); }
.color-preset:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Segmented / switch ── */
.segment { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: #eef2f7; border: 1px solid rgba(148, 163, 184, .12); flex-wrap: wrap; }
.segment-btn {
  flex: 1 1 auto; min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 700; transition: .15s ease; white-space: nowrap;
}
.segment-btn:hover { color: var(--text-2); background: rgba(255, 255, 255, .6); }
.segment-btn.active { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.segment-btn:disabled { opacity: .55; cursor: not-allowed; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(226, 232, 240, .7); margin-bottom: 16px; }
.switch-row.inline { border-bottom: 0; padding: 0; margin: 0; gap: 12px; }
.switch-title { font-size: 13px; font-weight: 800; color: var(--text); }
.switch {
  width: 44px; height: 25px; border-radius: 999px; border: 0; background: #cbd5e1; position: relative;
  transition: background .16s ease; flex: 0 0 auto;
}
.switch.on { background: var(--primary); }
.switch:disabled { opacity: .55; cursor: not-allowed; }
.switch-knob { position: absolute; top: 3.5px; left: 3.5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .16s ease; box-shadow: 0 1px 3px rgba(15, 23, 42, .2); }
.switch.on .switch-knob { left: 22.5px; }

/* ── Save bar ── */
.save-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--border);
}
.save-hint { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.save-hint .mdi { font-size: 15px; }

/* ── Gate / toast / loading ── */
.gate-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse 70% 50% at 15% 0%, rgba(5, 150, 105, .08), transparent 55%), var(--bg); }
.gate-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--border); border-radius: 24px; padding: 38px 32px; text-align: center; box-shadow: var(--shadow-md); }
.gate-card img { height: 52px; width: auto; margin: 0 auto 18px; display: block; }
.gate-card .gate-icon { font-size: 48px; color: var(--primary); margin-bottom: 8px; }
.gate-title { font-size: 21px; font-weight: 800; }
.gate-sub { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 10px 0 22px; }
.gate-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #d1fae5; border-top-color: var(--primary); animation: spin .7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 11px; font-size: 13px; z-index: 200; box-shadow: var(--shadow-md); max-width: calc(100vw - 32px); text-align: center; }
.toast.error { background: #991b1b; }
.fade-enter-active, .fade-leave-active { transition: opacity .18s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .banner-body { grid-template-columns: 1fr; gap: 14px; }
  .banner-preview { min-height: 96px; }
}
@media (max-width: 760px) {
  .topbar-inner { padding: 10px 14px; gap: 10px; }
  .brand-logo { height: 30px; }
  .brand-divider, .page-sub, .topbar-link { display: none; }
  .content { padding: 16px 14px 56px; }
  .card-pad { padding: 17px; }
  .stats-row { gap: 8px; }
  .stat-pill { padding: 8px 12px; font-size: 11.5px; flex: 1 1 auto; justify-content: center; }
  .stat-pill b { font-size: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .section-head > .badge { align-self: flex-start; }
  .section-head > .btn { width: 100%; }
  .save-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .save-bar .btn { width: 100%; }
  .save-hint { justify-content: center; }
  .banner-body { padding: 13px; }
  .switch-row { align-items: flex-start; }
}
@media (max-width: 420px) {
  .user-name { display: none; }
  .stat-pill .mdi { display: none; }
  .segment-btn { flex: 1 1 calc(50% - 3px); }
}
