:root{
  --bg0:#0b1020;
  --bg1:#121a2e;
  --card:#171f33;
  --border:rgba(255,255,255,.10);
  --text:#e9eeff;
  --muted:rgba(233,238,255,.72);
  --accent:#3d8bfd;
  --accent2:#2a6fd6;
  --shadow:0 18px 50px rgba(0,0,0,.35);
  --r:14px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(1000px 500px at 20% -10%, rgba(61,139,253,.18), transparent),
    radial-gradient(800px 400px at 100% 0%, rgba(61,139,253,.10), transparent),
    linear-gradient(165deg, var(--bg0), var(--bg1));
}

a{color:inherit; text-decoration:none}
.hidden{display:none !important;}
.muted{color:var(--muted)}

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  background:rgba(10,14,28,.72);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.08);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.brand__logo{
  width:auto;
  min-width:34px;
  height:34px;
  padding:0 7px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight:900;
  font-size:13px;
  letter-spacing:.04em;
  line-height:1;
  flex:0 0 auto;
  overflow:hidden;
  white-space:nowrap;
}
.brand__logo img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  border-radius:11px;
}

.brand__name{
  font-weight:900;
  letter-spacing:.02em;
  font-size:1.02rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.auth-links{
  display:flex;
  gap:10px;
  flex-shrink:0;
}
.link-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:34px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  font-weight:800;
  font-size:.92rem;
}
.link-btn--primary{
  border-color:rgba(61,139,253,.55);
  background:linear-gradient(135deg,var(--accent),var(--accent2));
}

button.link-btn{
  cursor:pointer;
  font:inherit;
  color:inherit;
}

.auth-links__user{
  display:inline-flex;
  align-items:center;
  align-self:center;
  max-width:min(200px,36vw);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:800;
  font-size:.9rem;
  color:var(--text);
  padding:0 6px;
}

.navbar{
  z-index:15;
  display:flex;
  gap:10px;
  padding:10px 14px 2px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.nav-item{
  position:relative;
  flex:0 0 auto;
}
.nav-btn{
  border:none;
  border-radius:12px;
  padding:10px 12px;
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-weight:900;
  font-size:.95rem;
  cursor:pointer;
  border:1px solid rgba(255,255,255,.10);
}
a.nav-btn{
  display:inline-flex;
  align-items:center;
  text-decoration:none;
}
.nav-btn--direct{
  background:rgba(61,139,253,.22);
  border-color:rgba(61,139,253,.45);
}
.caret{opacity:.8}

.dropdown{
  position:absolute;
  left:0;
  top:calc(100% + 8px);
  min-width:160px;
  padding:8px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(18,26,46,.98);
  box-shadow:var(--shadow);
  display:none;
}
.nav-item.open .dropdown{display:block;}
.dropdown a{
  display:block;
  padding:10px 10px;
  border-radius:10px;
  font-weight:800;
  color:rgba(233,238,255,.92);
}
.dropdown a:active,
.dropdown a:hover{
  background:rgba(61,139,253,.16);
}

.container{
  padding:12px 14px 22px;
  max-width:920px;
  margin:0 auto;
}

.home-wubi-roots-banner{
  margin:10px 0 6px;
  text-align:center;
}
.home-wubi-roots-banner__link{
  color:var(--text) !important;
  font-weight:800;
  font-size:1.06rem;
  text-decoration:underline;
  text-underline-offset:3px;
}
.home-wubi-roots-banner__link:hover{
  color:rgba(233,238,255,.92) !important;
  text-underline-offset:3px;
}
.home-banner-sep{
  margin:0 .35em;
  color:rgba(233,238,255,.45);
  font-weight:700;
}

.card{
  background:rgba(23,31,51,.92);
  border:1px solid rgba(255,255,255,.10);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:14px;
  margin:12px 0;
}

.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.card-title{
  font-weight:900;
  letter-spacing:.02em;
}
.icon-btn{
  border:none;
  background:rgba(255,255,255,.08);
  color:var(--text);
  font-weight:900;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  cursor:pointer;
}

.video-wrap{
  width:fit-content;
  max-width:100%;
  margin-inline:auto;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.20);
  line-height:0;
}
.video{
  display:block;
  width:auto;
  max-width:100%;
  height:auto;
  max-height:78svh;
  background:#000;
}

/* 减轻右键/长按菜单与拖拽另存（无法防止抓包、录屏或开发者工具下载） */
.video-wrap video,
.textbook-image{
  -webkit-touch-callout:none;
  -webkit-user-select:none;
  user-select:none;
}
.textbook-image{
  -webkit-user-drag:none;
}
.jiaocai-pages{
  display:flex;
  flex-direction:column;
  gap:18px;
  margin-top:4px;
  min-width:0;
}
.jiaocai-fig{
  margin:0;
  min-width:0;
  max-width:100%;
}
.jiaocai-fig__cap{
  margin:0 0 8px;
  font-weight:800;
  font-size:.9rem;
}
/* 教材扫描图：移动端不溢出屏宽（flex 子项须 min-width:0）；大屏再限最大宽度 */
img.textbook-image{
  display:block;
  box-sizing:border-box;
  width:100%;
  max-width:min(600px,100%);
  max-height:min(78svh,900px);
  height:auto;
  margin-inline:auto;
  object-fit:contain;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.2);
}
.tip{
  margin:.75rem 0 0;
  font-size:.9rem;
  line-height:1.45;
}

.chapters{
  margin:0;
  padding:0 0 0 20px;
}
.chapters li{
  margin:10px 0;
  line-height:1.35;
}
.chapters a{
  display:inline-block;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.05);
}
.chapters a:active,
.chapters a:hover{
  background:rgba(61,139,253,.14);
  border-color:rgba(61,139,253,.24);
}

.float-open{
  position:fixed;
  right:14px;
  bottom:16px;
  z-index:50;
  border:none;
  border-radius:999px;
  padding:12px 14px;
  font-weight:900;
  color:#fff;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  box-shadow:0 14px 30px rgba(0,0,0,.35);
  cursor:pointer;
}

.footer{
  padding:18px 14px 26px;
  border-top:1px solid rgba(255,255,255,.08);
  background:rgba(10,14,28,.55);
  margin-top:22px;
}
.footer-inner{
  max-width:920px;
  margin:0 auto;
}
.footer-line{
  margin:6px 0;
  font-weight:800;
}

.about-contact{
  margin-top:18px;
  text-align:center;
}
.about-contact__label{
  margin-bottom:10px;
  font-weight:800;
}
.about-contact__qr{
  display:block;
  margin:0 auto;
  max-width:min(200px,72vw);
  height:auto;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 8px 24px rgba(0,0,0,.25);
}
