/* ============================================================================
   前台入口样式（2026-10-13）
   照 vel（vel.yueshu365.com）的「登录 → 选择工作区」两页 1:1 复刻。
   调色板全部从 vel 截图逐像素采样得来（暖黑底 + 深藏青顶栏 + 米色主按钮）。

   ⚠️ 这是**入口页专属**样式，不要拿去改站内（站内是浅色 + 品牌蓝 #2f6feb 那套）。
   ⚠️ 标题走衬线体（vel 同款），正文走无衬线。
   ========================================================================== */

:root {
  /* —— 从 vel 截图采样 —— */
  --entry-bg: #1f1c1a;         /* 页面背景（暖黑） */
  --entry-panel: #292524;      /* 卡片 */
  --entry-panel-2: #1c1917;    /* 卡片内嵌小卡 */
  --entry-topbar: #101b30;     /* 顶栏（深藏青） */
  --entry-field: #353a48;      /* 输入框底色 */
  --entry-line: #4c4d4f;       /* 输入框描边 */
  --entry-line-soft: #3a3532;  /* 卡片描边 */
  --entry-text: #f5f5f4;
  --entry-dim: #a8a29e;
  --entry-accent: #d6c0a9;     /* 米色主按钮 */
  --entry-accent-text: #1f1c1a;
  --entry-danger: #e8a3a3;
  --entry-danger-line: #8a4a4a;
  --entry-serif: Georgia, "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
}

/* ---- 浅色主题（2026-10-14：照 vel 顶栏加「浅色/深色」开关，记忆 englishLabTheme）----
   只翻页面底色/卡片/文字；顶栏保持深藏青（视觉锚点，logo/导航/用户区颜色不用动）。
   未设置过主题时入口页默认深色（vel 原味）。 */
html[data-theme="light"] {
  --entry-bg: #f6f4f1;
  --entry-panel: #ffffff;
  --entry-panel-2: #f3efe9;
  --entry-field: #ffffff;
  --entry-line: #d5cec5;
  --entry-line-soft: #e6e1d9;
  --entry-text: #26221e;
  --entry-dim: #7d756c;
  --entry-accent: #c9a97e;
  --entry-danger: #b45454;
  --entry-danger-line: #dcb9b9;
}

/* —— 浅色/深色开关（vel 同款：浅色 [开关] 深色）—— */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  font-size: 12px;
  color: #cbd5e1;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 160ms ease;
}
.theme-toggle:hover { border-color: rgba(255, 255, 255, 0.4); }
.theme-toggle .tswitch {
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  position: relative;
  flex-shrink: 0;
}
.theme-toggle .tknob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 180ms ease;
}
html[data-theme="dark"] .theme-toggle .tknob { transform: translateX(14px); }
html[data-theme="dark"] .theme-toggle .tlabel-dark { color: #fff; font-weight: 600; }
html[data-theme="light"] .theme-toggle .tlabel-light { color: #fff; font-weight: 600; }

/* ---- 顶栏用户下拉菜单（照 vel 的 AI积分菜单，入口页通用）---- */
.tsel-chip { position: relative; }
.tsel-chip-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; font-size: 13px; color: #e8ecf4;
  background: transparent; border: none; border-radius: 999px; cursor: pointer;
}
.tsel-chip-btn:hover { background: rgba(255, 255, 255, 0.08); }
.tsel-caret { font-size: 10px; color: #cbd5e1; }

.tsel-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 80;
  min-width: 224px; padding: 10px 8px 8px;
  background: #171b23; border: 1px solid #2a3341; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column;
}
.tsel-menu a, .tsel-menu button {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; font-size: 13px; color: #dbe2ec; text-align: left;
  background: none; border: none; border-radius: 8px; cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.tsel-menu a:hover, .tsel-menu button:hover { background: #232a35; color: #fff; }
.tsel-menu .mi { width: 18px; font-size: 12px; }
.um-stats { padding: 4px 8px 12px; border-bottom: 1px solid #2a3341; margin-bottom: 8px; }
.um-title { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #8b93a2; margin-bottom: 8px; }
.um-title .um-refresh { margin-left: auto; cursor: pointer; opacity: .7; }
.um-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.um-row > div { background: #232a35; border-radius: 8px; padding: 9px 6px; text-align: center; }
.um-row small { display: block; font-size: 11px; color: #8b93a2; margin-bottom: 4px; }
.um-row b { font-size: 16px; color: #7aa2ff; }
.um-sep { height: 1px; background: #2a3341; margin: 6px 0; }

/* ---- 修改密码弹窗（入口页深色版）---- */
.pwd-mask {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
.pwd-card {
  width: min(380px, 94vw); background: #171b23;
  border: 1px solid #2a3341; border-radius: 14px;
  padding: 24px 26px; position: relative; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.pwd-close {
  position: absolute; top: 12px; right: 14px; width: 28px; height: 28px;
  border: none; border-radius: 50%; background: #232a35;
  color: #8b93a2; cursor: pointer; font-size: 13px;
}
.pwd-card h3 { font-size: 17px; color: #eef1f6; margin-bottom: 18px; }
.pwd-card label { display: block; font-size: 12.5px; color: #cbd3df; margin-bottom: 14px; }
.pwd-card input {
  width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 13.5px;
  color: #eef1f6; background: #0f1216;
  border: 1px solid #2a3341; border-radius: 8px; outline: none;
}
.pwd-card input:focus { border-color: #e3c6a8; }
.pwd-msg { min-height: 1.2em; font-size: 12.5px; color: #e08585; margin: 4px 0 8px; }
.pwd-actions { display: flex; justify-content: flex-end; gap: 10px; }
.pwd-actions button {
  padding: 9px 20px; font-size: 13px; border-radius: 8px;
  border: 1px solid #2a3341; background: transparent; color: #cbd3df; cursor: pointer;
}
.pwd-actions button.primary {
  background: #e3c6a8; color: #241d15; border-color: #e3c6a8; font-weight: 600;
}

* { box-sizing: border-box; }

/* ⚠️ 必须放最前：下面给 .entry-form / .entry-links 写了 display:flex，
   而 [hidden] 的 display:none 来自 UA 样式表 —— 优先级更低会被压过，
   结果「隐藏的登录表单」照样显示（登录页和注册表单叠在一起）。
   这里显式用 !important 兜住所有 [hidden]。 */
[hidden] { display: none !important; }

body.entry-page {
  margin: 0;
  min-height: 100vh;
  background: var(--entry-bg);
  color: var(--entry-text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 登录 / 注册 ---------- */
.entry-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.entry-card {
  width: min(92vw, 420px);
  background: var(--entry-panel);
  border: 1px solid var(--entry-line-soft);
  border-radius: 16px;
  padding: 40px 32px 28px;
  text-align: center;
}

.entry-brand {
  margin: 0;
  font-family: var(--entry-serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--entry-text);
}

.entry-tagline {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--entry-dim);
}

.entry-form {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry-field {
  position: relative;
  display: block;
}

.entry-field input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 40px;
  background: var(--entry-field);
  border: 1px solid var(--entry-line);
  border-radius: 8px;
  color: var(--entry-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, background .15s;
}

.entry-field input::placeholder { color: #9aa0ad; }
.entry-field input:focus { border-color: var(--entry-accent); }
.entry-field input:disabled { opacity: .6; cursor: not-allowed; }

.entry-field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #9aa0ad;
  pointer-events: none;
}
.entry-field-icon svg { display: block; width: 100%; height: 100%; }

.entry-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  padding: 0;
  color: #9aa0ad;
  cursor: pointer;
  border-radius: 6px;
}
.entry-eye:hover { color: var(--entry-text); }
.entry-eye svg { width: 16px; height: 16px; display: block; }

.entry-primary {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  background: var(--entry-accent);
  color: var(--entry-accent-text);
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s;
}
.entry-primary:hover:not(:disabled) { filter: brightness(1.06); }
.entry-primary:disabled { opacity: .6; cursor: not-allowed; }

.entry-secondary {
  width: 100%;
  height: 42px;
  background: transparent;
  color: var(--entry-text);
  border: 1px solid var(--entry-line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.entry-secondary:hover { background: rgba(255, 255, 255, .05); border-color: #6b6f7a; }

.entry-links {
  margin: 18px 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  color: var(--entry-dim);
}

.entry-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  /* 顶栏内元素：固定浅色（顶栏恒深藏青） */
  color: #aab6c8;
  cursor: pointer;
  text-decoration: none;
}
.entry-link:hover { color: var(--entry-text); text-decoration: underline; }

.entry-sep { color: #57534e; }

.entry-msg {
  margin: 14px 0 0;
  font-size: 13px;
  min-height: 1.2em;
  color: var(--entry-danger);
}
.entry-msg.is-ok { color: #a3d8a3; }

/* ---------- 选择工作区 ---------- */
.tsel-topbar {
  height: 56px;
  background: var(--entry-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.tsel-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--entry-serif);
  font-size: 16px;
  font-weight: 700;
  /* 顶栏恒为深藏青、不随主题翻色 —— 里面文字固定浅色，浅色模式下也清晰 */
  color: #f5f7fb;
}
.tsel-brand svg { width: 18px; height: 18px; display: block; }

.tsel-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: #cbd5e1;
}

/* 顶栏导航：紧跟右侧用户区（logo 靠左，导航+账号靠右成一组）。
   点链接回资料库首页，?action= 参数让首页自动触发对应动作（筛选/弹面板/打开演示课）。 */
.tsel-topbar {
  justify-content: flex-start;
}
.tsel-brand {
  margin-right: 40px;
}
.tsel-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  margin-right: 26px;
  font-size: 14px;
}
.tsel-links a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 160ms ease;
}
.tsel-links a:hover {
  color: #fff;
}
.tsel-links a:first-child {
  color: #fff;
  font-weight: 600;
}
@media (max-width: 860px) {
  .tsel-links { display: none; } /* 小屏收起，只留用户区 */
}

.tsel-user {
  display: flex;
  align-items: center;
  gap: 8px;
  /* 顶栏内元素：固定浅色（顶栏恒深藏青） */
  color: #e8ecf4;
}
.tsel-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #2f6feb, #6e5af2);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.tsel-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.tsel-title {
  margin: 0;
  text-align: center;
  font-family: var(--entry-serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--entry-text);
}

.tsel-sub {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--entry-dim);
}

.tsel-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.tsel-card {
  display: flex;
  flex-direction: column;
  background: var(--entry-panel);
  border: 1px solid var(--entry-line-soft);
  border-radius: 12px;
  padding: 26px 22px 22px;
  text-align: center;
}

.tsel-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(214, 192, 169, .1);
  color: var(--entry-accent);
}
.tsel-icon svg { width: 21px; height: 21px; display: block; }

.tsel-card h2 {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--entry-text);
}

.tsel-desc {
  margin: 9px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--entry-dim);
}

.tsel-body {
  flex: 1;
  margin: 20px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.tsel-org {
  background: var(--entry-panel-2);
  border-radius: 8px;
  padding: 13px 14px;
  position: relative;
}

.tsel-org-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tsel-org-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--entry-text);
}

.tsel-org-note {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: #8d8783;
  word-break: break-all;
}

.tsel-badge {
  flex: none;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid #3f6ea8;
  color: #8fb6e6;
  background: rgba(47, 111, 235, .12);
}

.tsel-badge.is-expired {
  border-color: var(--entry-danger-line);
  color: var(--entry-danger);
  background: rgba(232, 163, 163, .08);
}

.tsel-org-expire {
  margin: 10px 0 0;
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid var(--entry-danger-line);
  color: var(--entry-danger);
}

.tsel-org-action {
  margin-top: 8px;
  width: 100%;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: #4a4644;
  color: #b8b2ae;
  font-size: 12.5px;
  font-family: inherit;
  cursor: not-allowed;
}

.tsel-empty {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 116px;
  font-size: 12.5px;
  color: #7d7873;
  border: 1px dashed #3f3a37;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.tsel-primary {
  width: 100%;
  height: 40px;
  background: var(--entry-accent);
  color: var(--entry-accent-text);
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s;
}
.tsel-primary:hover:not(:disabled) { filter: brightness(1.06); }
.tsel-primary:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 720px) {
  .tsel-grid { grid-template-columns: minmax(0, 1fr); }
  .tsel-main { padding: 36px 18px 56px; }
  .tsel-title { font-size: 24px; }
  .tsel-nav { gap: 12px; }
}
