/* ===================================================================
   AI 工具箱 —— 桌面端样式（浅色主题）
   =================================================================== */
:root {
  --bg: #f4f5fa;
  --panel: #ffffff;
  --line: #e9eaf3;
  --line-strong: #dcdeeb;
  --text: #1b1e2b;
  --muted: #6b7183;
  --muted-2: #98a0b3;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-soft: #eef0ff;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(24, 28, 48, 0.05);
  --shadow-md: 0 8px 24px -12px rgba(24, 28, 48, 0.18);
  --shadow-lg: 0 24px 60px -24px rgba(24, 28, 48, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #d6d9e6;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #c2c6d8;
  background-clip: content-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ==================== 布局 ==================== */
.app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 18px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.7);
}

.brand-text h1 {
  font-size: 15px;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted-2);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.16s, color 0.16s;
  font-size: 13.5px;
  font-weight: 500;
  width: 100%;
}

.nav-item:hover {
  background: #f6f7fc;
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: #fbfbfe;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.16s;
}

.admin-entry:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.admin-entry.active {
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.version {
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 10px;
}

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 26px 30px 40px;
}

.view {
  display: none;
  animation: fade 0.22s ease;
}

.view.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==================== 头部 ==================== */
.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.view-head h2 {
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.view-head .sub {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

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

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 1.9;
  stroke-linecap: round;
}

.search input {
  width: 250px;
  padding: 9px 12px 9px 33px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  outline: none;
  transition: border 0.16s, box-shadow 0.16s;
  font-size: 13px;
}

.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.16s;
  white-space: nowrap;
}

.btn:hover {
  border-color: #c9cddd;
  background: #fafaff;
}

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

.btn.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -8px rgba(99, 102, 241, 0.9);
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn.ghost:hover {
  color: var(--text);
  background: #f7f8fc;
}

.btn.danger {
  color: var(--red);
  border-color: #f6d5d5;
  background: #fef6f6;
}

.btn.danger:hover {
  background: #fdeaea;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 7px;
}

/* ==================== 分类 chips ==================== */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.16s;
}

.chip:hover {
  border-color: #c9cddd;
  color: var(--text);
}

.chip.active {
  background: #1b1e2b;
  border-color: #1b1e2b;
  color: #fff;
  font-weight: 600;
}

.chip .count {
  opacity: 0.6;
  margin-left: 4px;
  font-size: 11px;
}

/* ==================== 工具卡片 ==================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: #dfe2f0;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.tool-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: color-mix(in srgb, var(--c, #6366f1) 13%, #fff);
  border: 1px solid color-mix(in srgb, var(--c, #6366f1) 22%, #fff);
}

.tool-meta {
  min-width: 0;
  flex: 1;
}

/* 图片图标（Base64 / 图片 URL） */
.icon-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 5px;
  display: block;
}

.tool-icon .icon-img {
  width: 26px;
  height: 26px;
}

.dl-icon .icon-img {
  width: 22px;
  height: 22px;
}

.mini-icon .icon-img {
  width: 20px;
  height: 20px;
}

.tool-meta h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.35;
}

.tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  letter-spacing: 0.2px;
}

.tool-cat {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted-2);
}

.tool-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

.size {
  font-size: 11.5px;
  color: var(--muted-2);
}

/* 卡片内进度 */
.card-progress {
  margin-top: 2px;
}

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

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.card-progress .meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 5px;
}

.spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== 空状态 ==================== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 34px;
  margin-bottom: 8px;
  opacity: 0.85;
}

.empty p {
  margin: 0 0 3px;
  font-weight: 600;
  color: var(--text);
}

.empty span {
  font-size: 12.5px;
  color: var(--muted-2);
}

/* ==================== 下载列表 ==================== */
.dl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dl-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.dl-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 17px;
  background: #f5f6fc;
}

.dl-main {
  min-width: 0;
}

.dl-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
}

.dl-file {
  font-size: 11.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.dl-progress {
  margin-top: 7px;
}

.dl-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 4px;
  gap: 10px;
}

.dl-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.status-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.status-pill.downloading {
  color: var(--accent);
  background: var(--accent-soft);
}
.status-pill.completed {
  color: var(--green);
  background: #ecfdf3;
}
.status-pill.paused {
  color: var(--amber);
  background: #fff8ec;
}
.status-pill.failed {
  color: var(--red);
  background: #fef2f2;
}
.status-pill.cancelled {
  color: var(--muted);
  background: #f3f4f8;
}
.status-pill.queued,
.status-pill.connecting {
  color: var(--muted);
  background: #f3f4f8;
}

.dl-item.completed .bar > i {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}
.dl-item.failed .bar > i {
  background: var(--red);
}

/* ==================== 设置面板 ==================== */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f2f8;
}

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

.row-label strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.row-label span {
  font-size: 12px;
  color: var(--muted-2);
}

.row-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.path-input {
  width: 320px;
  max-width: 42vw;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fbfbfe;
  font-size: 12.5px;
  color: var(--muted);
  outline: none;
}

.path-input:focus {
  border-color: var(--accent);
  background: #fff;
}

select {
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  outline: none;
  cursor: pointer;
}

input[type="range"] {
  width: 140px;
  accent-color: var(--accent);
}

.range-val {
  width: 20px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 23px;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #dfe2ee;
  border-radius: 999px;
  transition: 0.2s;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.switch input:checked + span::after {
  transform: translateX(17px);
}

/* ==================== 管理端表格 ==================== */
.admin-table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 11px 14px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f2f3f9;
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: #fbfbff;
}

.admin-table tr.disabled {
  opacity: 0.55;
}

.col-order {
  width: 88px;
}
.col-status {
  width: 68px;
}
.col-ops {
  width: 150px;
}

.order-btns {
  display: flex;
  gap: 4px;
}

.order-btns button {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}

.order-btns button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cell-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cell-tool .mini-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: #f5f6fc;
}

.cell-tool b {
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}

.cell-tool small {
  color: var(--muted-2);
  font-size: 11.5px;
}

.cell-url {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-family: "Cascadia Code", Consolas, monospace;
}

.cell-ops {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ==================== 弹窗 ==================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 36, 0.42);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 100;
  animation: fade 0.16s ease;
}

.modal-mask[hidden] {
  display: none;
}

.modal {
  width: 640px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--panel);
  border-radius: 16px;
  padding: 22px 24px 18px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.modal.small {
  width: 360px;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

.modal-sub {
  margin: 0 0 16px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-wrap.full {
  grid-column: 1 / -1;
}

.field-wrap > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field {
  width: 100%;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fbfbfe;
  outline: none;
  font-size: 13px;
  transition: border 0.16s, box-shadow 0.16s, background 0.16s;
}

.field:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

textarea.field {
  resize: vertical;
  min-height: 62px;
}

.field.color {
  padding: 4px;
  height: 36px;
  cursor: pointer;
}

.inline-checks {
  flex-direction: row;
  gap: 18px;
  padding-top: 2px;
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.check input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.form-error {
  margin: 10px 0 0;
  color: var(--red);
  font-size: 12.5px;
  background: #fef2f2;
  border: 1px solid #fbdcdc;
  padding: 7px 10px;
  border-radius: 8px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ==================== Toast ==================== */
.toast-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: #1b1e2b;
  color: #fff;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.22s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
}

.toast.success {
  background: #14532d;
}
.toast.error {
  background: #7f1d1d;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==================== 响应式 ==================== */
@media (max-width: 1080px) {
  .main {
    padding: 22px 20px 32px;
  }
  .path-input {
    width: 220px;
  }
  .search input {
    width: 190px;
  }
}

/* ===================================================================
   网页管理后台专属样式
   =================================================================== */
body.admin-web {
  display: block;
  height: auto;
  min-height: 100vh;
  overflow: auto;
  background: var(--bg);
}

/* ---------------- 登录 ---------------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 50% -10%, #e8e9ff 0%, rgba(244, 245, 250, 0) 70%),
    var(--bg);
}

.login-card {
  width: 372px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px 28px 24px;
  box-shadow: 0 24px 60px -28px rgba(24, 28, 48, 0.3);
  text-align: center;
}

.login-card .brand-logo {
  margin: 0 auto 14px;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 16px;
}

.login-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -0.2px;
}

.login-sub {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted-2);
}

.login-card .field {
  margin-bottom: 12px;
  text-align: center;
}

.btn.block {
  width: 100%;
  justify-content: center;
  padding: 10px;
}

.login-hint {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted-2);
}

.login-hint code {
  background: #f1f2f8;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------------- 控制台 ---------------- */
.admin-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 26px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-header .brand {
  padding: 0;
  flex: 0 0 auto;
}

.admin-header .head-actions {
  margin-left: auto;
}

.admin-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 2px 8px;
  border-radius: 999px;
}

.admin-main {
  flex: 1;
  padding: 20px 26px 40px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.admin-toolbar .stat {
  font-size: 12.5px;
  color: var(--muted-2);
}

.admin-toolbar .stat b {
  color: var(--text);
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 6px 5px 12px;
  max-width: 100%;
}

.endpoint span {
  font-size: 11.5px;
  color: var(--muted-2);
  white-space: nowrap;
}

.endpoint code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  color: var(--text);
  background: #f7f8fc;
  padding: 3px 7px;
  border-radius: 6px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.9;
}

.admin-hint code {
  background: #eef0f7;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}

.icon-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-preview {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  border: 1px dashed var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 19px;
  background: #fbfbfe;
  overflow: hidden;
}

.icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.icon-tip {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--muted-2);
  margin: -4px 0 0;
}

.upload-btn {
  position: relative;
  overflow: hidden;
}

.upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 720px) {
  .admin-header {
    padding: 12px 14px;
  }
  .admin-main {
    padding: 14px;
  }
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3),
  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) {
    display: none;
  }
  .endpoint {
    margin-left: 0;
    width: 100%;
  }
  .endpoint code {
    max-width: 100%;
  }
}

/* hidden 属性优先级兜底：防止 display:grid/block 等类覆盖 [hidden] */
[hidden] {
  display: none !important;
}

img.brand-logo {
  object-fit: cover;
  background: #0b0b1e;
}
