/* ===================================================================
   职课屿 · 共享设计系统 v2（明亮 · 圆角卡片 · 渐变）
   视觉参考主流在线教育平台：浅色背景 + 柔和粉紫 + 彩色渐变 banner
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* 主色 */
  --brand:   #2F6BFF;
  --brand-d: #1E4FD6;
  --brand-l: #EAF1FF;
  --coral1:  #FF7A59;
  --coral2:  #FF4D7E;
  --purple:  #7C5CFC;
  --teal:    #1FBFA6;
  --amber:   #FFB020;
  --green:   #22B07D;

  /* 中性 */
  --ink:    #1B1D2A;
  --ink-2:  #3A3D4D;
  --muted:  #6E7385;
  --faint:  #9AA0B4;
  --line:   #ECEBF3;
  --card:   #FFFFFF;
  --field:  #FBFAFF;
  --bg:     #F5F3FC;

  --radius:   18px;
  --radius-s: 12px;
  --shadow:   0 10px 30px -12px rgba(43,40,90,0.18);
  --shadow-s: 0 4px 16px -6px rgba(43,40,90,0.14);
  --shadow-h: 0 18px 40px -14px rgba(43,40,90,0.28);
}

/* 深色模式调色板 */
html.dark {
  --ink:    #E8EAF4;
  --ink-2:  #C2C7DA;
  --muted:  #8B90A6;
  --faint:  #5F6478;
  --line:   #272B3E;
  --card:   #181C2E;
  --field:  #12152180;
  --bg:     #0D0F1A;
  --brand-l: rgba(47,107,255,0.18);
  --shadow:   0 10px 30px -12px rgba(0,0,0,0.5);
  --shadow-s: 0 4px 16px -6px rgba(0,0,0,0.45);
  --shadow-h: 0 18px 40px -14px rgba(0,0,0,0.6);
}
html.dark body {
  background-image:
    radial-gradient(1200px 500px at 85% -8%, rgba(124,92,252,0.16), transparent 60%),
    radial-gradient(1000px 460px at 0% 8%, rgba(47,107,255,0.13), transparent 55%),
    radial-gradient(900px 500px at 100% 100%, rgba(255,77,126,0.10), transparent 60%);
}
html.dark .nav { background: rgba(20,23,38,0.86); }
html.dark .logo-mark::after { background: var(--card); }
html.dark .res-row.head, html.dark .trow.head { background: #1f2336 !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 85% -8%, rgba(124,92,252,0.10), transparent 60%),
    radial-gradient(1000px 460px at 0% 8%, rgba(47,107,255,0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 100%, rgba(255,77,126,0.07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.mono { font-family: 'Inter', sans-serif; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* ===== 顶部导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 32px;
  height: 66px; display: flex; align-items: center; gap: 30px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; letter-spacing: -0.02em; }
.nav-logo .logo-mark {
  width: 30px; height: 30px; border-radius: 9px; position: relative; flex: none;
  background: conic-gradient(from 200deg, var(--brand), var(--purple), var(--coral2), var(--amber), var(--brand));
}
.nav-logo .logo-mark::after {
  content: ''; position: absolute; inset: 7px; background: var(--card); border-radius: 4px;
}
.nav-logo .logo-txt { background: linear-gradient(90deg, var(--brand), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 15px; color: var(--ink-2); font-weight: 500; }
.nav-links a { position: relative; padding: 22px 0; transition: color .15s; white-space: nowrap; }
.nav-links a:hover { color: var(--brand); }
.nav-links a.active { color: var(--brand); font-weight: 700; }
.nav-links a.active::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px;
  width: 22px; height: 3px; border-radius: 3px; background: var(--brand);
}
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand-l); color: var(--brand); display: grid; place-items: center; font-size: 16px;
  transition: background .15s;
}
.icon-btn:hover { background: #dbe6ff; }

.btn {
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 20px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid transparent; transition: all 0.16s ease;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.btn-outline { background: var(--card); color: var(--brand); border-color: #cfdcff; }
.btn-outline:hover { background: var(--brand-l); }

/* 键盘可访问性：仅在键盘导航时显示高对比焦点环 */
:where(a,button,input,select,textarea,[tabindex]):focus-visible {
  outline: 3px solid #1769ff !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(255,255,255,.92), 0 0 0 8px rgba(23,105,255,.28) !important;
}
:where(a,button,input,select,textarea,[tabindex])[aria-disabled="true"]:focus-visible,
:where(button,input,select,textarea):disabled:focus-visible { outline: none !important; box-shadow: none !important; }
.btn-solid { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -8px rgba(47,107,255,0.7); }
.btn-solid:hover { background: var(--brand-d); }
.btn-coral { background: linear-gradient(120deg, var(--coral1), var(--coral2)); color: #fff; box-shadow: 0 8px 18px -8px rgba(255,77,126,0.7); }
.btn-coral:hover { filter: brightness(1.05); }
.btn-ghost { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.55); }
.btn-ghost:hover { background: rgba(255,255,255,0.28); }
.btn-sm { padding: 6px 15px; font-size: 13px; }

/* 通知铃铛 */
.bell-wrap { position: relative; }
.bell-btn { position: relative; }
.bell-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--coral2); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.bell-panel { position: absolute; top: 48px; right: 0; width: 320px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-h); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .18s, transform .18s; z-index: 200; overflow: hidden; }
.bell-panel.show { opacity: 1; transform: none; pointer-events: auto; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.bell-head a { font-size: 12.5px; color: var(--brand); cursor: pointer; font-weight: 500; }
.bell-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bell-item:hover { background: var(--bg); }
.bell-item.unread { background: rgba(47,107,255,0.05); }
.bell-item .bi-t { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.bell-item .bi-s { font-size: 12.5px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bell-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* 用户胶囊 */
.user-chip {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 5px 14px 5px 5px; border-radius: 999px; border: 1.5px solid var(--line);
  font-size: 13.5px; font-weight: 500; transition: border-color .15s, box-shadow .15s; background: var(--card);
}
.user-chip:hover { border-color: #cfdcff; box-shadow: var(--shadow-s); }
.user-chip .av {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--purple)); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}

/* ===== 通用区块 ===== */
.section { max-width: 1240px; margin: 0 auto; padding: 46px 28px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.section-title { display: flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 900; letter-spacing: -0.01em; }
.section-title .ic {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 15px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--purple));
}
.section-title.coral .ic { background: linear-gradient(135deg, var(--coral1), var(--coral2)); }
.section-title.teal .ic  { background: linear-gradient(135deg, var(--teal), #14a3d6); }
.section-title.amber .ic { background: linear-gradient(135deg, var(--amber), var(--coral1)); }
.section-more { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.section-more:hover { color: var(--brand); }
.section-sub { font-size: 14.5px; color: var(--muted); margin-top: -14px; margin-bottom: 22px; }

/* eyebrow（内页小标签） */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--brand); margin-bottom: 14px; }
.eyebrow::before { content: ''; width: 18px; height: 3px; border-radius: 3px; background: var(--brand); }

/* ===== 内页 banner ===== */
.page-banner {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(120deg, #2746c9 0%, #4f3df0 45%, #7c5cfc 100%);
}
.page-banner::before {
  content: ''; position: absolute; inset: 0; opacity: .55;
  background:
    radial-gradient(460px 300px at 88% -10%, rgba(255,255,255,0.22), transparent 60%),
    radial-gradient(380px 320px at 8% 130%, rgba(255,77,126,0.4), transparent 60%);
}
/* 细网格点缀，增加质感 */
.page-banner::after {
  content: ''; position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(120% 100% at 80% 0%, #000, transparent 75%);
  mask-image: radial-gradient(120% 100% at 80% 0%, #000, transparent 75%);
}
.page-banner .wrap { position: relative; z-index: 1; padding-top: 46px; padding-bottom: 46px; animation: bannerIn .6s cubic-bezier(.22,.61,.36,1) both; }
@keyframes bannerIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page-banner .crumb { font-size: 13.5px; color: rgba(255,255,255,0.82); margin-bottom: 14px; }
.page-banner .crumb a:hover { color: #fff; text-decoration: underline; }
.page-banner h1 { font-size: 34px; font-weight: 900; letter-spacing: -0.01em; margin-bottom: 12px; }
.page-banner p { font-size: 15px; color: rgba(255,255,255,0.86); line-height: 1.75; max-width: 600px; }

/* ===== 通用：内页内容容器 ===== */
.page-wrap { max-width: 1240px; margin: 0 auto; padding: 28px; }
@media (max-width: 880px) { .page-wrap { padding: 22px 18px; } }

/* ===== 加载态 / 空状态 / 骨架屏 ===== */
.zk-loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 132px; padding: 28px 20px; color: var(--muted); font-size: 14px; }
.zk-spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: zkspin .8s linear infinite; }
@keyframes zkspin { to { transform: rotate(360deg); } }
.zk-empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 56px 24px; text-align: center; color: var(--muted); }
.zk-empty .ico { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px; display: grid; place-items: center; font-size: 26px; background: var(--brand-l); color: var(--brand); }
.zk-empty .et { font-size: 15.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.zk-empty a { color: var(--brand); }
.zk-error { display:flex; align-items:flex-start; gap:12px; max-width:680px; margin:20px auto; padding:18px 20px; border:1px solid rgba(255,77,126,.22); border-radius:12px; background:rgba(255,77,126,.055); color:var(--ink-2); line-height:1.7; }
.zk-error .ico { width:30px; height:30px; flex:none; display:grid; place-items:center; border-radius:9px; background:rgba(255,77,126,.13); color:var(--coral2); font-weight:800; }
.zk-error b { display:block; color:var(--ink); margin-bottom:2px; }
.zk-error .retry { margin-top:9px; color:var(--brand); font:inherit; font-size:13px; font-weight:700; border:0; background:transparent; padding:0; cursor:pointer; }
.zk-state-row { display:flex !important; align-items:center; justify-content:center; min-height:112px; padding:22px !important; text-align:center; line-height:1.7; color:var(--muted); background:var(--card); }
.zk-state-row > span { display:block; max-width:560px; }
.zk-state-row b { display:block; color:var(--ink-2); font-size:14px; }
.zk-state-row small { display:block; margin-top:2px; color:var(--muted); font-size:12.5px; }
.zk-state-row.is-loading::before { content:''; width:18px; height:18px; margin-right:10px; border:2px solid var(--line); border-top-color:var(--brand); border-radius:50%; animation:zkspin .8s linear infinite; }
.zk-state-row.is-empty::before { content:'◌'; display:grid; place-items:center; width:28px; height:28px; margin-right:9px; border-radius:9px; color:var(--brand); background:var(--brand-l); font-size:17px; }
.zk-state-row.is-error { color:#b84562; background:rgba(255,77,126,.04); }
.zk-state-row.is-error::before { content:'!'; display:grid; place-items:center; width:26px; height:26px; margin-right:9px; border-radius:8px; color:var(--coral2); background:rgba(255,77,126,.12); font-weight:800; }
.zk-action:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline:3px solid rgba(47,107,255,.28); outline-offset:2px; }
button:disabled, .zk-action[aria-disabled="true"] { cursor:not-allowed; opacity:.58; }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; transition-duration:.01ms !important; } }
@media (max-width:640px) { .zk-empty { padding:38px 18px; } .zk-state-row { min-height:94px; padding:18px !important; font-size:13px; } }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f6f6fa 37%, #eee 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 10px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-card { height: 232px; border-radius: var(--radius); }

/* ===== 课程卡片 ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(266px, 1fr)); gap: 22px; }
.course-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-s); border: 1px solid var(--line);
  display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-h); }
.course-cover { height: 152px; position: relative; background-size: cover; background-position: center; }
.course-cover .ov {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 21px; color: rgba(255,255,255,0.92);
  letter-spacing: 0.02em; text-align: center; padding: 0 18px; line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.course-cover .tag-cat {
  position: absolute; top: 12px; left: 12px; font-size: 11.5px; font-weight: 600;
  background: rgba(255,255,255,0.92); color: var(--ink-2); padding: 4px 10px; border-radius: 999px;
}
.course-cover .tag-hot {
  position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, var(--coral1), var(--coral2)); padding: 4px 10px; border-radius: 999px;
}
.course-body { padding: 16px 17px 17px; display: flex; flex-direction: column; flex: 1; }
.course-body h3 { font-size: 16.5px; font-weight: 700; line-height: 1.4; margin-bottom: 9px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-body .meta-line { font-size: 13px; color: var(--muted); margin-bottom: 13px; display: flex; align-items: center; gap: 7px; }
.course-body .meta-line .dot { width: 3px; height: 3px; background: var(--faint); border-radius: 50%; }
.course-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.course-foot .enroll { color: var(--coral2); font-weight: 700; }

.progress { height: 6px; border-radius: 999px; background: var(--line); width: 100%; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--purple)); }

/* ===== 筛选/搜索 ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.chip {
  font-size: 13.5px; padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: all .15s;
  color: var(--muted); background: var(--card); border: 1px solid var(--line);
}
.chip:hover { color: var(--brand); border-color: #cfdcff; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 6px 14px -7px rgba(47,107,255,0.8); }
.search-box {
  display: flex; align-items: center; gap: 8px; margin-left: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
}
.search-box input { border: none; outline: none; background: none; font-size: 14px; width: 210px; color: var(--ink); font-family: inherit; }
.search-box .ico { color: var(--faint); }
.result-count { font-size: 14px; color: var(--muted); }

/* ===== 数据卡 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-s); border: 1px solid var(--line); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%; background: var(--brand-l); opacity: .6; }
.stat-card .k { font-size: 13px; color: var(--muted); margin-bottom: 10px; position: relative; }
.stat-card .v { font-family: 'Inter', sans-serif; font-size: 30px; font-weight: 800; color: var(--ink); position: relative; }
.stat-card .v .unit { font-size: 14px; color: var(--muted); margin-left: 4px; font-weight: 600; }
.stat-card .sub { font-size: 12.5px; color: var(--green); margin-top: 6px; position: relative; }

/* ===== 面板/列表 ===== */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-s); border: 1px solid var(--line); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 16px; font-weight: 700; }
.panel-head a { font-size: 13px; color: var(--brand); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-row:last-child { border-bottom: none; }
.list-row .ri { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; background: linear-gradient(135deg, var(--brand), var(--purple)); }
.list-row .rt { flex: 1; }
.list-row .rt .t { font-weight: 600; margin-bottom: 2px; }
.list-row .rt .s { font-size: 12.5px; color: var(--muted); }

.badge { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; color: var(--muted); background: var(--bg); }
.badge.amber { background: rgba(255,176,32,0.16); color: #b9791a; }
.badge.ok { background: rgba(34,176,125,0.14); color: var(--green); }
.badge.navy { background: var(--brand-l); color: var(--brand); }

/* ===== Footer ===== */
footer { margin-top: 40px; background: #161726; color: #9aa0b8; }
footer .f-inner { max-width: 1240px; margin: 0 auto; padding: 48px 28px 26px; display: grid; grid-template-columns: minmax(230px,1fr) minmax(520px,1.65fr); gap: 54px 70px; }
footer .nav-logo { color: #fff; font-size: 18px; }
footer .nav-logo .logo-txt { color: #fff; -webkit-text-fill-color: #fff; }
footer .f-brand p { max-width: 300px; margin-top: 16px; font-size: 13.5px; line-height: 1.8; }
footer .f-nav { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
footer .f-col { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
footer .f-col b { color: #fff; font-size: 14px; margin-bottom: 3px; }
footer .f-col a { width: fit-content; transition: color .18s, transform .18s; }
footer .f-col a:hover { color: #fff; transform: translateX(3px); }
footer .f-copy { grid-column: 1/-1; font-size: 12.5px; color: #6b7088; display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; border-top: 1px solid #262838; }
footer .f-copy a:hover { color: #aeb4ca; }
@media (max-width: 760px) {
  footer .f-inner { grid-template-columns: 1fr; gap: 32px; padding: 38px 20px 24px; }
  footer .f-nav { grid-template-columns: repeat(2,1fr); gap: 28px 20px; }
  footer .f-copy { flex-direction: column; }
}

/* ===== toast ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 999;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================================================================
   动效系统（滚动渐显 / 视差 / 极光 / 玻璃卡 / 跑马灯 / 光泽）
   =================================================================== */

/* 滚动渐显 */
[data-reveal] { opacity: 0; transform: translateY(30px); transition: opacity .75s cubic-bezier(.22,.61,.36,1), transform .75s cubic-bezier(.22,.61,.36,1); will-change: opacity, transform; }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal].r-scale { transform: translateY(30px) scale(.94); }
[data-reveal].r-scale.in { transform: none; }
[data-reveal].r-left { transform: translateX(-36px); }
[data-reveal].r-left.in { transform: none; }
[data-reveal].r-right { transform: translateX(36px); }
[data-reveal].r-right.in { transform: none; }
[data-reveal-delay="1"] { transition-delay: .07s; }
[data-reveal-delay="2"] { transition-delay: .14s; }
[data-reveal-delay="3"] { transition-delay: .21s; }
[data-reveal-delay="4"] { transition-delay: .28s; }
[data-reveal-delay="5"] { transition-delay: .35s; }
[data-reveal-delay="6"] { transition-delay: .42s; }

/* 跑马灯 */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 18px; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 玻璃卡 */
.glass { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.28); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* 漂浮 */
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
.floaty { animation: floatY 6s ease-in-out infinite; }

/* 光泽扫过 */
.shine { position: relative; overflow: hidden; }
.shine::after { content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.45), transparent); transform: skewX(-18deg); transition: left .7s ease; }
.shine:hover::after { left: 130%; }

/* 渐变文字流光 */
.flow-text { background: linear-gradient(90deg, var(--brand), var(--purple), var(--coral2), var(--brand)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 6s linear infinite; }
@keyframes flow { to { background-position: 300% 0; } }

/* 轻微脉冲 */
@keyframes pulseSoft { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .marquee-track, .floaty, .flow-text { animation: none !important; }
}

/* ===== 知识树 ===== */
.kg-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 13.5px; }
.kg-tree .kg-root { display: inline-block; font-size: 15px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--purple)); padding: 9px 18px; border-radius: 10px; margin-bottom: 14px; }
.kg-tree ul { list-style: none; padding-left: 14px; }
.kg-tree > ul > li { position: relative; padding-left: 20px; margin-bottom: 14px; border-left: 2px solid var(--line); }
.kg-tree > ul > li:last-child { border-left: 2px solid transparent; }
.kg-tree > ul > li::before { content: ''; position: absolute; left: -2px; top: 14px; width: 18px; height: 2px; background: var(--line); }
.kg-tree .kg-node { display: inline-block; font-size: 14.5px; font-weight: 700; color: var(--ink); padding: 7px 14px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--kc, var(--brand)); }
.kg-tree .kg-points { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.kg-tree .kg-pt { font-size: 12.5px; color: var(--kc, var(--brand)); background: color-mix(in srgb, var(--kc, var(--brand)) 12%, #fff); padding: 4px 11px; border-radius: 999px; }

/* ===== 交互式知识图谱 ===== */
.kgi { user-select: none; touch-action: none; }
.kgi-node { position: absolute; transform: translate(-50%, -50%); cursor: grab; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; transition: opacity .2s, box-shadow .2s, transform .05s; }
.kgi-node.kgi-course { background: linear-gradient(135deg, var(--brand), var(--purple)); color: #fff; font-weight: 800; font-size: 14px; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 3; }
.kgi-node.kgi-chapter { background: var(--card); color: var(--ink); border: 2px solid var(--kc, var(--brand)); padding: 8px 14px; border-radius: 10px; box-shadow: var(--shadow-s); z-index: 2; }
.kgi-node.kgi-point { background: color-mix(in srgb, var(--kc, var(--brand)) 14%, var(--card)); color: var(--kc, var(--brand)); padding: 5px 12px; border-radius: 999px; z-index: 1; }
.kgi-node.dim { opacity: 0.18; }
.kgi-node.hl { box-shadow: 0 0 0 4px color-mix(in srgb, var(--kc, var(--brand)) 30%, transparent); transform: translate(-50%, -50%) scale(1.06); }
.kgi-hint { position: absolute; right: 12px; bottom: 8px; font-size: 11.5px; color: var(--faint); pointer-events: none; }

/* ===================================================================
   AI 学习助教（浮动组件，ai.js）
   =================================================================== */
#zk-ai-fab { position: fixed; right: 24px; bottom: 24px; z-index: 900; }
.zk-ai-fab-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: none;
  background: linear-gradient(120deg, var(--brand), var(--purple), var(--coral2)); background-size: 220% 100%;
  color: #fff; font-family: inherit; font-size: 14.5px; font-weight: 700; padding: 13px 20px; border-radius: 999px;
  box-shadow: 0 12px 28px -10px rgba(47,107,255,0.8);
  animation: zkFabFloat 3.6s ease-in-out infinite, zkFabSheen 6s linear infinite;
  transition: transform .15s, box-shadow .15s;
}
/* 外发光脉冲环 */
.zk-ai-fab-btn::before {
  content: ''; position: absolute; inset: 0; border-radius: 999px; z-index: -1;
  background: linear-gradient(120deg, var(--brand), var(--purple));
  animation: zkFabPulse 2.4s ease-out infinite;
}
.zk-ai-fab-btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 18px 38px -10px rgba(124,92,252,0.95); }
.zk-ai-fab-btn .zk-ai-spark { display: inline-block; font-size: 17px; animation: zkSpark 2.6s ease-in-out infinite; }
@keyframes zkFabFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes zkFabPulse { 0% { transform: scale(1); opacity: .55; } 70% { transform: scale(1.4); opacity: 0; } 100% { opacity: 0; } }
@keyframes zkFabSheen { 0% { background-position: 0% 0; } 100% { background-position: 220% 0; } }
@keyframes zkSpark { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.25) rotate(12deg); } 50% { transform: scale(.95) rotate(-8deg); } }
/* 面板展开时收起吸引注意的动效 */
.zk-ai-panel.show + .zk-ai-fab-btn { animation: none; }
.zk-ai-panel.show + .zk-ai-fab-btn::before { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .zk-ai-fab-btn, .zk-ai-fab-btn .zk-ai-spark { animation: none !important; }
  .zk-ai-fab-btn::before { animation: none !important; opacity: 0 !important; }
}
.zk-ai-panel {
  position: absolute; right: 0; bottom: 64px; width: 380px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100vh - 130px);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-h);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none; transition: opacity .2s, transform .2s;
}
.zk-ai-panel.show { opacity: 1; transform: none; pointer-events: auto; }
.zk-ai-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; color: #fff; background: linear-gradient(120deg, #2746c9, #7c5cfc); }
.zk-ai-title { display: flex; align-items: center; gap: 10px; }
.zk-ai-ava { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: rgba(255,255,255,0.2); }
.zk-ai-title .t { font-size: 15px; font-weight: 700; }
.zk-ai-title .s { font-size: 11.5px; color: rgba(255,255,255,0.8); }
.zk-ai-x { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; opacity: .85; }
.zk-ai-x:hover { opacity: 1; }
.zk-ai-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg); }
.zk-ai-msg { display: flex; margin-bottom: 12px; }
.zk-ai-msg.me { justify-content: flex-end; }
.zk-ai-bubble { max-width: 86%; padding: 10px 13px; border-radius: 13px; font-size: 13.8px; line-height: 1.65; color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.zk-ai-msg.me .zk-ai-bubble { background: var(--brand); color: #fff; border-color: var(--brand); }
.zk-ai-bubble b { font-weight: 700; }
.zk-ai-ol, .zk-ai-ul { margin: 8px 0 2px; padding-left: 20px; }
.zk-ai-ol li, .zk-ai-ul li { margin-bottom: 5px; }
.zk-ai-tip { margin-top: 9px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 7px; }
.zk-ai-q { margin: 10px 0; padding: 10px 12px; background: var(--field); border: 1px solid var(--line); border-radius: 10px; }
.zk-ai-qh { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.zk-ai-opts { font-size: 13px; color: var(--ink-2); }
.zk-ai-opts div { padding: 2px 0; }
.zk-ai-q details { margin-top: 6px; font-size: 13px; }
.zk-ai-q summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.zk-ai-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 0; }
.zk-ai-chip { font-size: 12.5px; color: var(--brand); background: var(--brand-l); border: 1px solid #cfdcff; border-radius: 999px; padding: 6px 13px; cursor: pointer; font-family: inherit; transition: background .12s; }
.zk-ai-chip:hover { background: #dbe6ff; }
.zk-ai-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.zk-ai-input input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 10px 15px; font-family: inherit; font-size: 14px; outline: none; background: var(--field); color: var(--ink); }
.zk-ai-input input:focus { border-color: var(--brand); }
.zk-ai-input button { border: none; background: var(--brand); color: #fff; font-family: inherit; font-weight: 600; font-size: 14px; padding: 0 18px; border-radius: 999px; cursor: pointer; }
.zk-ai-input button:hover { background: var(--brand-d); }
.zk-ai-typing { display: inline-flex; gap: 4px; align-items: center; }
.zk-ai-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: zkTyping 1s infinite ease-in-out; }
.zk-ai-typing span:nth-child(2) { animation-delay: .15s; }
.zk-ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes zkTyping { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 560px) {
  #zk-ai-fab { right: 14px; bottom: 14px; }
  .zk-ai-fab-btn .zk-ai-lbl { display: none; }
  .zk-ai-fab-btn { padding: 14px; font-size: 18px; }
}

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .nav-links { display: none; }
}
@media (max-width: 880px) {
  .nav-inner { padding: 0 18px; }
  .wrap { padding: 0 18px; }
  .section { padding: 36px 18px; }
  .page-banner h1 { font-size: 26px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 20px; }
  .search-box { margin-left: 0; width: 100%; }
  .search-box input { width: 100%; }
}
@media (max-width: 480px) {
  .nav-inner { padding: 0 12px; gap: 8px; }
  .nav-inner > .nav-logo .logo-txt { display: none; }
  .nav-actions { gap: 8px; }
  .nav-actions > .icon-btn { display: none; }
  .nav-actions .btn { padding: 8px 14px; }
}
