:root {
  --bg:      #0d1117;
  --sidebar: #0b1220;
  --panel:   #111c2f;
  --panel2:  #17243a;
  --line:    rgba(255,255,255,.08);
  --line2:   rgba(255,255,255,.14);
  --text:    #f0f6fc;
  --muted:   #8b949e;
  --green:   #1CD15E;
  --green-d: #0a7a39;
  --blue:    #3b82f6;
  --amber:   #f59e0b;
  --red:     #ef4444;
  --cyan:    #38bdf8;
  --orange:  #f97316;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
h1,h2,h3,p { margin: 0; }
.is-hidden { display: none !important; }

/* ── Login ── */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at 60% 20%, rgba(59,130,246,.12) 0%, transparent 60%);
}
.login-panel {
  width: min(100%, 400px);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 32px 80px rgba(0,0,0,.4);
}
.login-panel h1 { font-size: 22px; margin-bottom: 6px; }
.login-panel p  { color: var(--muted); margin-bottom: 24px; font-size: 13px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.error-text  { min-height: 20px; color: #fca5a5; font-size: 13px; margin-top: 8px; }

/* ── Shell ── */
.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0,1fr);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 4px 18px; }
.logo {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #1CD15E, #38bdf8);
}
.brand strong { font-size: 15px; font-weight: 700; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 9px;
  min-height: 40px; padding: 0 10px;
  border-radius: 7px;
  color: #94a3b8; text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar nav a:hover  { background: var(--panel2); color: #e2e8f0; }
.sidebar nav a.active { background: rgba(34,197,94,.12); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.user-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--panel2); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#3b82f6,#8b5cf6); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.user-role { font-size: 11px; color: var(--muted); }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 24px; height: 56px;
  background: rgba(13,17,23,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 16px; font-weight: 700; }
.topbar-sub { font-size: 13px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ── Workflow tabs (like alltuu top nav) ── */
.workflow-nav {
  display: flex; align-items: center; gap: 2px;
  padding: 0 24px;
  height: 48px;
  border-bottom: 1px solid var(--line);
  background: var(--sidebar);
  overflow-x: auto;
}
.workflow-nav a {
  display: flex; align-items: center; gap: 6px;
  height: 48px; padding: 0 16px;
  color: var(--muted); text-decoration: none;
  font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s;
}
.workflow-nav a:hover  { color: #e2e8f0; }
.workflow-nav a.active { color: #fff; border-bottom-color: var(--green); }
.workflow-nav .wf-icon { font-size: 16px; }

/* ── Main content ── */
.main-content { padding: 24px; min-width: 0; }

/* ── Buttons ── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 16px;
  border: 0; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  background: var(--green); color: #052e16;
  transition: opacity .15s;
}
button:hover { opacity: .88; }
button.ghost  { background: var(--panel2); color: #e2e8f0; border: 1px solid var(--line2); }
button.danger { background: rgba(239,68,68,.14); color: #fca5a5; border: 1px solid rgba(239,68,68,.28); }
button.primary-sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Forms ── */
label { display: grid; gap: 5px; font-size: 13px; color: #94a3b8; }
input, select, textarea {
  min-height: 36px; padding: 0 10px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line2); border-radius: 7px;
  font-size: 14px; font-family: inherit;
  transition: border-color .15s;
}
input:focus, select:focus { outline: none; border-color: var(--blue); }

/* ── Panel / Card ── */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px;
  margin-bottom: 16px;
}
.account-panel { max-width: 760px; }
.panel-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 10px;
}
.panel-title h2 { font-size: 15px; font-weight: 700; }

/* ── Badge / pill ── */
.badge {
  display: inline-flex; align-items: center; min-height: 22px;
  padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(56,189,248,.14); color: #7dd3fc;
}
.badge.green  { background: rgba(34,197,94,.14);  color: #86efac; }
.badge.amber  { background: rgba(245,158,11,.14);  color: #fde68a; }
.badge.red    { background: rgba(239,68,68,.14);   color: #fca5a5; }
.badge.muted  { background: rgba(148,163,184,.1);  color: #94a3b8; }

/* ── Album cards (like alltuu project list) ── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.album-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.album-card:hover { border-color: var(--line2); box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.album-cover {
  position: relative; aspect-ratio: 16/7; background: var(--panel2);
  overflow: hidden;
}
.album-cover-img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--muted);
  background: linear-gradient(135deg, #111c2f, #17243a);
}
.album-count {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  border-radius: 6px; padding: 3px 8px;
  font-size: 12px; font-weight: 700; color: #fff;
}
.album-body { padding: 14px; }
.album-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.album-actions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.album-action {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; border-radius: 7px; background: var(--panel2);
  border: 1px solid var(--line); cursor: pointer; font-size: 11px; color: #94a3b8;
  transition: background .15s, color .15s;
}
.album-action:hover { background: var(--bg); color: #e2e8f0; }
.album-action.active { background: rgba(34,197,94,.1); color: #86efac; border-color: rgba(34,197,94,.2); }
.album-action-icon { font-size: 18px; }

/* ── Flow status bar ── */
.flow-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; margin-bottom: 16px;
  flex-wrap: wrap;
}
.flow-step {
  flex: 1; min-width: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  cursor: pointer; transition: background .15s;
}
.flow-step:last-child { border-right: none; }
.flow-step:hover { background: rgba(255,255,255,.04); }
.flow-step.active { background: rgba(34,197,94,.1); }
.flow-step-label { font-size: 11px; color: var(--muted); }
.flow-step-count { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1; }
.flow-step.active .flow-step-count { color: var(--green); }

/* ── Photo toolbar ── */
.photo-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.photo-toolbar .toolbar-left  { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.photo-toolbar .toolbar-right { display: flex; align-items: center; gap: 8px; }
.filter-btn {
  min-height: 32px; padding: 0 12px; border-radius: 6px;
  background: var(--panel2); color: #94a3b8; border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.filter-btn.active { background: rgba(34,197,94,.12); color: #86efac; border-color: rgba(34,197,94,.28); }
.select-all-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.select-all-wrap input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--green); }
.bulk-actions { display: flex; align-items: center; gap: 6px; }

/* ── Workbench 深色主题 ── */
.wb-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap;
}
/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); font-size: 12px; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* ── Metric grid ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.metric {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px;
}
.metric-num  { font-size: 22px; font-weight: 800; line-height: 1; }
.metric-label { font-size: 11px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }

/* ── Empty state ── */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-text { font-size: 14px; }
.empty-sub  { font-size: 12px; margin-top: 4px; }

/* ── Upload dropzone ── */
.dropzone {
  border: 2px dashed var(--line2); border-radius: 10px;
  padding: 32px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-top: 12px;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--green); background: rgba(34,197,94,.04); }
.dropzone input { display: none; }
.dropzone-icon { font-size: 32px; margin-bottom: 8px; }
.dropzone-text { font-size: 14px; color: #e2e8f0; font-weight: 600; }
.dropzone-sub  { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Progress ── */
.progress-bar { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--green); transition: width .3s; }

/* ── Upload file list row ── */
.file-row-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--panel); border-radius: 6px; margin-bottom: 4px;
}
.file-row-item:last-child { border-bottom: none; margin-bottom: 0; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.row  { display: flex; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
code {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 6px;
  margin: 2px; border-radius: 5px;
  background: rgba(148,163,184,.1); color: #cbd5e1; font-size: 12px;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--panel2); color: #94a3b8; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .album-grid { grid-template-columns: 1fr; }
  .album-actions { grid-template-columns: repeat(4, 1fr); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .flow-step-label { display: none; }
}

/* ── P0-4: 照片网格固定尺寸（防止大图撑爆页面）──────────────────────────── */
.wb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.wb-card {
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel2);
  border: 1.5px solid var(--line);
  transition: border-color .15s;
  cursor: pointer;
}
.wb-card.selected { border-color: var(--cyan); }
.wb-card-img-wrap {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: var(--panel);
  position: relative;
}
.wb-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.wb-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
  opacity: 0;
  transition: opacity .15s;
}
.wb-card:hover .wb-card-overlay { opacity: 1; }
.wb-card-check {
  position: absolute;
  top: 8px; left: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85);
  background: rgba(0,0,0,.4);
  color: #fff;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.wb-card.selected .wb-card-check {
  background: var(--cyan);
  border-color: var(--cyan);
}
.wb-card-footer {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.wb-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.wb-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.wb-card-btn {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.wb-card-btn.pub { border-color: var(--green); color: var(--green); }
.wb-card-btn.hide { border-color: var(--muted); color: var(--muted); }
.wb-card-btn.del { border-color: var(--red); color: var(--red); }

/* 活动卡片封面图固定高度 */
.album-cover {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--panel2);
  position: relative;
  border-radius: 10px 10px 0 0;
}
.album-cover {
  position: relative;
  overflow: hidden;
  height: 180px;
  background: #1a1a1a;
}
/* 底层模糊背景 */
.album-cover-bg {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  object-fit: cover;
  filter: blur(8px);
  opacity: 0.7;
}
/* 顶层保持完整比例 */
.album-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.album-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

/* ── 隐藏申请面板 ──────────────────────────────────────────────────────────── */
.dr-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.dr-panel {
  background: var(--panel); border-radius: 12px; width: 100%; max-width: 800px;
  padding: 24px; position: relative;
}
.dr-close {
  position: absolute; top: 12px; right: 16px;
  border: none; background: none; font-size: 20px; cursor: pointer; color: var(--text);
}
.dr-title { margin: 0 0 16px; font-size: 18px; font-weight: 700; }
.dr-empty { color: var(--muted); text-align: center; padding: 32px; }
.dr-error { color: var(--red); }

.dr-row {
  border: 1px solid var(--line); border-radius: 8px; padding: 14px;
  margin-bottom: 12px; display: flex; gap: 14px; align-items: flex-start;
}
.dr-thumb {
  width: 72px; height: 72px; object-fit: cover; border-radius: 6px; flex-shrink: 0;
}
.dr-thumb-empty { background: var(--panel2); }
.dr-info { flex: 1; min-width: 0; }
.dr-photo-id { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.dr-reason { font-size: 14px; margin-bottom: 4px; }
.dr-contact { font-size: 12px; color: var(--muted); }
.dr-tags { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dr-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--panel2); color: var(--text);
}
.dr-tag-warn { background: #fef3c7; color: #92400e; }
.dr-tag-muted { background: transparent; color: var(--muted); padding: 0; }
.dr-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }

.btn.green-sm {
  font-size: 12px; padding: 6px 12px; background: var(--green); color: #fff;
  border: none; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.btn.ghost-sm {
  font-size: 12px; padding: 6px 12px; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer; white-space: nowrap;
}

/* ── 封面焦点选择器 ──────────────────────────────────────────────────────────── */
.focal-panel {
  background: var(--panel); border-radius: 12px;
  width: 100%; max-width: 640px; padding: 24px; position: relative;
}
.focal-img-wrap {
  position: relative; cursor: crosshair;
  border-radius: 8px; overflow: hidden; background: #000; line-height: 0;
}
.focal-img {
  width: 100%; max-height: 60vh;
  object-fit: contain; display: block; pointer-events: none;
}
.focal-dot {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%; border: 3px solid #fff;
  background: rgba(28,209,94,.7); box-shadow: 0 0 0 2px rgba(0,0,0,.4);
  pointer-events: none; transition: left .1s, top .1s;
}

/* admin-web 封面图也改用焦点裁剪 */
.album-cover-img {
  object-fit: cover;
  /* object-position 由 JS 动态写入 style */
}
