/* ===== 列车皮肤工坊 样式（Notion 风格） ===== */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --hover: #efedea;
  --active: #e3e1db;
  --input: #ffffff;
  --text: #37352f;
  --text-2: #73716c;
  --text-3: #9f9e99;
  --border: #e9e8e5;
  --border-strong: #d9d7d2;
  --ink: #37352f;
  --ink-hover: #23221e;
  --ink-text: #ffffff;
  --blue: #337ea9;
  --blue-bg: #e7f3f8;
  --red: #c4554d;
  --green: #448361;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(15, 15, 15, .05);
  --shadow-md: 0 4px 12px rgba(15, 15, 15, .08);
  --focus-ring: rgba(51, 126, 169, .28);
  --track-a: #f1f1ef;
  --track-b: #fafafa;
}

[data-theme="dark"] {
  --bg: #191919;
  --surface: #252525;
  --surface-2: #202020;
  --hover: #2c2c2c;
  --active: #353535;
  --input: #202020;
  --text: #d4d4d2;
  --text-2: #9b9b98;
  --text-3: #6f6f6c;
  --border: #2f2f2f;
  --border-strong: #3d3d3d;
  --ink: #d7d7d5;
  --ink-hover: #c6c6c4;
  --ink-text: #191919;
  --blue: #529cca;
  --blue-bg: #1e3240;
  --red: #d9736a;
  --green: #4aa976;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .4);
  --focus-ring: rgba(82, 156, 202, .30);
  --track-a: #202020;
  --track-b: #252525;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 强制 hidden 属性生效：避免 .form/.auth-view 等 display:flex 覆盖隐藏 */
[hidden] { display: none !important; }

body {
  font-family: ui-sans-serif, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap { width: min(1140px, calc(100% - 32px)); margin: 0 auto; }

::selection { background: rgba(51, 126, 169, .24); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* ===== 顶栏 ===== */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 20px; height: 20px; flex-shrink: 0;
  display: inline-block;
  background: var(--text);
  clip-path: polygon(0 0, 62% 0, 62% 62%, 100% 62%, 100% 100%, 38% 100%, 38% 38%, 0 38%);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.brand-text span { font-size: 10.5px; color: var(--text-3); letter-spacing: 1px; margin-top: 1px; }

.topbar-auth { display: flex; align-items: center; gap: 8px; }
.user-email { font-size: 13px; color: var(--text); }
.role-badge {
  font-size: 11px; padding: 1px 8px; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-2);
}
.role-badge.admin { background: var(--blue-bg); color: var(--blue); }
.role-badge.manager { background: #edf3ec; color: var(--green); }
[data-theme="dark"] .role-badge.manager { background: #1f3d33; color: var(--green); }

/* 右上角个人信息入口 */
.profile-menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text); padding: 4px 10px; border-radius: var(--radius);
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: background-color .15s;
}
.profile-menu-btn:hover { background: var(--hover); }
.profile-caret { font-size: 10px; color: var(--text-3); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 6px 14px; font-size: 14px; font-family: inherit;
  border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
  text-decoration: none; font-weight: 500;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 2px 9px; font-size: 12px; font-weight: 500; }
.btn.block { width: 100%; }
.btn.primary { background: var(--ink); color: var(--ink-text); }
.btn.primary:hover { background: var(--ink-hover); }
.btn.primary.block { padding: 8px 14px; letter-spacing: 2px; }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.ghost:active { background: var(--active); }
.btn.equip { background: var(--ink); color: var(--ink-text); }
.btn.equip:hover { background: var(--ink-hover); }
.btn.equipped-btn { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn.equipped-btn:hover { background: var(--hover); color: var(--text); }

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-title { font-size: 16px; margin-bottom: 12px; font-weight: 600; }
.block-title { font-size: 13px; margin: 18px 0 8px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-2); }
.muted { color: var(--text-2); font-size: 13px; }
.profile-email { font-size: 13px; color: var(--text-2); }
.profile-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 14px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--radius-lg);
  background-color: var(--surface-2);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
}
.profile-meta { display: flex; flex-direction: column; }
.profile-title { font-size: 15px; font-weight: 600; }

/* ===== 认证区 ===== */
.auth-view {
  padding: 0;
  margin: 46px auto;
  display: flex;
  width: min(880px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.auth-side {
  width: 40%; flex-shrink: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 28px;
}
.auth-side-brand { display: flex; align-items: center; gap: 10px; }
.auth-side-body h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.auth-side-body p { font-size: 13px; color: var(--text-2); line-height: 1.7; }

.auth-card {
  flex: 1; min-width: 0;
  padding: 30px 34px;
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 16px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.auth-brand .brand-logo { width: 18px; height: 18px; }
.auth-brand-text h1 { font-size: 17px; font-weight: 600; }
.auth-brand-text p { font-size: 11px; color: var(--text-3); letter-spacing: 1px; margin-top: 1px; }

.auth-title { font-size: 17px; font-weight: 600; margin: 16px 0 4px; }
.auth-sub { font-size: 13px; color: var(--text-2); margin-bottom: 18px; }

.auth-switch {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; gap: 8px; flex-wrap: wrap;
}

/* ===== 表单 ===== */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); }
.form input, .form select {
  padding: 8px 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--input); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form input::placeholder, .form select::placeholder { color: var(--text-3); }
.form input:focus, .form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.email-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.email-row .grow { flex: 1 1 160px; min-width: 0; }
.email-row .btn { flex-shrink: 0; white-space: nowrap; }
.reg-warning { font-size: 12px; color: var(--red); line-height: 1.5; }
.inline-form {
  flex-direction: row; flex-wrap: wrap; align-items: flex-end;
  gap: 12px; margin-top: 14px;
}
.inline-form label { min-width: 180px; }
.inline-form input, .inline-form select { min-width: 140px; }

/* ===== UUID 列表 ===== */
.uuid-list { margin: 6px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.uuid-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); flex-wrap: wrap;
  transition: background-color .15s;
}
.uuid-row:hover { background: var(--hover); }
.uuid-row code {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12.5px; color: var(--text);
}
.uuid-label { font-size: 13px; color: var(--text-2); }
.uuid-row .btn { margin-left: auto; }
.type-tag {
  font-size: 11px; padding: 1px 8px; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; font-weight: 500;
}
.type-tag.online { background: #edf3ec; color: var(--green); }
.type-tag.offline { background: #f1f1ef; color: #787774; }
.type-tag.littleskin { background: var(--blue-bg); color: var(--blue); }

/* ===== 管理员表格 ===== */
.table-wrap { overflow-x: auto; }
.user-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
.user-table th, .user-table td {
  text-align: left; padding: 8px 11px;
  border-bottom: 1px solid var(--border);
}
.user-table thead th { background: var(--surface-2); color: var(--text-2); font-weight: 500; font-size: 12.5px; }
.user-table tbody tr:hover { background: var(--hover); }
.user-toolbar {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; margin-bottom: 12px;
}
.user-toolbar input,
.user-toolbar select {
  font-family: inherit; font-size: 13.5px; color: var(--text);
  padding: 7px 11px; background: var(--input);
  border: 1px solid var(--border-strong); border-radius: var(--radius); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.user-toolbar input { flex: 1; min-width: 200px; }
.user-toolbar input::placeholder { color: var(--text-3); }
.user-toolbar input:focus,
.user-toolbar select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--focus-ring); }
.edit-password { align-items: center; margin-top: 12px; }
.edit-user-note { font-size: 13px; color: var(--text-2); }
.admin-uuid-panel { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.admin-resolve { display: flex; gap: 8px; align-items: center; width: 100%; margin-top: 10px; flex-wrap: wrap; }
.admin-resolve input {
  flex: 1; min-width: 0;
  padding: 8px 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--input); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.admin-resolve input::placeholder { color: var(--text-3); }
.admin-resolve input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--focus-ring); }
.admin-resolve .btn { flex-shrink: 0; min-width: 158px; }
.manager-section { margin-top: 16px; }
.manager-codes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.manager-role-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.manager-role-row .muted { font-size: 13px; }
.manager-code-checks { margin-top: 12px; }
.manager-code-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.manager-code-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; cursor: pointer; background: var(--surface);
  transition: background-color .15s;
}
.manager-code-item:hover { background: var(--hover); }
.manager-code-item input { cursor: pointer; }
.manager-save-row { margin-top: 12px; }
.manager-edit-pwd { margin-top: 14px; }
.invite-stats { margin-bottom: 12px; font-size: 14px; }
.invite-stats strong { color: var(--blue); }
.invite-last { margin: 10px 0; font-size: 13px; color: var(--text-2); word-break: break-all; }
.invite-last:empty { display: none; }
.invite-log-panel { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.invite-log-panel .user-toolbar { margin-bottom: 10px; }
.invite-log-panel strong { font-size: 14px; }
.admin-smtp-panel { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.change-pwd { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.admin-skin-panel { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.smtp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.smtp-test {
  display: flex; gap: 8px; align-items: center;
  margin-top: 14px; flex-wrap: wrap;
}
.smtp-test input {
  flex: 1; min-width: 200px;
  padding: 8px 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--input); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.smtp-test input::placeholder { color: var(--text-3); }
.smtp-test input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--focus-ring); }
.link-btn {
  background: none; border: none; color: var(--blue);
  cursor: pointer; font-size: 13px; padding: 2px 0;
  margin-top: 4px; font-family: inherit;
  transition: color .15s;
}
.link-btn:hover { text-decoration: underline; }

/* ===== 皮肤区 ===== */
.skin-section { margin-bottom: 26px; }
.skin-tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.skin-tab {
  padding: 8px 16px; font-size: 14px; font-family: inherit; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-2); transition: color .15s, background-color .15s;
}
.skin-tab:hover { color: var(--text); background: var(--hover); }
.skin-tab.active { color: var(--text); border-bottom-color: var(--ink); font-weight: 600; }
.skin-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.skin-head .card-title { margin-bottom: 0; }
.count-badge {
  font-size: 12px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 1px 9px; border-radius: var(--radius);
}
.toolbar { margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .search-box { flex: 1; min-width: 200px; }
.toolbar-chip { flex-shrink: 0; }
.search-box {
  width: 100%; padding: 8px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--input);
  color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-box::placeholder { color: var(--text-3); }
.search-box:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--focus-ring); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 15px; }
.chip {
  padding: 3px 11px; font-size: 12.5px; font-family: inherit;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.chip:hover { background: var(--hover); color: var(--text); }
.chip.active {
  color: var(--text); font-weight: 500;
  background: var(--active);
  border-color: var(--border-strong);
}

/* ===== 皮肤网格与卡片 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}
.skin-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px; display: flex; flex-direction: column; align-items: center;
  gap: 9px; box-shadow: var(--shadow);
  transition: background-color .15s;
}
.skin-card:hover { background: var(--surface-2); }
.skin-card.equipped { border-color: var(--blue); }
.skin-preview {
  width: 100%; height: 110px; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(var(--track-a) 0% 25%, var(--track-b) 0% 50%) 0 0 / 18px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.skin-preview img {
  width: 100%; height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.skin-name { font-size: 14px; font-weight: 600; text-align: center; }
.skin-tags { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.tag {
  font-size: 11px; padding: 1px 8px; border-radius: var(--radius);
  background: #f1f1ef; color: #787774; font-weight: 500;
}
.tag.rarity-WHITE { background: #f1f1ef; color: #787774; }
.tag.rarity-GREEN { background: #edf3ec; color: var(--green); }
.tag.rarity-BLUE { background: var(--blue-bg); color: var(--blue); }
.tag.rarity-PURPLE { background: #f6f3f9; color: #9065b0; }
.tag.rarity-ORANGE { background: #fbecdd; color: #d9730d; }
.tag.target { background: #f1f1ef; color: #787774; }
.tag.series { background: #fbf3db; color: #b08800; }
.skin-card .btn { width: 100%; margin-top: auto; }
.model-wrap { width: 100%; }
.model-select {
  width: 100%; padding: 5px 8px; font-size: 12px; font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--input);
  color: var(--text); outline: none;
}
.tag-select {
  padding: 1px 5px; font-size: 11px; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text-2); outline: none;
  max-width: 100px;
}

.empty-hint {
  grid-column: 1 / -1; padding: 32px; text-align: center;
  color: var(--text-2); font-size: 14px;
}

/* ===== 分页、皮肤详情弹窗、杂项 ===== */
.pager {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; margin-top: 10px; flex-wrap: wrap;
}
.pager-info { font-size: 12px; color: var(--text-2); }
.user-table td .btn { margin: 1px 2px; }
.mini-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
.skin-card .skin-preview, .skin-card .skin-name { cursor: pointer; }

.skin-modal-panel { width: min(560px, 100%); }
.skin-modal-body { display: flex; gap: 18px; padding: 18px 20px 20px; }
.skin-modal-left { flex: 1.1; min-width: 0; }
.skin-preview.skin-modal-preview { height: auto; aspect-ratio: 1 / 1; }
.skin-modal-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.skin-modal-info .skin-tags { justify-content: flex-start; }

/* ===== 底部、Toast ===== */
.footer {
  margin-top: auto;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  color: var(--text-2);
  text-align: center;
  padding: 14px 0;
  font-size: 12px;
}
#toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--ink); color: var(--ink-text); padding: 9px 15px;
  border-radius: var(--radius); font-size: 13px; box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity .15s;
  max-width: 340px;
}
[data-theme="dark"] .toast { background: #e2e2e0; color: #191919; }
.toast.warn { background: var(--red); color: #fff; }
.toast.show { opacity: 1; }

/* ===== 黑夜模式适配（Notion Dark 标签色） ===== */
[data-theme="dark"] .type-tag.offline { background: #373737; color: #9b9b98; }
[data-theme="dark"] .type-tag.online { background: #1f3d33; color: #4aa976; }
[data-theme="dark"] .type-tag.littleskin { background: #1e3240; color: #529cca; }
[data-theme="dark"] .tag { background: #373737; color: #9b9b98; }
[data-theme="dark"] .tag.rarity-WHITE { background: #373737; color: #9b9b98; }
[data-theme="dark"] .tag.rarity-GREEN { background: #1f3d33; color: #4aa976; }
[data-theme="dark"] .tag.rarity-BLUE { background: #1e3240; color: #529cca; }
[data-theme="dark"] .tag.rarity-PURPLE { background: #352f42; color: #9a6fb7; }
[data-theme="dark"] .tag.rarity-ORANGE { background: #3d2e1e; color: #d9954f; }
[data-theme="dark"] .tag.target { background: #373737; color: #9b9b98; }
[data-theme="dark"] .tag.series { background: #38341f; color: #c9a332; }
[data-theme="dark"] .tag-select { background: #373737; color: #9b9b98; }
[data-theme="dark"] .chip.active { background: #353535; }

/* 主题切换按钮 */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-2); font-size: 14px; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.theme-toggle:hover { background: var(--hover); color: var(--text); }

/* ===== 个人信息弹窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-mask { position: absolute; inset: 0; background: rgba(15, 15, 15, .4); }
.modal-panel {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-avatar {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: var(--radius-lg);
  background-color: var(--surface-2);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
}
.modal-head-meta { flex: 1; min-width: 0; }
.modal-name { font-size: 16px; font-weight: 600; }
.modal-email { font-size: 13px; color: var(--text-2); word-break: break-all; }
.modal .role-badge { background: var(--surface-2); color: var(--text-2); }
.modal .role-badge.admin { background: var(--blue-bg); color: var(--blue); }
.modal .role-badge.manager { background: #edf3ec; color: var(--green); }
[data-theme="dark"] .modal .role-badge.manager { background: #1f3d33; color: var(--green); }
.modal-close {
  border: none; background: none; color: var(--text-3);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius);
  transition: background-color .15s, color .15s;
}
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-body { padding: 16px 18px 20px; }
.modal-subtitle { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 8px; }
.modal-subtitle:not(:first-child) { margin-top: 18px; }

/* ===== 管理员后台布局 ===== */
.admin-layout { display: flex; gap: 14px; min-height: 60vh; }
.admin-sidebar {
  width: 200px; flex-shrink: 0;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 10px 8px;
}
.admin-sidebar-title {
  padding: 6px 10px 10px;
  font-size: 12px; font-weight: 600; color: var(--text-3);
}
.admin-nav { display: flex; flex-direction: column; gap: 1px; }
.admin-nav-item {
  text-align: left; border: none; background: none;
  color: var(--text-2);
  font-family: inherit; font-size: 14px; padding: 7px 10px; cursor: pointer;
  border-radius: var(--radius);
  transition: background-color .15s, color .15s;
}
.admin-nav-item:hover { background: var(--hover); color: var(--text); }
.admin-nav-item.active { background: var(--active); color: var(--text); font-weight: 500; }
.admin-main {
  flex: 1; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 24px;
  box-shadow: var(--shadow);
}
.admin-page .card-title { margin-top: 0; }

/* ===== 手机端适配 ===== */
@media (max-width: 640px) {
  .wrap { width: calc(100% - 24px); }
  .topbar-inner { gap: 10px; padding: 9px 0; flex-wrap: wrap; }
  .brand { gap: 8px; }
  .brand-text strong { font-size: 14px; }
  .brand-text span { display: none; }
  .topbar-auth { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .theme-toggle { flex-shrink: 0; }
  .user-email { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .auth-view { margin: 24px auto; width: 100%; flex-direction: column; }
  .auth-side { display: none; }
  .auth-card { padding: 22px 20px; }

  .card { padding: 16px 14px; }
  .card-title { font-size: 15px; }
  .profile-head { gap: 12px; }
  .avatar { width: 40px; height: 40px; }

  .inline-form { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 12px; }
  .inline-form label { min-width: 0; }
  .inline-form input, .inline-form select { min-width: 0; width: 100%; }

  .smtp-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .user-toolbar { flex-direction: column; align-items: stretch; }
  .user-toolbar input { min-width: 0; width: 100%; }
  .admin-resolve { flex-direction: column; align-items: stretch; }
  .admin-resolve .btn { width: 100%; min-width: 0; }

  .admin-layout { flex-direction: column; gap: 0; }
  .admin-sidebar { width: 100%; padding: 8px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: none; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-nav-item { flex: 1; text-align: center; padding: 7px 6px; font-size: 13px; }
  .admin-main { padding: 16px 14px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

  .skin-section { margin-bottom: 22px; }
  .skin-tabs { margin-bottom: 12px; }
  .skin-tab { flex: 1; text-align: center; padding: 8px 10px; font-size: 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .skin-card { padding: 11px; gap: 8px; }
  .skin-preview { height: 88px; }
  .skin-name { font-size: 13px; }

  .uuid-row { padding: 7px 11px; }
  .uuid-row code { font-size: 12px; word-break: break-all; }

  .skin-modal-body { flex-direction: column; }
  .pager { justify-content: center; }
  .toolbar .search-box { min-width: 0; width: 100%; flex: 1 1 100%; }
}

@media (max-width: 400px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .smtp-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 20px 14px; }
  .auth-brand-text h1 { font-size: 16px; }
  .auth-title { font-size: 16px; }
}

/* ===== 其他 ===== */
html { -webkit-text-size-adjust: 100%; }

.admin-user-create { margin: 0 0 14px; }
