/* ============================================================
   老林说 AIPPT · LLS & AIPPT — 麦肯锡风视觉规范
   主色深蓝 #052D49 / 强调亮蓝 #1A56DB / 浅灰底 #F5F7FA / 白底留白
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --panel: #ffffff;
  --panel-2: #eef2f7;
  --line: #e3e9f0;
  --text: #1f2937;
  --muted: #64748b;
  --accent: #052D49;
  --accent-2: #1A56DB;
  --gold: #b45309;
  --danger: #dc2626;
  --ok: #059669;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); cursor: pointer; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 顶部导航（麦肯锡式：深蓝横幅 + 浅灰导航条 双色带） ---------- */
.topbar { position: static; box-shadow: 0 2px 12px rgba(5,45,73,.10); }
.topbar-band { background: var(--accent); }
.topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 0 20px; height: 176px; }
.brand { display: flex; align-items: center; gap: 14px; cursor: pointer; user-select: none; }
.brand-logo { width: 152px; height: 152px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 10px rgba(0,0,0,.25); flex-shrink: 0; }
.brand-mark { font-size: 23px; font-weight: 700; color: #F0F0F0; letter-spacing: .5px; font-family: Georgia, "Times New Roman", "Songti SC", serif; }
.brand-mark .amp { color: #9FC0E8; margin: 0 2px; }
.main-nav { display: flex; gap: 2px; flex: 1; height: 100%; }
.main-nav a { display: flex; align-items: center; padding: 0 18px; color: #333; text-decoration: none; font-size: 16px; border-bottom: 3px solid transparent; transition: color .15s, border-color .15s; }
.main-nav a:hover { color: #111; border-bottom-color: #c0c8d0; }
.main-nav a.active { color: #111; font-weight: 700; border-bottom-color: #111; }
.user-area { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.top-link { color: rgba(255,255,255,.88); font-size: 14px; text-decoration: none; border-bottom: 1px solid transparent; }
.top-link:hover { border-bottom-color: #fff; color: #fff; }
#user-name { color: rgba(255,255,255,.70); font-size: 13px; }
.topbar .btn-ghost { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.32); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.20); border-color: #fff; color: #fff; }
.nav-band { background: #F0F2F5; border-bottom: 1px solid var(--line); }
.nav-band .main-nav { max-width: 1200px; margin: 0 auto; height: 46px; align-items: stretch; padding: 0 20px; }

main { max-width: 1200px; margin: 0 auto; padding: 44px 20px 72px; }
.page h2 { font-size: 30px; color: var(--accent); margin-bottom: 22px; font-weight: 800; letter-spacing: .3px; }

.hidden { display: none !important; }

/* ---------- 按钮 ---------- */
.btn { border: none; border-radius: 4px; padding: 9px 20px; font-size: 14px; transition: .15s; font-weight: 600; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0a3d5c; box-shadow: 0 4px 14px rgba(5,45,73,.25); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: rgba(220,38,38,.06); }

/* ---------- 首页 Hero（麦肯锡式大字标题） ---------- */
.hero { text-align: center; padding: 56px 0 44px; }
.hero h1 { font-size: 42px; line-height: 1.3; color: var(--accent); font-weight: 800; letter-spacing: .3px; }
.hero-sasa-en { color: var(--muted); font-size: 15px; letter-spacing: 1.5px; margin: 10px auto 0; text-transform: uppercase; }
.hero-sub { color: var(--muted); margin: 14px auto 32px; max-width: 760px; font-size: 16px; }
.hero-sub b { color: var(--accent-2); font-weight: 800; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.feature-card, .course-card, .step-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 24px; box-shadow: 0 1px 2px rgba(5,45,73,.04); }
.feature-card h3, .course-card h3, .step-card h3 { margin-bottom: 8px; font-size: 17px; color: var(--accent); font-weight: 700; }
.feature-card p, .course-card p, .step-card p { color: var(--muted); font-size: 14px; }

/* ---------- 公式页 ---------- */
.formula-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.step-card { border-top: 3px solid var(--accent); }
.step-no { color: var(--accent-2); font-weight: 800; font-size: 13px; letter-spacing: 1px; }

/* ---------- 课程页 ---------- */
.course-list { display: grid; gap: 14px; max-width: 720px; }
.course-card { position: relative; }
.tag { position: absolute; top: 14px; right: 14px; background: var(--bg-soft); color: var(--accent-2); font-size: 12px; border-radius: 20px; padding: 3px 10px; }

/* ---------- 工作台 ---------- */
.studio-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(5,45,73,.04); }
.panel label { display: block; font-size: 14px; color: var(--accent); margin-bottom: 8px; font-weight: 700; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel-head label { margin-bottom: 0; }
.panel h3 { font-size: 16px; margin-bottom: 8px; color: var(--accent); }
input, textarea, select { width: 100%; background: #fff; border: 1px solid var(--line); color: var(--text); border-radius: 4px; padding: 9px 12px; font-size: 14px; font-family: inherit; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(26,86,219,.08); }
.chat-input-row { display: flex; gap: 8px; margin-top: 8px; }
.chat-input-row input { flex: 1; }
.chat-input-row .btn { white-space: nowrap; }
.chat-box { background: var(--bg-soft); border-radius: 4px; padding: 12px; min-height: 90px; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 4px; font-size: 14px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--text); }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* ---------- 三步进度条 ---------- */
.step-progress { display: flex; align-items: center; gap: 0; }
.step-item { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.step-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.step-item.active .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-item.active .step-label { color: var(--accent); font-weight: 700; }
.step-item.done .step-dot { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.step-item.done .step-label { color: var(--accent-2); }
.step-line { flex: 1; height: 2px; background: var(--line); margin: 0 8px; min-width: 18px; }
.step-line.done { background: var(--accent-2); }

.preview-box { display: flex; flex-direction: column; gap: 10px; }
.preview-box .empty { color: var(--muted); text-align: center; padding: 40px 0; }
.slide-card { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; padding: 12px; }
.slide-card .slide-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; flex-wrap: wrap; }
.slide-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.slide-card .slide-no { color: var(--muted); font-size: 12px; }
/* 页名可编辑：默认融入标题行，hover/focus 时显示可编辑态 */
.slide-card .page-name {
  border: none; border-bottom: 1px dashed transparent; background: transparent;
  font-size: 12px; color: var(--text, #333); padding: 0 2px; max-width: 180px;
  outline: none; transition: border-color .15s, background .15s;
}
.slide-card .page-name:hover { border-bottom-color: var(--muted, #999); }
.slide-card .page-name:focus { border-bottom-color: var(--accent, #2563eb); background: #fff; }
.slide-edit { display: flex; flex-direction: column; gap: 4px; }
.slide-edit label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.slide-edit textarea { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font-size: 13px; line-height: 1.5; }
.slide-edit textarea:focus { border-color: var(--accent-2); outline: none; }
.slide-edit .edit-title { font-weight: 700; }
.slide-lib-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.slide-lib-row label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.slide-lib-row select { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; font-size: 12px; max-width: 340px; color: var(--text); }
.slide-lib-row select:focus { border-color: var(--accent-2); outline: none; }
.tpl-tag { background: var(--bg-soft); color: var(--accent-2); font-size: 11px; border-radius: 12px; padding: 2px 8px; }
.tpl-tag.miss { color: var(--danger); }

/* ---------- 点数页 ---------- */
.points-balance { display: flex; align-items: baseline; gap: 10px; background: var(--accent); border-radius: 4px; padding: 26px 28px; margin-bottom: 16px; color: #fff; }
.points-balance span { color: rgba(255,255,255,.72); }
.points-balance strong { font-size: 40px; color: #fff; }

/* ---------- 管理页 ---------- */
.admin-tabs { display: flex; gap: 2px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { background: transparent; border: none; border-bottom: 3px solid transparent; color: var(--muted); border-radius: 0; padding: 10px 18px; font-size: 14px; font-weight: 600; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.toolbar input { flex: 1; }
.toolbar select { width: 160px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 9px 6px; text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-weight: 600; }
.data-table td .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn { background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); border-radius: 4px; padding: 3px 8px; font-size: 12px; }
.mini-btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
.mini-btn.danger { color: var(--danger); border-color: rgba(220,38,38,.4); }

.role-badge { background: var(--accent); color: #fff; font-size: 12px; border-radius: 20px; padding: 3px 10px; vertical-align: middle; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(5,45,73,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-box { width: 380px; max-width: 92vw; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 24px 64px rgba(5,45,73,.28); }
.modal-wide { width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { color: var(--accent); font-size: 17px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; }
.modal-close:hover { color: var(--accent); }
.modal-body { padding: 20px; }
.auth-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.link { color: var(--accent-2); font-size: 13px; cursor: pointer; }

/* ---------- 介绍弹窗（账号简介 + 网站功能） ---------- */
.modal-wide { width: 720px; }
.about-hero { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; }
.about-logo { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); box-shadow: 0 4px 16px rgba(5,45,73,.18); flex-shrink: 0; }
.about-info { flex: 1; min-width: 0; }
.about-account { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.about-account b { color: var(--accent); font-size: 20px; }
.about-account span { color: var(--muted); font-size: 13px; }
.about-intro { margin-top: 8px; line-height: 1.8; color: var(--text); font-size: 14px; }
.about-intro .intro-line { position: relative; padding-left: 14px; }
.about-intro .intro-line::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
.about-slogan { margin-top: 10px; display: inline-block; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; border-radius: 20px; padding: 5px 14px; }
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.about-stat { border: 1px solid var(--line); border-radius: 4px; padding: 12px 10px; text-align: center; background: var(--bg-soft); }
.about-stat b { display: block; color: var(--accent); font-size: 19px; }
.about-stat span { color: var(--muted); font-size: 12px; }
.about-sec { color: var(--accent); font-size: 14px; margin: 16px 0 10px; padding-left: 10px; border-left: 3px solid var(--accent-2); }
.sasa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sasa-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; }
.sasa-key { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.sasa-item b { color: var(--accent); font-size: 14px; }
.sasa-item p { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.5; }
.about-functions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.about-functions li { display: flex; gap: 10px; align-items: baseline; color: var(--text); font-size: 14px; }
.about-functions li::before { content: "✓"; color: var(--accent-2); font-weight: 800; flex-shrink: 0; }

/* ---------- 管理面板表单 ---------- */
.admin-pane label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
.admin-pane textarea { width: 100%; box-sizing: border-box; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; font-size: 13px; line-height: 1.6; font-family: inherit; }
.admin-pane textarea:focus { border-color: var(--accent-2); outline: none; }

/* ---------- 联系弹窗 ---------- */
.contact-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 10px; }
.contact-label { width: 48px; color: var(--muted); font-size: 13px; }
.contact-value { color: var(--accent); font-weight: 700; font-size: 15px; }

/* ---------- 页脚（每页固定） ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--accent); color: rgba(255,255,255,.82); margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 28px 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: rgba(255,255,255,.82); font-size: 13px; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.62); }
.footer-version { display: inline-block; margin-left: 8px; padding: 1px 8px; border: 1px solid rgba(255,255,255,.35); border-radius: 10px; font-size: 11px; color: rgba(255,255,255,.8); vertical-align: 1px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 10px 22px; border-radius: 4px; z-index: 200; box-shadow: 0 6px 24px rgba(5,45,73,.35); }
.toast.err { background: var(--danger); }

@media (max-width: 900px) {
  .studio-layout, .feature-grid { grid-template-columns: 1fr; }
  .main-nav a { padding: 0 8px; font-size: 13px; }
  .topbar-inner { gap: 12px; padding: 0 12px; }
  .nav-band .main-nav { padding: 0 8px; }
  .nav-band .main-nav a { font-size: 14px; padding: 0 12px; white-space: nowrap; }
  .hero h1 { font-size: 30px; }
  .user-area { gap: 8px; }
}

/* ---------- 版式/图标 缩略图下拉（网格缩略图 + hover 大图） ---------- */
.libpick { position: relative; display: inline-flex; flex: 1 1 260px; max-width: 340px; min-width: 200px; }
.libpick-btn { display: inline-flex; align-items: center; gap: 6px; width: 100%; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; font-size: 12px; color: var(--text); cursor: pointer; text-align: left; font-family: inherit; line-height: 1.4; }
.libpick-btn:hover { border-color: var(--accent-2); }
.libpick-btn .lpb-thumb { width: 38px; height: 21px; object-fit: cover; border-radius: 2px; border: 1px solid var(--line); background: #fff; flex: none; }
.libpick-btn .lpb-ph { width: 38px; height: 21px; border-radius: 2px; border: 1px dashed var(--line); background: #fff; flex: none; }
.libpick-btn .lpb-label { flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.libpick-btn .lpb-caret { color: var(--muted); flex: none; font-size: 10px; }
.libpick-panel { display: none; position: absolute; left: 0; top: calc(100% + 5px); z-index: 90; width: 496px; max-width: 92vw; max-height: 380px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 36px rgba(15,23,42,.18); padding: 8px; }
.libpick.flip .libpick-panel { left: auto; right: 0; }
.libpick.up .libpick-panel { top: auto; bottom: calc(100% + 5px); }
.libpick.open .libpick-panel { display: block; }
.libpick.open .libpick-btn { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(26,86,219,.08); }
.libpick-filter { margin: 0 0 6px !important; padding: 5px 8px !important; font-size: 12px !important; }
.libgrp { font-size: 11px; font-weight: 600; color: var(--muted); margin: 8px 2px 4px; }
.libopt { display: inline-block; vertical-align: top; width: calc(25% - 8px); margin: 4px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer; background: #fff; transition: border-color .12s, box-shadow .12s, transform .12s; }
.libopt:hover { border-color: var(--accent-2); box-shadow: 0 4px 14px rgba(26,86,219,.16); transform: translateY(-1px); }
.libopt.sel { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(26,86,219,.28); }
@keyframes liboptSelPulse { 0% { box-shadow: 0 0 0 5px rgba(26,86,219,.5); background: rgba(218,232,247,.95); } 100% { box-shadow: 0 0 0 2px rgba(26,86,219,.28); background: #fff; } }
.libopt.sel-pulse { animation: liboptSelPulse 1.1s ease-out 1; }
.libopt img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-soft); }
.libopt .libopt-ph { width: 100%; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); color: var(--muted); font-size: 18px; }
.libopt-cap { display: block; padding: 3px 5px; font-size: 10.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#libpreview { position: fixed; z-index: 999; display: none; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 16px 40px rgba(15,23,42,.28); padding: 8px; }
#libpreview img { display: block; width: 454px; max-width: 46vw; border-radius: 4px; border: 1px solid var(--line); background: var(--bg-soft); }
#libpreview .libpv-cap { padding: 6px 2px 2px; font-size: 12px; font-weight: 600; color: var(--text); max-width: 454px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 640px) {
  .libopt { width: calc(33.333% - 8px); }
  .libpick-panel { width: 340px; }
}
