* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #059669;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0,0,0,.08);
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; }

.btn {
  display: inline-block; padding: 11px 22px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #a5b4fc; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-danger-ghost { background: #fff; color: var(--danger); border: 1px solid var(--border); }
.btn-danger-ghost:hover { background: #fef2f2; }
.btn-block { display: block; width: 100%; text-align: center; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar .inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--primary); }
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #4f46e5, #7c3aed);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px;
}
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 15px; color: var(--muted); }
.nav-links a:hover { color: var(--primary); }

/* Landing hero */
.hero {
  text-align: center; padding: 84px 24px 56px;
  background: linear-gradient(160deg, #eef2ff 0%, #faf5ff 50%, #fff 100%);
}
.hero h1 { font-size: 48px; font-weight: 800; letter-spacing: -1px; margin-bottom: 16px; }
.hero h1 .grad { background: linear-gradient(90deg, #4f46e5, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; color: var(--muted); max-width: 620px; margin: 0 auto 32px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.section { max-width: 1080px; margin: 0 auto; padding: 64px 24px; }
.section h2 { font-size: 30px; font-weight: 800; text-align: center; margin-bottom: 40px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature .icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px;
}
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14px; }

.footer {
  border-top: 1px solid var(--border); background: #fff; text-align: center;
  padding: 28px 24px; color: var(--muted); font-size: 14px;
}

/* Auth pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-card h1 { text-align: center; font-size: 24px; margin-bottom: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.form-error { color: var(--danger); font-size: 14px; margin: 12px 0; text-align: center; }
.form-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.form-switch a { color: var(--primary); font-weight: 600; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  color: #cbd5e1; flex-shrink: 0; border-right: 1px solid #1f2937;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 20px 22px; color: #fff; border-bottom: 1px solid #1f2937; }
.sidebar .menu { flex: 1; padding: 14px 12px; overflow-y: auto; scrollbar-width: none; }
.sidebar .menu::-webkit-scrollbar { display: none; }

* { scrollbar-width: none; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px;
  margin-bottom: 2px; font-size: 14.5px; cursor: pointer; border: none;
  background: transparent; color: #cbd5e1; width: 100%; text-align: left;
  transition: background .18s, color .18s;
}
.menu-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-item.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.menu-item.active:hover { color: #fff; }
.menu-item > span:first-child { width: 22px; text-align: center; flex-shrink: 0; font-size: 15px; }
.sidebar .user { padding: 16px; border-top: 1px solid #1f2937; font-size: 14px; }
.sidebar .user .name { color: #fff; font-weight: 600; }
.main { flex: 1; padding: 32px; min-width: 0; }
.page-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.page-desc { color: var(--muted); margin-bottom: 24px; font-size: 15px; }

.upload-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .upload-grid { grid-template-columns: 1fr; } }

.drop {
  border: 2px dashed #c7d2fe; border-radius: 14px; padding: 40px 24px; text-align: center;
  color: var(--muted); cursor: pointer; transition: all .2s; background: #f8faff;
}
.drop.hover, .drop:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.drop .drop-icon { font-size: 42px; margin-bottom: 8px; }
.drop input { display: none; }
.file-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--primary-light); color: var(--primary); padding: 10px 14px;
  border-radius: 10px; margin-top: 14px; font-size: 14px;
}

.history-item {
  background: #fafafa; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin-bottom: 12px; font-size: 14px;
}
.history-item .meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.history-item .txt { max-height: 60px; overflow: hidden; }
.history-item .txt.clamp {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal;
}
.history-item .history-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.history-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.detail-text {
  white-space: pre-wrap; word-break: break-word;
  font-size: 14px; line-height: 1.8; color: var(--text, #1f2937);
}

.result-box { margin-top: 24px; }
.result-box textarea {
  width: 100%; min-height: 160px; padding: 14px; font-size: 15px; line-height: 1.7;
  border: 1px solid var(--border); border-radius: 12px; resize: vertical; background: #fafafa; outline: none;
}
.msg { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-top: 14px; }
.msg.error { background: #fef2f2; color: var(--danger); }
.msg.ok { background: #ecfdf5; color: var(--success); }
.hidden { display: none !important; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 600; }
.badge-success { background: #ecfdf5; color: var(--success); }
.badge-danger { background: #fef2f2; color: var(--danger); }
.badge-asr { background: #eff6ff; color: #2563eb; }
.badge-douyin { background: #f5f3ff; color: #7c3aed; }

/* 新闻收集 */
.news-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 164px; margin-bottom: 20px; padding: 28px 32px; overflow: hidden;
  border: 1px solid #dbe4ff; border-radius: 18px;
  background: radial-gradient(circle at 90% 10%, rgba(129,140,248,.28), transparent 32%), linear-gradient(135deg, #eef2ff 0%, #faf5ff 54%, #fff 100%);
}
.news-hero-report { border-color: #f1d7c5; background: radial-gradient(circle at 90% 10%, rgba(251,191,36,.2), transparent 34%), linear-gradient(135deg, #fff7ed 0%, #fff 65%); }
.news-hero h2 { margin: 8px 0 6px; font-size: 25px; letter-spacing: -.4px; }
.news-hero p { max-width: 650px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.news-eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: 1.1px; }
.news-hero-report .news-eyebrow { color: #c2410c; }
.news-hero-mark { font-size: 62px; filter: drop-shadow(0 10px 12px rgba(79,70,229,.18)); transform: rotate(6deg); }
.news-hero-number { display: flex; flex-direction: column; align-items: center; min-width: 100px; color: #c2410c; }
.news-hero-number strong { font-size: 58px; line-height: 1; font-weight: 850; }
.news-hero-number span { margin-top: 7px; font-size: 12px; font-weight: 700; }
.news-control-card { padding: 22px 24px; }
.news-control-card .toolbar { margin-bottom: 18px; }
.news-list-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 28px 2px 14px; }
.news-list-heading h2 { font-size: 19px; }
.news-list-heading p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.news-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.news-filters .search-input { flex: 1; min-width: 210px; }
.news-filters select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text); outline: none; min-width: 112px;
}
.news-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 12px;
}
.news-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.news-title { display: block; color: var(--text); font-size: 17px; font-weight: 700; line-height: 1.5; }
.news-title:hover { color: var(--primary); }
.news-summary { color: var(--muted); font-size: 14px; line-height: 1.7; margin-top: 7px; }
.news-actions { margin-top: 10px; text-align: right; font-size: 13px; }
.news-actions a { color: var(--primary); }
.news-digest-card { margin: 0 0 20px; padding: 20px; border: 1px solid #c7d2fe; border-radius: 12px; background: linear-gradient(135deg, #f8faff, #fff); }
.news-digest-overview { color: var(--muted); font-size: 14px; line-height: 1.8; margin-bottom: 12px; }
.news-digest-item { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--border); }
.news-digest-rank { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--primary); color: #fff; text-align: center; line-height: 26px; font-size: 13px; font-weight: 700; }
.news-digest-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-digest-item-head a { color: var(--text); font-size: 15px; font-weight: 700; line-height: 1.5; }
.news-digest-item-head a:hover { color: var(--primary); }
.news-digest-item-summary { color: var(--text); font-size: 14px; line-height: 1.7; margin-top: 4px; }
.news-digest-significance { color: var(--primary); font-size: 13px; line-height: 1.6; margin-top: 3px; }
.news-digest-source { color: var(--muted); font-size: 12px; margin-top: 3px; }
.news-report-builder { margin-top: 20px; }
.news-report-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.news-report-form .field { flex: 0 1 150px; min-width: 140px; margin-bottom: 0; }
.news-report-form .field input, .news-report-form .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  outline: none; background: #fff; color: var(--text);
}
.news-report-form .field input:focus, .news-report-form .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.news-report-greeting { flex: 1 1 330px !important; }
.news-reports-card { margin-top: 20px; }
.news-report-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-top: 14px; background: #fff; }
.news-report-card:first-child { margin-top: 4px; }
.news-report-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.news-report-card-title { font-size: 16px; font-weight: 700; }
.news-report-card-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.news-report-content {
  margin: 14px 0 0; padding: 16px; border-radius: 10px; background: #fafafa; color: var(--text);
  white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 14px; line-height: 1.85;
}
.news-report-actions { display: flex; gap: 8px; }
.readhub-hero { border-color: #cfe7e4; background: radial-gradient(circle at 88% 20%, rgba(45,212,191,.22), transparent 32%), linear-gradient(135deg, #ecfeff 0%, #f0fdfa 52%, #fff 100%); }
.readhub-hero .news-eyebrow { color: #0f766e; }
.readhub-source-link { flex-shrink: 0; padding: 10px 16px; border: 1px solid #99d5cf; border-radius: 10px; color: #0f766e; background: rgba(255,255,255,.75); font-size: 13px; font-weight: 700; }
.readhub-source-link:hover { background: #fff; box-shadow: 0 6px 18px rgba(15,118,110,.12); }
.readhub-control-card { padding: 22px 24px; }
.readhub-date-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.readhub-date-row .field { width: 180px; margin: 0; }
.readhub-date-row .field input { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; outline: none; background: #fff; color: var(--text); }
.readhub-date-row .field input:focus { border-color: #0faaa0; box-shadow: 0 0 0 3px rgba(20,184,166,.12); }
.readhub-date-row > span { padding-bottom: 11px; color: var(--muted); font-size: 13px; }
.readhub-current-card, .readhub-history-card { margin-top: 20px; }
.readhub-current-card { border-top: 3px solid #14b8a6; }
.readhub-items { margin-top: 4px; }
.readhub-item { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--border); }
.readhub-item:first-child { border-top: 0; }
.readhub-rank { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: #ccfbf1; color: #0f766e; text-align: center; line-height: 34px; font-size: 14px; font-weight: 800; }
.readhub-item-title { color: var(--text); font-size: 16px; font-weight: 750; line-height: 1.55; }
.readhub-item-title:hover { color: #0f766e; }
.readhub-item-summary { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.readhub-history-item { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.readhub-history-date { width: 76px; flex-shrink: 0; color: #0f766e; font-size: 15px; font-weight: 800; }
.readhub-history-headline { flex: 1; min-width: 0; overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.readhub-history-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.readhub-history-view { flex-shrink: 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #0f766e; font-size: 12px; cursor: pointer; }
.readhub-history-view:hover { background: #f0fdfa; }
@media (max-width: 640px) {
  .news-hero { min-height: 0; padding: 22px; }
  .news-hero h2 { font-size: 21px; }
  .news-hero-mark { font-size: 44px; }
  .news-hero-number { min-width: 72px; }
  .news-hero-number strong { font-size: 44px; }
  .news-report-builder, .news-reports-card { padding: 20px; }
  .news-report-form .field, .news-report-greeting { flex-basis: 100% !important; }
  .readhub-hero { align-items: flex-start; flex-direction: column; }
  .readhub-source-link { align-self: flex-start; }
  .readhub-control-card, .readhub-current-card, .readhub-history-card { padding: 20px; }
  .readhub-history-item { gap: 9px; }
  .readhub-history-date { width: 66px; font-size: 13px; }
  .readhub-history-headline { font-size: 13px; }
}

/* Sidebar group */
.menu-group { margin-bottom: 4px; }
.menu-group-title {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  font-size: 12.5px; color: #64748b; letter-spacing: .4px; cursor: pointer;
  user-select: none; border-radius: 10px; transition: background .2s;
}
.menu-group-title:hover { background: rgba(255,255,255,.05); color: #94a3b8; }
.menu-group-title .arrow {
  margin-left: auto; font-size: 11px; color: #64748b;
  transition: transform .2s, color .2s;
}
.menu-group.collapsed .arrow { transform: rotate(-90deg); }
.menu-group.collapsed .menu-group-children { display: none; }
.menu-group .menu-item { padding-left: 36px; font-size: 14px; }

/* Mobile */
.mobile-topbar, .menu-toggle, .menu-backdrop { display: none; }
@media (max-width: 768px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 60;
    background: #0f172a; color: #fff; padding: 10px 16px;
    border-bottom: 1px solid #1f2937;
  }
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0; border: none; border-radius: 10px;
    background: rgba(255,255,255,.1); color: #fff; font-size: 20px; cursor: pointer;
    transition: background .2s;
  }
  .menu-toggle:active { background: rgba(255,255,255,.22); }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
  .mobile-brand .logo { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }

  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 264px;
    height: 100vh; transform: translateX(-105%); transition: transform .28s ease;
    z-index: 70; box-shadow: 6px 0 28px rgba(0,0,0,.3);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-backdrop {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(15,23,42,.55);
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .menu-backdrop.show { opacity: 1; pointer-events: auto; }

  .main { padding: 16px; }
  .page-title { font-size: 20px; }
  .card { overflow-x: auto; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .search-input { width: 100%; }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 9px 8px; }
  .check-list { max-height: 260px; }
}

/* Admin tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.admin-table tr:hover td { background: #fafbff; }
.admin-table .ops { white-space: nowrap; }
.admin-table .ops button { margin-right: 6px; }
.admin-empty { text-align: center; color: var(--muted); padding: 32px 0; }
.tree-toggle {
  display: inline-block; width: 18px; height: 18px; margin-right: 4px;
  border: none; background: var(--primary-light); color: var(--primary);
  border-radius: 5px; font-size: 12px; line-height: 1; cursor: pointer;
  vertical-align: middle; transition: background .2s;
}
.tree-toggle:hover { background: #dbe2fe; }
.tree-toggle-placeholder { display: inline-block; width: 22px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal { width: 100%; max-width: 480px; background: #fff; border-radius: 16px; padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.2); display: flex; flex-direction: column; max-height: 88vh; }
.modal h3 { font-size: 18px; margin-bottom: 18px; flex-shrink: 0; }
.modal #modalBody { overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.modal .field select, .modal .field input { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; outline: none; background: #fff; }
.modal .modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; flex-shrink: 0; }
.modal .modal-actions .btn { flex: 1; }
.check-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.check-list label { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 14px; cursor: pointer; }
.check-list input { width: 16px; height: 16px; accent-color: var(--primary); }
.check-list .child { padding-left: 28px; color: var(--muted); }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.search-input { padding: 9px 13px; border: 1px solid var(--border); border-radius: 10px; outline: none; width: 220px; }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* 图床 */
.gallery-crumb { color: var(--primary); text-decoration: none; cursor: pointer; font-size: 14px; }
.gallery-crumb:hover { text-decoration: underline; }
#galleryGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.gallery-item {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: #fff; display: flex; flex-direction: column;
}
.gallery-folder { cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.gallery-folder:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(79,70,229,.12); }
.gallery-icon { font-size: 40px; text-align: center; padding: 26px 0 8px; }
.gallery-thumb { width: 100%; height: 120px; object-fit: cover; background: #f1f5f9; display: block; }
.gallery-name {
  padding: 8px 10px; font-size: 13px; color: var(--text, #1f2937);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-ops { display: flex; gap: 6px; justify-content: center; padding: 6px 8px 10px; flex-wrap: wrap; }
@media (max-width: 600px) {
  #galleryGrid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .gallery-thumb { height: 96px; }
}
.gallery-thumb { cursor: pointer; }

/* 图片预览灯箱 */
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-overlay.hidden { display: none; }
.lightbox-stage { max-width: 88vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-stage img { max-width: 88vw; max-height: 80vh; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox-caption { color: #e5e7eb; font-size: 14px; margin-top: 12px; text-align: center; }
.lightbox-count { color: #9ca3af; margin-left: 8px; }
.lightbox-close {
  position: absolute; top: 18px; right: 24px; background: none; border: none;
  color: #fff; font-size: 30px; cursor: pointer; line-height: 1; z-index: 210;
}
.lightbox-close:hover { color: #c7d2fe; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12); border: none; color: #fff;
  font-size: 34px; width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; line-height: 1; z-index: 210;
}
.lightbox-nav:hover { background: rgba(255,255,255,.28); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
@media (max-width: 600px) { .lightbox-nav { width: 40px; height: 40px; font-size: 26px; } }
