/* ===== 光帧AI 网站设计系统 ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #7c3aed;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .1);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .18);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: all .18s ease; white-space: nowrap; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #6d28d9; color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* 导航 */
.navbar {
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.navbar-inner { display: flex; align-items: center; height: 64px; gap: 24px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.nav-logo img { height: 34px; width: 34px; object-fit: contain; }
.nav-logo .logo-dot { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius-sm); color: var(--text-2);
  font-weight: 500; font-size: 15px;
}
.nav-links a:hover { color: var(--text); background: #f1f5f9; }
.nav-links a.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); }

/* 主视觉 */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 50%, #eef2ff 100%);
  border-bottom: 1px solid var(--border);
  padding: 72px 0 64px; position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.12), transparent 70%);
  top: -180px; right: -100px;
}
.hero::after {
  content: ""; position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.12), transparent 70%);
  bottom: -160px; left: -80px;
}
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px; background: #fff;
  border: 1px solid var(--border); color: var(--primary); font-size: 13px; font-weight: 600; margin-bottom: 20px;
}
.hero h1 { font-size: 44px; line-height: 1.25; font-weight: 800; margin-bottom: 16px; letter-spacing: -.5px; }
.hero h1 .grad { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; color: var(--text-2); margin-bottom: 32px; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* 章节 */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; font-weight: 700; }
.section-head .sub { color: var(--text-3); font-size: 14px; margin-top: 4px; }
.section-head .more { font-size: 14px; font-weight: 600; }

/* 快速入口卡片 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; transition: all .2s ease; cursor: pointer; display: block; color: var(--text);
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); color: var(--text); }
.quick-card .ico { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.quick-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.quick-card p { font-size: 12px; color: var(--text-3); }

/* 教程卡片 */
.tutorial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tutorial-card { overflow: hidden; transition: all .2s ease; display: flex; flex-direction: column; }
.tutorial-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tutorial-card .cover { aspect-ratio: 16/9; background: #e2e8f0; overflow: hidden; position: relative; }
.tutorial-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.tutorial-card .cover .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #cbd5e1; }
.tutorial-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tutorial-card .tag { display: inline-block; font-size: 12px; color: var(--primary); background: var(--primary-light); padding: 2px 10px; border-radius: 999px; font-weight: 600; align-self: flex-start; }
.tutorial-card h3 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.tutorial-card .desc { font-size: 13px; color: var(--text-2); flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tutorial-card .meta { font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; }

/* 模型卡片 */
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.model-card { overflow: hidden; transition: all .2s ease; display: flex; flex-direction: column; }
.model-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.model-card .img { aspect-ratio: 1/1; background: #e2e8f0; overflow: hidden; position: relative; cursor: pointer; }
.model-card .img img { width: 100%; height: 100%; object-fit: cover; }
.model-card .img .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 44px; color: #cbd5e1; }
.model-card .body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.model-card h3 { font-size: 16px; font-weight: 600; }
.model-card .desc { font-size: 13px; color: var(--text-2); flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.model-card .dl-btns { display: flex; gap: 8px; }
.model-card .dl-btns .btn { flex: 1; font-size: 13px; }
.model-card .date { font-size: 12px; color: var(--text-3); }

/* 页脚 */
.footer { background: #0f172a; color: #94a3b8; padding: 48px 0 32px; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer h4 { color: #fff; font-size: 16px; margin-bottom: 12px; }
.footer a { color: #94a3b8; display: block; margin-bottom: 8px; font-size: 14px; }
.footer a:hover { color: #fff; }
.footer .copyright { border-top: 1px solid #1e293b; margin-top: 32px; padding-top: 20px; font-size: 13px; color: #64748b; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: all .2s ease; }
.modal-mask.show { opacity: 1; visibility: visible; }
.modal { background: #fff; border-radius: 16px; max-width: 420px; width: 100%; padding: 28px; text-align: center; box-shadow: var(--shadow-lg); transform: translateY(12px); transition: all .2s ease; }
.modal-mask.show .modal { transform: translateY(0); }
.modal h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal .text { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }
.modal .qr-box { width: 220px; height: 220px; margin: 0 auto 16px; background: #f1f5f9; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.modal .qr-box img { width: 100%; height: 100%; object-fit: contain; }
.modal .qr-empty { color: var(--text-3); font-size: 14px; }
.modal .modal-btns { display: flex; gap: 10px; justify-content: center; }

/* 图片预览弹窗 */
.imgview-mask { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 1100; display: none; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.imgview-mask.show { display: flex; }
.imgview-mask img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty .ico { font-size: 48px; margin-bottom: 12px; }

/* 面包屑/页头 */
.page-hero { background: linear-gradient(135deg, #eff6ff, #f5f3ff); padding: 40px 0; border-bottom: 1px solid var(--border); }
.page-hero h1 { font-size: 30px; font-weight: 800; }
.page-hero p { color: var(--text-2); margin-top: 6px; }

/* 搜索框 */
.search-bar { display: flex; gap: 10px; }
.search-bar input { flex: 1; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; outline: none; }
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* 标签 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-on { background: #dcfce7; color: #15803d; }
.badge-off { background: #fee2e2; color: #b91c1c; }
.badge-ph { background: #fef3c7; color: #b45309; }

/* 响应式 */
@media (max-width: 992px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .tutorial-grid, .model-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; background: #fff;
    flex-direction: column; padding: 12px; gap: 2px; border-bottom: 1px solid var(--border);
    display: none; box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav-actions .btn span { display: none; }
  .tutorial-grid, .model-grid, .quick-grid { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
}

/* ===== 后台专用 ===== */
.admin-body { background: #f1f5f9; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-side {
  width: 230px; background: #0f172a; color: #cbd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-side .brand { padding: 20px; font-weight: 700; font-size: 17px; color: #fff; border-bottom: 1px solid #1e293b; }
.admin-side nav { padding: 12px; flex: 1; overflow-y: auto; }
.admin-side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; color: #cbd5e1; font-size: 14px; margin-bottom: 2px; }
.admin-side nav a:hover { background: #1e293b; color: #fff; }
.admin-side nav a.active { background: var(--primary); color: #fff; }
.admin-main { flex: 1; padding: 24px; overflow-x: hidden; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-topbar h1 { font-size: 22px; font-weight: 700; }
.admin-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; box-shadow: var(--shadow); }
.admin-card + .admin-card { margin-top: 20px; }
.admin-card h2 { font-size: 17px; font-weight: 700; margin-bottom: 16px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 30px; font-weight: 800; color: var(--primary); }
.stat-card .label { color: var(--text-3); font-size: 13px; margin-top: 2px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: #f8fafc; font-weight: 600; color: var(--text-2); white-space: nowrap; }
tr:hover td { background: #fafbfc; }
td .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-group label .req { color: var(--danger); }
.form-group input[type=text], .form-group input[type=url], .form-group input[type=password],
.form-group input[type=number], .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; font-family: inherit;
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-check input { width: 16px; height: 16px; }
.img-preview { width: 120px; height: 120px; border: 1px solid var(--border); border-radius: 8px; object-fit: cover; margin-top: 8px; background: #f8fafc; }

/* flash */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.flash.success { background: #dcfce7; color: #15803d; }
.flash.error { background: #fee2e2; color: #b91c1c; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a, #1e3a8a); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 36px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-card .sub { color: var(--text-3); font-size: 14px; margin-bottom: 24px; }

@media (max-width: 768px) {
  .admin-wrap { flex-direction: column; }
  .admin-side { width: 100%; height: auto; position: static; }
  .admin-side nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-side nav a { margin-bottom: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

/* ===== 页脚免责声明 ===== */
.footer-disclaimer {
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 20px 22px;
  background: rgba(254, 242, 242, 0.5);
}
.footer-disclaimer .fd-title {
  color: #b91c1c;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.footer-disclaimer p {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.9;
  margin-bottom: 8px;
  text-align: justify;
}
.footer-disclaimer p:last-child { margin-bottom: 0; }
.footer-disclaimer p strong { color: #fca5a5; font-weight: 600; }

/* ===== 手风琴（FAQ / 教程） ===== */
.accordion { display: flex; flex-direction: column; gap: 10px; }
.acc-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.acc-item.active { border-color: var(--primary); box-shadow: var(--shadow-md); }
.acc-head {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  transition: color .2s ease;
}
.acc-head:hover { color: var(--primary); }
.acc-head .acc-title { flex: 1; }
.acc-head .acc-arrow {
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform .3s ease;
  font-size: 14px;
}
.acc-item.active .acc-arrow { transform: rotate(180deg); color: var(--primary); }
.acc-body {
  display: none;
  padding: 0 20px 18px 20px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
}
.acc-item.active .acc-body { display: block; }
.acc-body .acc-video { margin-bottom: 14px; }
.acc-body .rich-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.acc-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  margin-right: 8px;
  flex-shrink: 0;
}
