/* ywsj-showcase — 精致风格 磁贴卡片墙 */
:root {
  --bg: #0f1220;
  --bg2: #151a30;
  --card: rgba(255, 255, 255, 0.05);
  --card-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.10);
  --text: #eef0ff;
  --muted: #9aa3c7;
  --accent: #6366f1;
  --accent2: #a855f7;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --grad: linear-gradient(135deg, #6366f1, #a855f7);
}
[data-theme="light"] {
  --bg: #eef1fb;
  --bg2: #e4e9f7;
  --card: rgba(99, 102, 241, 0.06);
  --card-hover: rgba(99, 102, 241, 0.12);
  --border: rgba(99, 102, 241, 0.16);
  --text: #1e2340;
  --muted: #5a6184;
  --shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(168, 85, 247, 0.12), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(56, 189, 248, 0.10), transparent 40%);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.4s, color 0.4s;
}
a { color: inherit; text-decoration: none; }

/* ── 导航栏 ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.nav-link-item {
  padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: var(--muted); transition: all 0.2s; white-space: nowrap;
}
.nav-link-item:hover { color: var(--text); background: var(--card); }
.nav-link-item.active { color: #fff; background: var(--grad); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35); }
.nav-brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  transition: all 0.2s;
}
.icon-btn:hover { background: var(--card-hover); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

.lang-switch {
  display: flex; gap: 2px; padding: 3px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px;
}
.lang-switch button {
  border: none; background: none; cursor: pointer;
  padding: 5px 10px; border-radius: 7px;
  color: var(--muted); font-size: 13px; font-weight: 600;
  transition: all 0.2s;
}
.lang-switch button.active { background: var(--grad); color: #fff; }

/* ── Hero ── */
.hero { text-align: center; padding: 64px 24px 32px; }
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900; letter-spacing: -1px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.hero p.sub { color: var(--muted); font-size: clamp(15px, 2vw, 19px); max-width: 600px; margin: 0 auto; }
.hero .count-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 8px 18px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; font-size: 14px; color: var(--muted);
}

/* ── 首页展示图片 ── */
.hero-avatar {
  width: 110px; height: 110px; margin: 0 auto 22px; border-radius: 50%;
  padding: 4px;
  background: var(--grad);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
}
.hero-avatar img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; display: block;
  border: 3px solid var(--bg);
}

/* ── 工具条 (搜索 + 分类) ── */
.toolbar {
  position: sticky; top: 68px; z-index: 50;
  padding: 16px 32px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
}
.toolbar-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search-box {
  flex: 1; min-width: 220px; position: relative;
}
.search-box input {
  width: 100%; padding: 11px 42px 11px 38px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 14px;
  outline: none; transition: all 0.2s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: none; background: var(--card-hover); color: var(--muted);
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  display: none; align-items: center; justify-content: center; font-size: 12px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all 0.2s; user-select: none;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.chip .cnt { opacity: 0.7; font-size: 11px; margin-left: 4px; }
.chip .cnt.on { opacity: 1; color: #fff; }

/* ── 磁贴卡片墙 ── */
.wall {
  max-width: 1200px; margin: 24px auto 60px; padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.tile {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  animation: fadeUp 0.5s ease both;
}
.tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.25);
  border-color: var(--accent);
}
.tile .tile-top {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  perspective: 1000px;
  width: 100%;
  background: linear-gradient(135deg, var(--tile-color, #6366f1), transparent 70%);
}
.cover3d {
  position: absolute; inset: 0; z-index: 1;
  transform-style: preserve-3d;
  perspective: 1000px;
}
/* 有封面时 hover 翻转 (无封面则不翻转) */
.cover3d.has-cover {
  cursor: pointer;
}
.cover3d.has-cover:hover .cover-front { transform: rotateY(-180deg); }
.cover3d.has-cover:hover .cover-back { transform: rotateY(0deg); }

/* 自动轮播 (cover_auto=1): 纯 CSS 定时翻转 封面 ↔ 默认图标 */
.cover3d.auto-flip .cover-front { animation: autoFlipFront 3.4s ease-in-out var(--flip-delay, 0s) infinite; }
.cover3d.auto-flip .cover-back { animation: autoFlipBack 3.4s ease-in-out var(--flip-delay, 0s) infinite; }
@keyframes autoFlipFront {
  0%, 42% { transform: rotateY(0deg); }
  58%, 100% { transform: rotateY(-180deg); }
}
@keyframes autoFlipBack {
  0%, 42% { transform: rotateY(180deg); }
  58%, 100% { transform: rotateY(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .cover3d.auto-flip .cover-front,
  .cover3d.auto-flip .cover-back { animation: none; }
}

.cover-face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}
/* 正面 (封面图或默认图标) */
.cover-front { transform: rotateY(0deg); }
/* 背面 (默认图标 + 配色底) */
.cover-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, var(--tile-color, #6366f1), transparent 70%);
  background-color: var(--tile-color, #6366f1);
}

/* 封面图: 4:3 整个显示 */
.cover-face img {
  width: 100%; height: 100%; object-fit: cover;
  transform: rotate(var(--cover-rotate, 0deg));
  transition: opacity 0.5s ease;
}
.cover-face .tile-icon {
  font-size: 42px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transition: transform 0.3s; z-index: 1;
}
.tile:hover .cover-face .tile-icon { transform: scale(1.15) rotate(-6deg); }
.tile:hover .tile-top::before { opacity: 0.5; }
.tile .featured-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(245, 158, 11, 0.9); color: #111;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.tile .tile-body { padding: 14px 16px 18px; }
.tile h3 {
  font-size: 15px; font-weight: 700; margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .tile-desc {
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 38px;
}
.tile .tile-meta { margin-top: 12px; display: flex; align-items: center; gap: 6px; }
.tile .cat-tag {
  font-size: 11px; padding: 3px 9px; border-radius: 6px;
  background: var(--card-hover); color: var(--muted);
}
.tile .view-hint {
  margin-left: auto; font-size: 11px; color: var(--accent);
  opacity: 0; transition: opacity 0.2s; font-weight: 600;
}
.tile:hover .view-hint { opacity: 1; }

/* ── 详情弹层 ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
.modal {
  width: min(560px, 92vw); max-height: 88vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow);
  animation: modalUp 0.3s ease;
}
.modal .modal-head {
  position: sticky; top: 0; z-index: 5;
  padding: 24px 28px 16px;
  background: color-mix(in srgb, var(--bg2) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 16px;
}
.modal .modal-icon {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; overflow: hidden;
  background: linear-gradient(135deg, var(--tile-color, #6366f1), transparent 70%);
}
.modal .modal-icon.has-cover { background: none; }
.modal .modal-icon img { width: 100%; height: 100%; object-fit: cover; transform: rotate(var(--cover-rotate, 0deg)); }
.modal .modal-title { font-size: 22px; font-weight: 800; line-height: 1.3; }
.modal .modal-cat { font-size: 12px; color: var(--muted); margin-top: 4px; }
.modal .modal-close {
  margin-left: auto; border: none; background: var(--card);
  color: var(--text); width: 32px; height: 32px; border-radius: 8px;
  cursor: pointer; font-size: 18px;
}
.modal .modal-body { padding: 20px 28px 28px; }
.modal .modal-desc {
  color: var(--muted); line-height: 1.7; font-size: 14.5px;
  margin-bottom: 20px; white-space: pre-wrap;
}
.link-grid { display: flex; flex-direction: column; gap: 10px; }
.link-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font-size: 14px; font-weight: 600;
  transition: all 0.2s;
}
.link-btn:hover { background: var(--card-hover); border-color: var(--accent); transform: translateX(4px); }
.link-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.link-btn .lb-icon { font-size: 20px; width: 26px; text-align: center; }
.link-btn .lb-icon { display: flex; align-items: center; justify-content: center; }
.b-logo { width: 22px; height: 22px; display: block; flex-shrink: 0; }
.b-logo.gh { fill: var(--text); }
.link-btn .lb-arrow { margin-left: auto; color: var(--muted); }

/* ── 后台管理 ── */
.admin-wrap { max-width: 1100px; margin: 24px auto 60px; padding: 0 32px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.admin-toolbar h2 { font-size: 24px; font-weight: 800; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--card-hover); }
.btn-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; line-height: 1.2; }
.btn-xs:disabled { opacity: 0.4; cursor: not-allowed; }
.db-table-btn { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px; border-radius:8px; border:1px solid var(--border); background:var(--card); color:var(--text); cursor:pointer; font-size:14px; text-align:left; transition:all .15s; }
.db-table-btn:hover { border-color:#6366f1; }
.db-table-btn.active { background:var(--grad); color:#fff; border-color:transparent; }
.db-table-btn .cnt { font-size:12px; color:var(--muted); background:var(--card-hover); padding:2px 8px; border-radius:10px; }
.db-table-btn.active .cnt { background:rgba(255,255,255,.22); color:#fff; }
.announcement-bar { display:flex; align-items:center; gap:10px; background:linear-gradient(90deg,#f59e0b,#ef4444,#f59e0b); color:#fff; height:34px; padding:0 16px; overflow:hidden; }
.announcement-icon { flex-shrink:0; font-size:14px; }
.announcement-track { flex:1; overflow:hidden; }
.announcement-text { display:inline-block; white-space:nowrap; padding-left:100%; animation:announcement-scroll 18s linear infinite; font-size:13px; font-weight:600; }
.announcement-bar:hover .announcement-text { animation-play-state:paused; }
@keyframes announcement-scroll { 0% { transform:translateX(0); } 100% { transform:translateX(-100%); } }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead th {
  text-align: left; padding: 12px 14px; font-size: 12px; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--border); letter-spacing: 0.5px;
}
.admin-table tbody tr {
  border-bottom: 1px solid var(--border); transition: background 0.2s;
}
.admin-table tbody tr:hover { background: var(--card); }
.admin-table td { padding: 12px 14px; vertical-align: middle; }
.admin-table .proj {
  display: flex; align-items: center; gap: 10px;
}
.admin-table .proj .picon { font-size: 20px; }
.admin-table .proj .ptitle { font-weight: 600; font-size: 14px; }
.admin-table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.badge-feat { background: rgba(245, 158, 11, 0.15); color: #f59e0b; padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.link-dots { display: flex; gap: 6px; align-items: center; }
.link-dots .ldot { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--card-hover); }
.link-dots .ldot svg { width: 15px; height: 15px; }
.link-dots .ldot.gh { color: var(--text); }

/* ── 表单弹窗 ── */
.form-grid { display: grid; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font-size: 14px; outline: none; transition: all 0.2s;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; }
.checkbox-line input { width: 18px; height: 18px; accent-color: var(--accent); }
.checkbox-line span { font-size: 14px; color: var(--text); }
.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type="color"] { width: 42px; height: 40px; padding: 3px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); cursor: pointer; }
/* 图标选择器 */
.icon-pick { display: flex; gap: 6px; }
.icon-pick input { flex: 1; }
.icon-pick .btn { padding: 0 12px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto; }
.icon-cell {
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text); font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.icon-cell:hover { background: var(--card-hover); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── 后台封面配置 ── */
.cover-block {
  border: 1px dashed var(--border); border-radius: 14px; padding: 16px;
  background: var(--card); display: grid; gap: 12px;
}
.cover-label { font-size: 14px; font-weight: 700; color: var(--text); }
.cover-preview {
  width: 100%; height: 140px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cover-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 48px; color: var(--muted); }
.cover-ph img { width: 100%; height: 100%; object-fit: cover; }
.cover-controls { display: grid; gap: 12px; }
.cover-upload-row { display: flex; gap: 8px; align-items: center; }
input[type="range"] { accent-color: var(--accent); }

/* ── 登录/初始化页 ── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: min(400px, 92vw); background: var(--bg2);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 36px 32px; box-shadow: var(--shadow);
}
.auth-card .auth-logo {
  width: 56px; height: 56px; margin: 0 auto 18px;
  background: var(--grad); border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.auth-card h2 { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.auth-field input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font-size: 14px; outline: none;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
.auth-card .btn-primary { width: 100%; justify-content: center; padding: 13px; margin-top: 8px; }
.auth-err {
  background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger); padding: 10px 14px; border-radius: 10px;
  font-size: 13px; margin-bottom: 16px;
}
.auth-back { text-align: center; margin-top: 16px; font-size: 13px; }
.auth-back a { color: var(--accent); font-weight: 600; }

/* ── Toast ── */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
  color: #fff; box-shadow: var(--shadow); animation: slideIn 0.3s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { background: var(--grad); }
.toast.error { background: #dc2626; }
.toast.info { background: #0ea5e9; }

/* ── Footer ── */
.footer { text-align: center; padding: 30px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
.footer a { color: var(--accent); font-weight: 600; }
.footer .beian-links { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.footer .beian-links a { color: var(--muted); font-weight: 400; text-decoration: none; }
.footer .beian-links a:hover { color: var(--accent); text-decoration: underline; }
.footer .beian-sep { margin: 0 8px; opacity: 0.6; }

/* ── 空状态 & 加载 ── */
.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-state .big-icon { font-size: 56px; margin-bottom: 12px; opacity: 0.5; }
.loading-wall { grid-column: 1 / -1; text-align: center; padding: 60px; color: var(--muted); }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 14px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* ── VPS 推荐页 ── */
.vps-page { max-width: 1100px; margin: 0 auto 60px; padding: 8px 32px 0; display: grid; gap: 24px; }
.vps-page > * { min-width: 0; }
.vps-notice {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 10px 20px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 13.5px; max-width: 700px; line-height: 1.6;
}
.vps-provider {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; animation: fadeUp 0.5s ease both;
}
.vps-provider-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.vps-provider-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: linear-gradient(135deg, var(--tile-color, #6366f1), transparent 70%);
}
.vps-provider-info { flex: 1; min-width: 0; }
.vps-provider-info h2 { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.vps-tag {
  display: inline-block; margin-left: 8px; padding: 2px 10px; font-size: 11px; font-weight: 700;
  border-radius: 999px; background: var(--grad); color: #fff; vertical-align: middle;
}
.vps-provider-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.vps-group-title {
  font-size: 14px; font-weight: 700; color: var(--accent);
  margin: 16px 0 8px; display: flex; align-items: center; gap: 6px;
}
.vps-group-title::before { content: '▍'; color: var(--accent2); }
.vps-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
.vps-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 680px; }
.vps-table thead th {
  text-align: left; padding: 11px 14px; font-size: 12px; text-transform: uppercase;
  color: var(--muted); background: var(--card-hover); border-bottom: 1px solid var(--border);
  font-weight: 700; letter-spacing: 0.3px; white-space: nowrap;
}
.vps-table tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  color: var(--text);
}
.vps-table tbody tr:last-child td { border-bottom: none; }
.vps-table tbody tr:hover { background: var(--card-hover); }
.vps-table tbody tr.feat-row { background: rgba(99, 102, 241, 0.05); }
.vps-table .plan-name { font-weight: 700; }
.vps-table .plan-feat { margin-left: 4px; font-size: 12px; }
.vps-table .pl-price { color: #f59e0b; font-weight: 800; }
.vps-table .buy-btn {
  display: inline-block; padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  background: var(--grad); color: #fff; transition: all 0.2s; white-space: nowrap;
}
.vps-table .buy-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.4); }
.vps-no-plans { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* ── 社交媒体页 ── */
.social-page { max-width: 1100px; margin: 0 auto 60px; padding: 8px 32px 0; }
.social-page > * { min-width: 0; }
.social-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}
.social-card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 24px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-align: center; text-decoration: none;
  transition: all 0.25s; animation: fadeUp 0.5s ease both;
}
.social-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.18);
}
.soc-icon {
  width: 64px; height: 64px; border-radius: 18px; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--tile-color, #6366f1), transparent 70%);
  font-size: 30px;
}
.soc-icon img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.soc-name { font-size: 16px; font-weight: 800; }
.soc-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.soc-arrow {
  position: absolute; top: 12px; right: 14px; font-size: 14px;
  opacity: 0; transform: translate(-4px, 4px); transition: all 0.25s; color: var(--accent);
}
.social-card:hover .soc-arrow { opacity: 1; transform: none; }

/* ── 后台管理卡片 (VPS / 社交) ── */
.vps-admin-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.vps-admin-head { display: flex; align-items: center; gap: 14px; }
.vps-admin-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: linear-gradient(135deg, var(--tile-color, #6366f1), transparent 70%);
}
.vps-admin-info { flex: 1; min-width: 0; }
.vps-admin-title { font-size: 16px; font-weight: 800; }
.sort-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 7px; font-size: 12px; font-weight: 800;
  background: var(--grad); color: #fff;
}
.vps-admin-desc { color: var(--muted); font-size: 13px; margin-top: 3px; }
.vps-admin-ops { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.soc-url {
  display: inline-block; margin-top: 6px; font-size: 12px; color: var(--accent);
  text-decoration: none; word-break: break-all;
}
.soc-url:hover { text-decoration: underline; }

/* ── 联系页面 ── */
.contact-page { max-width: 1100px; margin: 0 auto 60px; padding: 8px 32px 0; display: grid; gap: 28px; }
.contact-page > * { min-width: 0; }
.contact-block { display: grid; gap: 14px; }
.contact-heading {
  font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px;
  margin-bottom: 2px;
}
.contact-heading::before { content: '▍'; color: var(--accent2); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.contact-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; transition: all 0.2s;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(99,102,241,0.14); }
.contact-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: linear-gradient(135deg, var(--tile-color, #6366f1), transparent 70%);
}
.contact-info { min-width: 0; }
.contact-info strong { display: block; font-size: 15px; margin-bottom: 4px; }
.contact-value { font-size: 13.5px; color: var(--accent); font-weight: 600; word-break: break-all; }
code.contact-value { background: var(--card-hover); padding: 4px 12px; border-radius: 7px; font-family: ui-monospace, monospace; color: var(--text); }
code.contact-value a { color: var(--accent); text-decoration: none; }
code.contact-value a:hover { text-decoration: underline; }
.contact-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qr-btn {
  padding: 4px 12px; border-radius: 7px; font-size: 12px; font-weight: 600;
  background: var(--card-hover); border: 1px solid var(--border); color: var(--accent);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.qr-btn:hover { background: var(--grad); color: #fff; border-color: transparent; }
.mini-qr { width: 22px; height: 22px; border-radius: 5px; object-fit: contain; border: 1px solid var(--border); vertical-align: middle; }
.coop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.coop-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 20px; text-align: center; transition: all 0.2s;
}
.coop-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 26px rgba(99,102,241,0.16); }
.coop-icon { font-size: 30px; margin-bottom: 10px; }
.coop-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }

/* ── 关于页面 ── */
.about-page { max-width: 900px; margin: 0 auto 60px; padding: 8px 32px 0; display: grid; gap: 28px; }
.about-page > * { min-width: 0; }
.about-block { display: grid; gap: 14px; }
.about-heading {
  font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px;
  margin-bottom: 2px;
}
.about-heading::before { content: '▍'; color: var(--accent2); }
.about-bio { color: var(--muted); font-size: 15px; }
.about-content {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; display: grid; gap: 12px;
}
.about-content p { font-size: 14.5px; line-height: 1.7; }
.about-content strong { color: var(--text); }
.about-content a { color: var(--accent); text-decoration: none; }
.about-content a:hover { text-decoration: underline; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag {
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 16px; font-size: 13.5px; font-weight: 600; transition: all 0.2s;
}
.skill-tag:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-2px); box-shadow: 0 6px 18px rgba(99,102,241,0.12);
}
.coop-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.platform-hint { color: var(--muted); font-size: 13px; }
.platform-links { display: flex; flex-wrap: wrap; gap: 10px; }
.platform-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  transition: all 0.2s; text-decoration: none;
}
.platform-chip:hover {
  border-color: var(--accent); color: #fff; background: var(--grad);
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(99,102,241,0.3);
}

@media (max-width: 640px) {
  .vps-page { padding: 8px 16px 40px; }
  .nav-links { margin: 0; }
  .contact-page { padding: 8px 16px 40px; gap: 22px; }
  .contact-grid, .coop-grid { grid-template-columns: 1fr; }
  .about-page { padding: 8px 16px 40px; gap: 22px; }
  .about-content { padding: 18px 16px; gap: 10px; }
}

/* ── 动效 ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(30px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* ── 响应式 ── */
@media (max-width: 640px) {
  .navbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  /* 手机端: 导航链接整行居中放第二行 */
  .nav-links { order: 3; flex-basis: 100%; justify-content: center; margin: 0; padding-top: 2px; flex-wrap: wrap; gap: 2px 4px; }
  .nav-link-item { padding: 6px 10px; font-size: 13px; }
  /* 压缩右侧按钮 */
  .nav-actions { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; }
  .lang-switch button { padding: 4px 8px; font-size: 12px; }
  .toolbar { padding: 12px 16px; top: 60px; }
  .hero-avatar { width: 84px; height: 84px; margin-bottom: 16px; }
  .wall { padding: 0 16px; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .admin-wrap { padding: 0 16px; }
  .field-row { grid-template-columns: 1fr; }
  .toolbar-inner { flex-direction: column; align-items: stretch; }
  /* 手机端: 后台表格横向滚动，避免 6 列溢出 */
  .tab-pane { overflow-x: auto; }
  .admin-table { min-width: 560px; }
}
/* ── TVBox 接口页 ── */
.tvbox-page { max-width: 1200px; margin: 0 auto 60px; padding: 8px 32px 0; }
.tvbox-page > * { min-width: 0; }
.tvbox-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.tvbox-search { flex: 1; min-width: 200px; position: relative; }
.tvbox-search input {
  width: 100%; padding: 11px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 14px; outline: none; transition: border 0.2s, box-shadow 0.2s;
}
.tvbox-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.tvbox-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.tv-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  cursor: pointer; transition: all 0.2s;
}
.tv-chip b { font-weight: 800; }
.tv-chip:hover { border-color: var(--accent); color: var(--text); }
.tv-chip.active {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.tv-chip.active b { color: #fff; }
.tv-check-btn {
  padding: 11px 20px; border-radius: var(--radius); border: none;
  background: var(--grad); color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.tv-check-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(99,102,241,0.4); }
.tv-check-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

.tvbox-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.tv-card {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 16px 16px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: all 0.25s; animation: fadeUp 0.5s ease both;
  overflow: hidden;
}
.tv-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--tile-color, #6366f1), transparent);
}
.tv-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(99,102,241,0.18);
}
.tv-card.ok { border-color: rgba(34,197,94,0.35); }
.tv-card.bad { border-color: rgba(239,68,68,0.35); opacity: 0.75; }
.tv-card.tv-checking { opacity: 0.6; }
.tv-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: linear-gradient(135deg, var(--tile-color, #6366f1), transparent 70%);
}
.tv-body { flex: 1; min-width: 0; padding-right: 130px; }
.tv-name {
  font-size: 15px; font-weight: 800; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-url {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 11.5px;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-pill {
  position: absolute; top: 12px; right: 50px; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.tv-pill.tv-ok { color: #22c55e; background: rgba(34,197,94,0.12); }
.tv-pill.tv-bad { color: #ef4444; background: rgba(239,68,68,0.12); }
.tv-pill.tv-unknown { color: var(--muted); background: rgba(127,127,127,0.12); }
.tv-test-btn {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); font-size: 14px; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.tv-test-btn:hover { border-color: var(--accent); background: var(--grad); color: #fff; transform: scale(1.08); }
.tv-test-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.tv-pill.tv-pill-btn { cursor: pointer; transition: all 0.2s; }
.tv-pill.tv-pill-btn:hover { filter: brightness(1.25); box-shadow: 0 0 0 2px rgba(127,127,127,0.25); transform: scale(1.05); }
.tv-pill.tv-checking { color: #f59e0b; background: rgba(245,158,11,0.12); }
.tv-blink { animation: tvBlink 1s infinite; }
@keyframes tvBlink { 50% { opacity: 0.2; } }
.tv-copy {
  position: absolute; bottom: 10px; right: 14px; font-size: 11px; font-weight: 700;
  color: var(--accent); opacity: 0; transform: translateX(4px);
  transition: all 0.25s;
}
.tv-card:hover .tv-copy { opacity: 1; transform: none; }

.tvbox-pager { margin-top: 22px; }
.tvbox-pager-in { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.tv-pg {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.tv-pg:hover { border-color: var(--accent); }
.tv-pg.cur { background: var(--grad); color: #fff; border-color: transparent; }
.tv-pg-ellipsis { color: var(--muted); padding: 0 4px; }
.tv-pg-info { color: var(--muted); font-size: 12.5px; margin-left: 10px; }

@media (max-width: 720px) {
  .tvbox-page { padding: 8px 16px 0; }
  .tvbox-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .tv-card { flex-direction: column; align-items: flex-start; padding: 14px 12px; gap: 8px; }
  .tv-url { max-width: 100%; }
  .tv-pill { position: static; align-self: flex-end; margin-top: -22px; }
  .tv-test-btn { position: static; width: 34px; height: 34px; align-self: flex-end; margin-top: -24px; margin-left: 6px; }
  .tv-copy { position: static; margin-top: 2px; opacity: 0.9; }
  .tvbox-toolbar { flex-direction: column; align-items: stretch; }
  .tvbox-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .tv-check-btn { width: 100%; }
}

/* ── TVBox 免责声明 ── */
.tvbox-disclaimer {
  margin: 0 auto 14px; max-width: 760px;
  padding: 14px 18px; border: 1px dashed var(--border); border-radius: 12px;
  background: var(--card); text-align: center;
}
.tv-disc-title { font-size: 13px; font-weight: 800; margin-bottom: 6px; color: var(--muted); }
.tv-disc-text { font-size: 12px; line-height: 1.7; color: var(--muted); }

/* ── TVBox 后台管理: 状态徽章 + 测试按钮 ── */
.tv-admin-status { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; font-weight: 700; }
.tv-admin-status .tvs-ok { color: #22c55e; }
.tv-admin-status .tvs-bad { color: #ef4444; }
.tv-admin-status .tvs-checking { color: #f59e0b; }
