/* jxphotos v2 · 从零重写 */
:root {
  --bg: #050505;
  --bg2: #0c0b09;
  --surface: #141210;
  --border: rgba(212,175,55,0.14);
  --text: #f5f0e6;
  --muted: #9a9080;
  --accent: #d4af37;
  --accent2: #b8860b;
  --gold-glow: rgba(212,175,55,0.25);
  --danger: #e57373;
  --ok: #81c784;
  --header: 58px;
  --max: 1280px;
  --radius: 10px;
  --font: "DM Sans", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header);
  background: rgba(5,5,5,0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}
.site-logo img { width: 32px; height: 32px; border-radius: 8px; }
.site-logo:hover { text-decoration: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  white-space: nowrap;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); background: rgba(255,255,255,0.05); text-decoration: none; }
.site-nav a.active { color: var(--accent); background: var(--gold-glow); }

.site-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  gap: 2px;
}
.lang-switch button {
  padding: 4px 7px;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.lang-switch button.active { color: var(--accent); font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #8b6914, var(--accent), #f0d78c);
  color: #0a0a0a;
  font-weight: 700;
}
.btn-primary:hover { opacity: 0.9; text-decoration: none; }
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: rgba(248,113,113,0.15); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.menu-btn span { display: block; height: 2px; background: #fff; border-radius: 1px; }

.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--header);
  left: 0; right: 0;
  z-index: 999;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  max-height: calc(100vh - var(--header));
  overflow-y: auto;
}
.mobile-drawer.open { display: block; }
.mobile-drawer a {
  display: block;
  padding: 12px 14px;
  color: var(--text);
  border-radius: 8px;
  text-decoration: none;
}
.mobile-drawer a:hover { background: var(--gold-glow); text-decoration: none; }

/* ── Main ── */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.page-title {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  color: #fff;
}
.page-desc {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--muted);
}

/* ── Hero ── */
.hero {
  position: relative;
  margin: -24px -16px 28px;
  padding: 48px 16px 36px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(5,5,5,0.96) 40%, rgba(12,11,9,0.55) 100%),
    url("https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/American_Airlines_Boeing_777-300ER_%28N719AN%29_landing_at_Los_Angeles_International_Airport.jpg/1280px-American_Airlines_Boeing_777-300ER_%28N719AN%29_landing_at_Los_Angeles_International_Airport.jpg") center 35%/cover no-repeat;
}
.hero-inner { position: relative; max-width: var(--max); margin: 0 auto; }
.hero-kicker { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.18em; color: var(--accent); text-shadow: 0 0 20px var(--gold-glow); }
.hero h1 { margin: 0 0 10px; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; color: #fff; }
.hero p { margin: 0 0 20px; max-width: 520px; font-size: 14px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  padding: 7px 16px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
}
.chip.active, .chip:hover { color: var(--accent); background: var(--gold-glow); border-color: rgba(212,175,55,0.45); text-decoration: none; }

.stats-row { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; color: var(--muted); }
.stats-row strong { color: #fff; font-weight: 700; margin-right: 4px; }

/* ── Gallery ── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.toolbar input, .toolbar select {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
}
.toolbar input { flex: 1; min-width: 200px; }

.gallery-grid {
  columns: 2;
  column-gap: 12px;
}
@media (min-width: 640px) { .gallery-grid { columns: 3; } }
@media (min-width: 960px) { .gallery-grid { columns: 4; } }

.photo-card {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
.photo-card a { display: block; color: inherit; text-decoration: none; }
.photo-card img { width: 100%; aspect-ratio: auto; background: var(--bg2); }
.photo-card-info { padding: 10px 12px; }
.photo-card-info h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #fff; }
.photo-card-info p { margin: 0; font-size: 11px; color: var(--muted); }

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

/* ── Cards / Forms ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2, .card h3 { margin: 0 0 14px; font-size: 15px; color: #fff; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: rgba(212,175,55,0.5);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.req { color: var(--danger); }

.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 7px 14px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.tag.on { color: var(--accent); background: rgba(59,158,255,0.12); border-color: rgba(59,158,255,0.35); }

/* Upload slots */
.upload-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.upload-slot {
  position: relative;
  aspect-ratio: 4/3;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  overflow: hidden;
  cursor: pointer;
}
.upload-slot:hover { border-color: rgba(59,158,255,0.4); }
.upload-slot.has-img { border-style: solid; cursor: default; }
.upload-slot img { width: 100%; height: 100%; object-fit: cover; }
.upload-slot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 12px;
  text-align: center;
  gap: 6px;
}
.upload-slot-label { font-size: 13px; font-weight: 600; color: #fff; }
.upload-slot-hint { font-size: 11px; color: var(--muted); }
.upload-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-slot.has-img input { pointer-events: none; }
.upload-slot .clear {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff;
  cursor: pointer; display: none;
}
.upload-slot.has-img .clear { display: flex; align-items: center; justify-content: center; }

.progress { height: 4px; background: var(--border); border-radius: 2px; margin-top: 12px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

/* Article / Shop */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s;
}
.list-card:hover { transform: translateY(-2px); }
.list-card img { width: 100%; height: 160px; object-fit: cover; background: var(--bg2); }
.list-card-body { padding: 14px; }
.list-card-body h3 { margin: 0 0 6px; font-size: 15px; color: #fff; }
.list-card-body p { margin: 0; font-size: 13px; color: var(--muted); }

.prose { font-size: 15px; line-height: 1.7; color: var(--text); }
.prose h1, .prose h2 { color: #fff; }

/* Photo detail */
.photo-detail { display: grid; gap: 24px; }
@media (min-width: 768px) {
  .photo-detail { grid-template-columns: 1fr 320px; }
}
.photo-detail img.main {
  width: 100%;
  border-radius: var(--radius);
  background: var(--bg2);
}
.extra-images { display: flex; gap: 8px; margin-top: 10px; }
.extra-images img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.extra-images img.active { border-color: var(--accent); }
.meta-list { list-style: none; padding: 0; margin: 0; }
.meta-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.meta-list li span { color: var(--muted); display: inline-block; min-width: 80px; }

/* Admin */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-box {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.stat-box strong { display: block; font-size: 1.5rem; color: #fff; }
.stat-box span { font-size: 12px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
td img { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.tab.active { color: var(--accent); border-color: rgba(59,158,255,0.4); background: rgba(59,158,255,0.1); }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-warn { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.3); color: #fcd34d; }
.alert-ok { background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.3); color: var(--ok); }
.alert-err { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--danger); }

.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.empty p { margin: 8px 0 0; font-size: 14px; }

.loading { text-align: center; padding: 40px; color: var(--muted); }

/* Footer */
.site-footer {
  margin-top: auto;
  background: #050810;
  border-top: 1px solid var(--border);
  padding: 32px 16px 24px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 24px;
}
.footer-brand p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  max-width: var(--max);
  margin: 20px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 768px) {
  .site-nav, .site-actions .btn-ghost:not(.user-btn) { display: none; }
  .menu-btn { display: flex; margin-left: auto; }
  .upload-slots { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero { margin-top: 0; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; max-height: none; }
}

/* ── 首页 ── */
.home-hero {
  position: relative;
  margin: -24px -16px 32px;
  padding: 56px 16px 48px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.home-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(5,5,5,0.97) 30%, rgba(20,18,16,0.75) 100%),
    radial-gradient(ellipse at 80% 20%, rgba(212,175,55,0.12), transparent 50%),
    url("https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/American_Airlines_Boeing_777-300ER_%28N719AN%29_landing_at_Los_Angeles_International_Airport.jpg/1280px-American_Airlines_Boeing_777-300ER_%28N719AN%29_landing_at_Los_Angeles_International_Airport.jpg") center 40%/cover no-repeat;
}
.home-hero h1 {
  background: linear-gradient(135deg, #fff 0%, var(--accent) 55%, #f0d78c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-hero-inner { position: relative; max-width: var(--max); margin: 0 auto; }
.home-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
}
.home-hero-desc {
  margin: 0 0 24px;
  max-width: 560px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}
.home-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.home-section { margin-bottom: 40px; }
.home-section h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.home-cats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.home-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
}
.home-cat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212,175,55,0.45);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px var(--gold-glow);
  text-decoration: none;
}

/* 实时航班 */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.live-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: live-pulse 1.5s ease infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.live-airport-card {
  padding: 14px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.live-airport-card.busy { border-color: rgba(212,175,55,0.5); }
.live-airport-card .code {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.live-airport-card h3 {
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.live-airport-card .dep {
  font-size: 12px;
  color: var(--muted);
}
.live-airport-card .dep strong { color: var(--accent); }
.live-flights-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.live-flights-table th,
.live-flights-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.live-flights-table th {
  color: var(--accent);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.live-flights-table tr:hover td { background: rgba(212,175,55,0.04); }
.live-meta {
  font-size: 11px;
  color: var(--muted);
  margin: -8px 0 12px;
}
.home-cat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.home-cat-card span:last-child { font-size: 14px; color: var(--muted); }

/* ── 管理后台 ── */
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
}
.admin-sidebar {
  position: sticky;
  top: calc(var(--header) + 12px);
  max-height: calc(100vh - var(--header) - 40px);
  overflow-y: auto;
}
.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-tabs .tab {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
}
.admin-tabs .tab.active {
  background: var(--gold-glow);
  color: var(--accent);
}

/* 管理后台独立壳 */
.admin-shell {
  min-height: 100vh;
  background: var(--bg);
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(5,5,5,0.98);
}
.admin-topbar .brand {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.admin-topbar .brand:hover { text-decoration: none; color: #f0d78c; }
.admin-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.admin-grid-tables {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
.admin-grid-tables .stat-box span {
  font-size: 10px;
  word-break: break-all;
}
.admin-pre {
  margin: 0;
  padding: 12px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  background: var(--bg2);
  border-radius: 8px;
  overflow: auto;
  max-height: 240px;
  white-space: pre-wrap;
  word-break: break-all;
}
