/* ==========================================================================
   PicBed 设计系统 · Design Tokens & Components
   现代化简洁风：克制配色 / 系统字体 / 柔和阴影 / 8px 圆角体系
   ========================================================================== */

:root {
  /* 色彩 */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-border: #c7d2fe;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --bg-soft: #f2f4f7;
  --hover: #fafbfc;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --border-hover: #b8bfcc;
  --bg-track: #eceff3;
  --grad-brand: linear-gradient(135deg, #6366f1, #4f46e5);

  --text: #1d2129;
  --text-2: #667085;
  --text-3: #98a2b3;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #d97706;
  --warning-soft: #fffbeb;

  /* 圆角与阴影 */
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .16);

  --transition: .18s ease;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { display: block; }
button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- 工具类 ---------- */
.flex { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.grow { flex: 1; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--text-2); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; line-height: 1;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); border-color: var(--border-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-danger-ghost { background: var(--surface); color: var(--danger); border-color: var(--danger-border); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-lg { height: 40px; }
.btn .spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.input, .select {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.input.has-error, .select.has-error { border-color: var(--danger); }
.field-error { display: none; margin-top: 6px; font-size: 12.5px; color: var(--danger); }
.field-error.show { display: block; }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-gray { background: var(--bg-soft); color: var(--text-2); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- 页面骨架（iframe 内页面） ---------- */
.page { padding: 20px 24px 28px; }
/* 窄容器（上传页等聚焦场景）：居中显示 */
.page-narrow { max-width: 720px; margin: 0 auto; }
/* 内容撑满：页面纵向 flex，最后一张卡片填满剩余高度（保留页边距），底部分页贴边 */
.page-fill { display: flex; flex-direction: column; min-height: 100vh; }
.page-fill > .card:last-child {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.page-fill > .card > .card-body { flex: 1 1 auto; min-height: 0; }
/* 卡片内非 card-body 的内容区（表格/空态容器）也可撑满，空态垂直居中 */
.page-fill .fill-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.page-fill .fill-body > .empty {
  flex: 1 1 auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 52px 20px;
}
/* 表格区域填满，行高不足时由行均摊剩余高度（表格视觉充满卡片） */
.page-fill .fill-body > .table-wrap {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.page-fill .fill-body > .table-wrap > .table { min-height: 100%; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .select { width: auto; min-width: 160px; height: 34px; font-size: 13px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 16px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--hover); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--hover); }
.table .cell-main { font-weight: 500; }
.table .cell-sub { margin-top: 2px; font-size: 12px; color: var(--text-3); }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); background: var(--bg-soft); cursor: zoom-in; }
.name-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.url-cell .url-text {
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--primary); cursor: pointer;
}
.url-cell .url-text:hover { text-decoration: underline; }

/* 行操作 */
.cell-actions { text-align: right; }
.cell-actions .row-actions { justify-content: flex-end; }
.row-actions { display: flex; align-items: center; gap: 12px; }
.link-btn {
  background: none; border: none; padding: 0;
  font-size: 13px; color: var(--text-2); cursor: pointer; transition: color var(--transition);
  white-space: nowrap;
}
.link-btn:hover { color: var(--primary); }
.link-btn.danger:hover { color: var(--danger); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 52px 20px; color: var(--text-3); }
.empty-icon {
  width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.empty p { font-size: 14px; color: var(--text-2); }
.empty .empty-sub { margin-top: 6px; font-size: 12.5px; }

/* ---------- 分页 ---------- */
.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 12px 20px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.pager .pager-info { margin-right: auto; }
.pager button {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-2);
  transition: all var(--transition);
}
.pager button:hover:not(:disabled):not(.current) { border-color: var(--primary); color: var(--primary); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager button.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 主题强调表格（用户管理等管理页） ---------- */
.table-primary { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-primary th, .table-primary td { padding: 10px 14px; text-align: left; vertical-align: middle; white-space: nowrap; }
.table-primary thead th {
  background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid var(--primary-border);
}
.table-primary td { border-bottom: 1px solid var(--border); }
.table-primary tbody tr { transition: background var(--transition); }
.table-primary tbody tr:nth-child(even) { background: #fafbfe; }
.table-primary tbody tr:hover { background: var(--hover); }
.table-primary tbody tr.sel,
.table-primary tbody tr.sel:hover { background: var(--primary-soft); }
.table-primary .c-chk, .table-primary .c-seq { text-align: center; width: 52px; }
.table-primary .c-seq { color: var(--text-3); }
.table-primary .c-name { font-weight: 500; }
.table-primary input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--primary);
  cursor: pointer; vertical-align: middle;
}
.table-primary input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .35; }

/* 圆点状态 */
.st-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.st-on { color: var(--success); font-weight: 500; }
.st-on .st-dot { background: var(--success); }
.st-off { color: var(--danger); font-weight: 500; }
.st-off .st-dot { background: var(--danger); }

/* 表头排序箭头 */
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--primary-hover); }
.sort { display: inline-flex; flex-direction: column; margin-left: 5px; vertical-align: middle; }
.sort i { display: block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.sort .up { border-bottom: 5px solid #a5b4fc; }
.sort .down { border-top: 5px solid #a5b4fc; margin-top: 2px; }
.sort .up.active { border-bottom-color: var(--primary); }
.sort .down.active { border-top-color: var(--primary); }

/* 描边小按钮（表格行内操作） */
.btn-xs {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); color: var(--text-2);
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.btn-xs:hover { border-color: var(--primary); color: var(--primary); }
.btn-xs.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.btn-xs svg { width: 12px; height: 12px; }

/* 批量操作条 */
.bulk-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px;
  background: var(--primary-soft); border-bottom: 1px solid var(--primary-border);
  font-size: 13px; color: var(--primary);
}
.bulk-bar b { font-weight: 600; }

.page-fill .fill-body > .table-wrap > .table-primary { min-height: 100%; }

/* ---------- 图片画廊（按日期分组网格） ---------- */
.gallery-group { margin-bottom: 22px; }
.gallery-group:last-child { margin-bottom: 0; }
.gallery-title {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--text);
}
.gallery-count { font-size: 12px; font-weight: 400; color: var(--text-3); }
.gallery-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.pic-card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.pic-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.pic-thumb {
  display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--bg-soft); border: none; border-bottom: 1px solid var(--border);
  padding: 0; font: inherit; text-align: inherit; cursor: zoom-in;
}
.pic-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform var(--transition);
}
.pic-thumb:hover img { transform: scale(1.04); }
.pic-info { padding: 10px 12px 8px; min-width: 0; }
.pic-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pic-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 6px; min-width: 0;
}
.pic-meta .time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.pic-actions { display: flex; border-top: 1px solid var(--border); background: var(--hover); }
.pic-act {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  height: 34px; border: none; background: none; padding: 0;
  color: var(--text-2); cursor: pointer; transition: all var(--transition);
}
.pic-act + .pic-act { border-left: 1px solid var(--border); }
.pic-act:hover { color: var(--primary); background: var(--primary-soft); }
.pic-act.danger:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- 图片查看弹窗（画廊点击放大） ---------- */
.img-viewer {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 28px;
}
.iv-mask { position: absolute; inset: 0; background: rgba(16, 20, 28, .62); backdrop-filter: blur(2px); }
.iv-body {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: min(960px, 100%); max-height: 100%;
  border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.iv-stage {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); padding: 0;
}
.iv-stage img {
  display: block;
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.iv-foot {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px 12px;
  background: var(--surface);
}
/* 顶部分割线：品牌渐变细线（靛蓝→紫），两端渐隐，与纯色边框区分提升辨识度 */
.iv-foot::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 20%, #8b5cf6 50%, var(--primary) 80%, transparent 100%);
}
.iv-info { min-width: 0; flex: 1; }
.iv-name { min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-meta { margin-top: 2px; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.iv-cat { color: var(--primary); font-weight: 500; }
.iv-cat.is-default { color: var(--text-2); }
.iv-time { color: var(--text-3); }
.iv-actions { display: flex; gap: 8px; flex: none; }

/* ---------- 上传区（拖拽/点选） ---------- */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--border-strong); border-radius: 12px;
  padding: 30px 20px; text-align: center; cursor: pointer;
  background: var(--hover); transition: all var(--transition);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary); background: var(--primary-soft);
}
.dropzone.dragover { transform: scale(1.004); }
.dropzone-icon {
  width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.dropzone .dz-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.dropzone .dz-sub { margin-top: 6px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.dropzone .dz-sub kbd {
  display: inline-block; padding: 1px 6px; margin: 0 2px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 4px; background: var(--surface);
  font-family: inherit; font-size: 11.5px; color: var(--text-2);
}

/* 上传队列 */
.upload-queue { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.upload-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
.upload-item .u-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .u-status { font-size: 12.5px; white-space: nowrap; }
.upload-item .u-status.ok { color: var(--success); }
.upload-item .u-status.fail { color: var(--danger); }
.u-progress { flex: none; width: 160px; height: 6px; border-radius: 999px; background: var(--bg-track); overflow: hidden; }
.u-progress > i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--primary); transition: width .15s linear; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(16, 24, 40, .45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
}
.modal {
  width: 420px; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px);
  background: var(--surface); border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: popIn .18s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 600;
}
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  display: flex; padding: 2px; border-radius: 6px; transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--bg-soft); }
.modal-body { padding: 20px; overflow-y: auto; word-break: break-word; }
.modal-body p { font-size: 14px; line-height: 1.7; }
.modal-body b { word-break: break-all; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.modal.wide { width: 480px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px;
  background: #1d2129; color: #fff; font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 认证页（登录 / 初始化） ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(99, 102, 241, .12), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(79, 70, 229, .08), transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 36px 32px 30px;
}
.auth-logo {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 12px;
  background: var(--grad-brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .35);
}
.auth-title { text-align: center; font-size: 20px; font-weight: 700; }
.auth-sub { margin: 6px 0 24px; text-align: center; font-size: 13px; color: var(--text-2); }
.auth-error {
  display: none; margin-bottom: 16px; padding: 9px 12px;
  background: var(--danger-soft); border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--danger);
}
.auth-error.show { display: block; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--text-3); }

/* 表单分区 */
.form-section { margin-bottom: 22px; }
.form-section-title {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--text);
}
.form-section-title .step-no {
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.form-section-title .fs-sub { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-3); }

/* 链接预览 */
.url-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-top: 10px; margin-bottom: 18px;
  background: var(--hover); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-3);
}
.url-preview .up-label { flex: none; font-size: 12px; font-weight: 600; color: var(--text-2); }
.url-preview .preview-value {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
}
.url-preview.valid .preview-value { color: var(--success); }
.url-preview .preview-value a { color: inherit; text-decoration: none; }
.url-preview .preview-value a:hover { text-decoration: underline; }
/* 弹窗内授权码展示（换行可读） */
.modal-sub { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.code-box { margin-top: 0; margin-bottom: 0; justify-content: flex-start; }
.code-box .preview-value { flex: 1; overflow-wrap: anywhere; white-space: normal; }

/* 成功状态 */
.success-state { text-align: center; padding: 18px 0 20px; }
.success-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--success-soft); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  animation: popIn .35s ease;
}
.success-state h3 { font-size: 17px; margin-bottom: 8px; }
.success-state p { font-size: 13px; color: var(--text-2); line-height: 1.7; }

/* ---------- Shell（主页框架） ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  flex: none; width: 224px; height: 100%;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 16px;
}
.sidebar-logo .logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.sidebar-logo .logo-text { font-size: 15px; font-weight: 700; }
.sidebar-logo .logo-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.side-nav { flex: 1; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.nav-group-title { padding: 12px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all var(--transition); border: none; background: none; width: 100%; text-align: left;
}
.nav-item svg { flex: none; width: 20px; height: 20px; }
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* 侧边栏底部：用户区 */
.sidebar-bottom { flex: none; }
.sidebar-foot { padding: 6px 12px 12px; }
.user-block { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.user-block .u-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-block .u-role { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  display: flex; padding: 6px; border-radius: 6px; transition: all var(--transition);
}
.icon-btn:hover { color: var(--text); background: var(--bg-soft); }
.icon-btn.logout:hover { color: var(--danger); background: var(--danger-soft); }

/* 外壳页头：当前页面标题 */
.shell-head {
  flex: none; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.sh-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sh-icon {
  flex: none; width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.sh-icon svg { width: 16px; height: 16px; }
.sh-title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.sh-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 主内容区 */
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell-body { flex: 1; min-height: 0; }
.shell-body iframe { width: 100%; height: 100%; border: none; display: block; }

/* 提示卡片 */
.tip-card {
  display: flex; gap: 10px; padding: 12px 16px; margin-bottom: 16px;
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  border-radius: var(--radius); font-size: 13px; color: #3730a3; line-height: 1.7;
}
.tip-card svg { flex: none; margin-top: 2px; }

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 开关 Switch ---------- */
.switch-row {
  display: flex; align-items: center; gap: 14px;
}
.switch-row .sw-text { flex: 1; min-width: 0; }
.switch-row .sw-title { font-size: 14px; font-weight: 600; color: var(--text); }
.switch-row .sw-desc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.6; }
.switch {
  position: relative; flex: none; width: 42px; height: 24px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--border-strong); border: none; border-radius: 999px;
  transition: background var(--transition);
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.25);
  transition: transform var(--transition);
}
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 可搜索下拉 Combobox ---------- */
.cb { position: relative; }
/* 紧凑尺寸（工具栏 / 分页栏使用） */
.cb-sm .cb-field { height: 34px; font-size: 13px; padding-left: 10px; }
.toolbar .cb { min-width: 160px; }
.pager .cb { min-width: 96px; }
.cb-field {
  width: 100%; height: 36px; padding: 0 34px 0 12px;
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13.5px; color: var(--text-3); text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.cb-field:hover { border-color: var(--border-hover); }
.cb-field.open { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cb-field.has-value { color: var(--text); }
.cb-value { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; }
.cb-field-avatar {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.cb-field-initial {
  background: var(--grad-brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.cb-chevron { flex: none; position: absolute; right: 11px; color: var(--text-3); transition: transform var(--transition); }
.cb-field.open .cb-chevron { transform: rotate(180deg); }
.cb-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: cbIn .14s ease;
}
@keyframes cbIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* 向上弹出（分页栏等贴近底部的下拉） */
.cb-dropup .cb-panel {
  top: auto; bottom: calc(100% + 4px);
  animation: cbInUp .14s ease;
}
@keyframes cbInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.cb-search {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  color: var(--text-3);
}
.cb-search-input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-size: 13px; color: var(--text); padding: 2px 0;
}
.cb-search-input::placeholder { color: var(--text-3); }
.cb-list { max-height: 224px; overflow-y: auto; padding: 4px; }
.cb-option {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 7px; cursor: pointer;
  font-size: 13.5px; color: var(--text);
}
.cb-option:hover, .cb-option.active, .cb-option.sel { background: var(--primary-soft); color: var(--primary); }
.cb-opt-avatar {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.cb-opt-initial {
  background: var(--grad-brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.cb-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-opt-sub { font-size: 11.5px; color: var(--text-3); flex: none; }
.cb-empty { padding: 22px 12px; text-align: center; font-size: 12.5px; color: var(--text-3); }
.cb-foot {
  padding: 7px 12px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3); background: var(--bg);
}

/* ---------- 站点图标上传 ---------- */
.icon-config { display: flex; align-items: flex-start; gap: 14px; }
.icon-preview {
  width: 64px; height: 64px; border-radius: 14px; flex: none;
  border: 1px solid var(--border); background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.icon-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.icon-preview .icon-default { color: #fff; background: var(--grad-brand); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.icon-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.icon-btns { display: flex; align-items: center; gap: 10px; }

/* ---------- 图床配置：站点设置双栏布局 ---------- */
.site-settings {
  display: grid;
  grid-template-columns: minmax(0, 760px) 360px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 1100px) {
  .site-settings { grid-template-columns: 1fr; gap: 0; }
}

/* 图片压缩设置：质量与阈值双栏，窄屏回落单列 */
.compress-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 1100px) {
  .compress-fields { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- 图床配置：站点设置与安全防护左右两栏 ---------- */
.config-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}
.config-grid > .card { margin-bottom: 0; height: 100%; }
@media (max-width: 1500px) {
  .config-grid { grid-template-columns: 1fr; }
  .config-grid > .card { height: auto; }
}

/* ---------- 卡片头部右侧工具组 ---------- */
.card-head .head-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search-box {
  position: relative; display: flex; align-items: center; width: 220px;
}
.search-box svg { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.search-box .input { padding-left: 32px; height: 32px; font-size: 13px; }

/* ---------- 用户单元格 ---------- */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .u-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--grad-brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.user-cell .u-info { min-width: 0; }
.user-cell .u-info .cell-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 站点图标展示（侧边栏 / 登录页） ---------- */
.sidebar-logo .logo-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.auth-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.auth-logo .auth-logo-default { background: var(--grad-brand); color: #fff; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
