/* ============================================================
   Easier Code 教学平台 —— 自定义外观
   覆盖 JupyterHub 默认样式,同时兼容内置的深色模式切换
   ============================================================ */

:root {
  --ec-accent: #7c5cff;
  --ec-accent-2: #22b8cf;
  --ec-radius: 16px;

  /* ---------- 字体栈（darwin-ui --font-sans / --font-mono） ----------
     原先本站没定义 font-family，直接用 Bootstrap 默认；统一到 darwin-ui
     的系统字体栈，中文回落到系统默认中文字体（栈里没有显式中文字体，
     由 system-ui 负责，这是有意的：各平台中文字体名不同，写死反而更差）。 */
  --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
               "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;

  /* ---------- 设计 token（套用 darwin-ui） ----------
     来源：npm pack @pikoloo/darwin-ui@2.1.0 → package/dist/darwin-ui.css
     放在这里而不是 home-panels.css，是因为本文件是基础样式表：
     变量虽在使用时才解析、加载顺序不敏感，但定义在基础表里更不容易踩坑。

     ⚠️ **字号只许用这 6 级**，别再写 font-size: 0.83rem 这种随手数。
        2026-09-29 用户反馈「字一下子小一下子大」—— 根因就是原先这里散着
        20 种字号（0.74~1.42rem），已统一收敛到下面 6 级。
        例外：媒体查询里的响应式缩放（如移动端把标题缩到 1.26rem）可保留原值。 */
  --fs-xs:    0.75rem;   /* 12px — 徽章、标签、脚注 */
  --fs-sm:    0.875rem;  /* 14px — 正文默认：说明、表格、副标题 */
  --fs-base:  1rem;      /* 16px — 强调正文：列表项标题、按钮 */
  --fs-lg:    1.125rem;  /* 18px — 区块标题、指标数值 */
  --fs-xl:    1.25rem;   /* 20px — 页面主标题 */
  --fs-2xl:   1.5rem;    /* 24px — 登录卡片标题等 */

  /* 文字色阶（darwin-ui，暗色取值） */
  --fg-primary:    rgba(255, 255, 255, 1);
  --fg-secondary:  rgba(255, 255, 255, 0.9);
  --fg-tertiary:   rgba(255, 255, 255, 0.6);
  --fg-quaternary: rgba(255, 255, 255, 0.4);

  /* 描边（darwin-ui --border-*） */
  --line-subtle:  rgba(255, 255, 255, 0.05);
  --line-default: rgba(255, 255, 255, 0.1);
  --line-strong:  rgba(255, 255, 255, 0.2);
}

/* ---------- 全局字体 ----------
   只统一字体栈，**不动 body 的 font-size**。
   ⚠️ 曾试过写 body { font-size: var(--fs-sm) }（14px）让正文更紧凑，但那会
      制造新的不一致：Bootstrap 的 .btn / .form-control 都是显式 font-size: 1rem
      （16px），不跟随 body —— 结果就是"本站按钮 14px、Bootstrap 按钮 16px"，
      恰恰是用户反馈的「字一下子小一下子大」。
      正文字号交给下面各组件显式声明，全部取自 6 级阶梯。 */
body {
  font-family: var(--font-sans);
}
code, pre, kbd, samp, .mono {
  font-family: var(--font-mono);
}

/* ---------- 顶部导航品牌 ---------- */
.ec-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.ec-logo-mark {
  display: block;
  flex: 0 0 auto;
}
.ec-brand-text {
  font-weight: 700;
  font-size: var(--fs-base)
  letter-spacing: -0.01em;
}

/* ---------- 登录页布局 ---------- */
.ec-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 190px);
  padding: 20px 16px 60px;
}

.ec-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 38px 30px;
  border-radius: var(--ec-radius);
  border: 1px solid var(--bs-border-color, rgba(128, 128, 128, 0.22));
  background: var(--bs-body-bg, #fff);
  box-shadow: 0 18px 50px rgba(20, 20, 43, 0.13),
              0 2px 8px rgba(20, 20, 43, 0.06);
  text-align: center;
}

.ec-card-head {
  margin-bottom: 26px;
}
.ec-logo-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  filter: drop-shadow(0 6px 16px rgba(124, 92, 255, 0.35));
}
.ec-title {
  font-size: var(--fs-2xl)
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 7px;
}
.ec-subtitle {
  font-size: var(--fs-sm)
  opacity: 0.62;
  margin: 0;
}

/* ---------- 表单 ---------- */
.ec-form {
  text-align: left;
}
.ec-field {
  margin-bottom: 17px;
}
.ec-field label {
  display: block;
  font-size: var(--fs-sm)
  font-weight: 600;
  opacity: 0.78;
  margin-bottom: 7px;
}

.ec-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ec-input-icon {
  position: absolute;
  left: 14px;
  font-size: var(--fs-sm)
  opacity: 0.38;
  pointer-events: none;
  z-index: 2;
}
.ec-input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 40px;
  border-radius: 10px;
  font-size: var(--fs-base)
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ec-input:focus {
  border-color: var(--ec-accent);
  box-shadow: 0 0 0 3.5px rgba(124, 92, 255, 0.16);
  outline: none;
}

/* 密码可见性切换 */
.ec-eye {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  opacity: 0.42;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.ec-eye:hover {
  opacity: 0.85;
  background: rgba(128, 128, 128, 0.12);
}

/* ---------- 提交按钮 ---------- */
.ec-submit {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, var(--ec-accent) 0%, var(--ec-accent-2) 100%);
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.3);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}
.ec-submit:hover {
  color: #fff;
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(124, 92, 255, 0.4);
}
.ec-submit:active {
  transform: translateY(0);
}

/* ---------- 错误提示 ---------- */
.ec-error {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  margin-bottom: 18px;
  border-radius: 10px;
  font-size: var(--fs-sm)
  color: #b02a37;
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.24);
}

/* 内置的"未启用 HTTPS"提示:默认由 JS 控制显隐,
   这里把它塑造成不刺眼的样式,避免破坏整体观感 */
#insecure-login-warning {
  font-size: var(--fs-sm)
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 16px;
  text-align: left;
}

/* ---------- 卡片页脚 ---------- */
.ec-card-foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--bs-border-color, rgba(128, 128, 128, 0.18));
  font-size: var(--fs-xs)
  opacity: 0.5;
}
.ec-card-foot i {
  margin-right: 4px;
}

/* ---------- 深色模式适配 ---------- */
[data-theme="dark"] .ec-card {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5),
              0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .ec-error {
  color: #ff8a95;
  background: rgba(220, 53, 69, 0.16);
}

/* ---------- 窄屏适配 ---------- */
@media (max-width: 480px) {
  .ec-card {
    padding: 30px 22px 24px;
    box-shadow: 0 10px 30px rgba(20, 20, 43, 0.12);
  }
  .ec-title {
    font-size: var(--fs-xl)
  }
  .ec-login-wrap {
    min-height: auto;
    padding-top: 10px;
  }
}

/* ============================================================
   Easier Code 教学平台 —— 主页(机器学习风格)
   ============================================================ */

.ec-home {
  --ec-grad: linear-gradient(120deg, #7c5cff 0%, #22b8cf 45%, #e64980 100%);
  max-width: 1120px;
  padding-bottom: 40px;
}

/* ---------- Hero ---------- */
.ec-hero {
  position: relative;
  overflow: hidden;
  margin: 8px 0 46px;
  padding: 62px 40px 54px;
  border-radius: 24px;
  border: 1px solid var(--bs-border-color, rgba(128, 128, 128, 0.2));
  background:
    radial-gradient(1100px 420px at 8% -12%, rgba(124, 92, 255, 0.20), transparent 62%),
    radial-gradient(900px 380px at 96% 8%, rgba(34, 184, 207, 0.18), transparent 60%),
    radial-gradient(700px 300px at 50% 118%, rgba(230, 73, 128, 0.14), transparent 62%),
    var(--bs-body-bg, #fff);
  box-shadow: 0 22px 60px rgba(20, 20, 43, 0.10);
}
[data-theme="dark"] .ec-hero {
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

/* 神经网络动画画布 */
.ec-neural {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}
[data-theme="dark"] .ec-neural {
  opacity: 0.65;
}

.ec-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.ec-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  margin-bottom: 22px;
  border-radius: 999px;
  font-size: var(--fs-xs)
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bs-body-color, #333);
  background: color-mix(in srgb, var(--bs-body-color, #333) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--bs-body-color, #333) 14%, transparent);
}
.ec-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #37b24d;
  box-shadow: 0 0 0 0 rgba(55, 178, 77, 0.65);
  animation: ec-pulse 2.1s infinite;
}
@keyframes ec-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(55, 178, 77, 0.65); }
  70%  { box-shadow: 0 0 0 9px rgba(55, 178, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(55, 178, 77, 0); }
}

.ec-hero-title {
  margin: 0 0 18px;
  font-size: clamp(2rem, 5.2vw, 3.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.ec-grad-text {
  background: var(--ec-grad);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ec-shift 7s ease infinite;
}
@keyframes ec-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.ec-hero-sub {
  max-width: 600px;
  margin: 0 auto 34px;
  font-size: var(--fs-base)
  line-height: 1.85;
  opacity: 0.72;
}

.ec-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 30px;
}

/* 按钮 */
.ec-btn-primary,
.ec-btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 11px;
  padding: 12px 30px;
  font-weight: 600;
  color: #fff;
  transition: transform 0.14s, box-shadow 0.22s, filter 0.22s;
}
.ec-btn-primary {
  background: linear-gradient(135deg, #7c5cff 0%, #22b8cf 100%);
  box-shadow: 0 10px 26px rgba(124, 92, 255, 0.34);
}
.ec-btn-primary:hover {
  color: #fff;
  filter: brightness(1.07);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(124, 92, 255, 0.44);
}
.ec-btn-danger {
  background: linear-gradient(135deg, #f03e3e 0%, #e64980 100%);
  box-shadow: 0 10px 26px rgba(240, 62, 62, 0.3);
}
.ec-btn-danger:hover {
  color: #fff;
  filter: brightness(1.07);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(240, 62, 62, 0.4);
}
.ec-btn-primary:active,
.ec-btn-danger:active {
  transform: translateY(0);
}

/* 标签胶囊 */
.ec-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.ec-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: var(--fs-sm)
  font-weight: 500;
  background: color-mix(in srgb, var(--bs-body-bg, #fff) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--bs-body-color, #333) 13%, transparent);
  backdrop-filter: blur(6px);
  transition: transform 0.16s, border-color 0.16s;
}
.ec-chip:hover {
  transform: translateY(-2px);
  border-color: #7c5cff;
}
.ec-chip i {
  color: #7c5cff;
  font-size: var(--fs-xs)
}

/* ---------- 区块标题 ---------- */
.ec-section {
  margin-bottom: 46px;
}
.ec-section-title {
  position: relative;
  margin: 0 0 8px;
  padding-left: 16px;
  font-size: var(--fs-xl)
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ec-section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.24em;
  width: 4px;
  height: 1.05em;
  border-radius: 3px;
  background: var(--ec-grad);
}
.ec-section-desc {
  margin: 0 0 20px 16px;
  font-size: var(--fs-sm)
  opacity: 0.66;
  line-height: 1.75;
}

/* ---------- 能力卡片 ---------- */
.ec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.ec-feature {
  position: relative;
  overflow: hidden;
  padding: 26px 22px 24px;
  border-radius: 16px;
  border: 1px solid var(--bs-border-color, rgba(128, 128, 128, 0.18));
  background: var(--bs-body-bg, #fff);
  transition: transform 0.2s, box-shadow 0.24s, border-color 0.2s;
  animation: ec-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes ec-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ec-feature::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 0;
  background: var(--ec-grad);
  transition: width 0.32s ease;
}
.ec-feature:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, #7c5cff 42%, transparent);
  box-shadow: 0 16px 38px rgba(20, 20, 43, 0.13);
}
.ec-feature:hover::after {
  width: 100%;
}
[data-theme="dark"] .ec-feature:hover {
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42);
}
.ec-feature h4 {
  margin: 0 0 9px;
  font-size: var(--fs-base)
  font-weight: 700;
}
.ec-feature p {
  margin: 0;
  font-size: var(--fs-sm)
  line-height: 1.72;
  opacity: 0.68;
}
.ec-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 15px;
  border-radius: 13px;
  font-size: var(--fs-lg)
  color: #fff;
}
.ec-icon-1 { background: linear-gradient(135deg, #7c5cff, #a78bfa); }
.ec-icon-2 { background: linear-gradient(135deg, #22b8cf, #67e8f9); }
.ec-icon-3 { background: linear-gradient(135deg, #f76707, #ffa94d); }
.ec-icon-4 { background: linear-gradient(135deg, #e64980, #faa2c1); }

/* ---------- 课程方向 ---------- */
.ec-topics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 13px;
  margin-top: 22px;
}
.ec-topic {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  border-radius: 13px;
  font-size: var(--fs-sm)
  font-weight: 600;
  cursor: default;
  background: linear-gradient(135deg,
              color-mix(in srgb, var(--c1) 13%, transparent),
              color-mix(in srgb, var(--c2) 13%, transparent));
  border: 1px solid color-mix(in srgb, var(--c1) 30%, transparent);
  transition: transform 0.18s, box-shadow 0.22s, border-color 0.18s;
}
.ec-topic i {
  font-size: var(--fs-base)
  color: var(--c1);
  transition: transform 0.22s;
}
.ec-topic:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--c1);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--c1) 26%, transparent);
}
.ec-topic:hover i {
  transform: rotate(-8deg) scale(1.14);
}

/* ---------- 表格 ---------- */
.ec-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--bs-border-color, rgba(128, 128, 128, 0.18));
}
.ec-table {
  margin: 0;
  font-size: var(--fs-sm)
}
.ec-table thead th {
  border-bottom: 2px solid var(--bs-border-color, rgba(128, 128, 128, 0.22));
  font-weight: 700;
  font-size: var(--fs-sm)
  letter-spacing: 0.02em;
  opacity: 0.8;
}
.ec-table td,
.ec-table th {
  padding: 12px 16px;
  vertical-align: middle;
}
.ec-table .btn-xs {
  padding: 3px 11px;
  border-radius: 7px;
  font-size: var(--fs-xs)
  border: 0;
  color: #fff;
}
.ec-table .ec-btn-primary {
  padding: 3px 11px;
  border-radius: 7px;
  box-shadow: none;
}
.ec-table .ec-btn-danger {
  padding: 3px 11px;
  border-radius: 7px;
  box-shadow: none;
}

/* ---------- 页脚 ---------- */
.ec-home-foot {
  margin-top: 10px;
  padding-top: 24px;
  border-top: 1px solid var(--bs-border-color, rgba(128, 128, 128, 0.16));
  text-align: center;
  font-size: var(--fs-xs)
  opacity: 0.5;
}
.ec-foot-sep {
  margin: 0 9px;
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ec-neural,
  .ec-pulse-dot,
  .ec-grad-text,
  .ec-feature {
    animation: none !important;
  }
  .ec-feature {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 640px) {
  .ec-hero {
    padding: 42px 20px 38px;
    border-radius: 18px;
  }
  .ec-hero-title {
    font-size: 1.72rem;
  }
  .ec-hero-sub {
    font-size: var(--fs-sm)
  }
  .ec-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .ec-grid {
    grid-template-columns: 1fr;
  }
}
/* ============================================================
   机器学习教学平台 —— 全屏动态背景 + 登录页
   纯装饰层,不参与任何功能性逻辑
   ============================================================ */

/* ---------- 极光光斑层 ---------- */
.ec-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.ec-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.5;
  will-change: transform;
}
.ec-blob-1 {
  width: 46vw; height: 46vw;
  top: -14vw; left: -10vw;
  background: radial-gradient(circle at 30% 30%, #7c5cff, transparent 70%);
  animation: ec-drift-1 26s ease-in-out infinite;
}
.ec-blob-2 {
  width: 42vw; height: 42vw;
  top: 8vh; right: -12vw;
  background: radial-gradient(circle at 60% 40%, #22b8cf, transparent 70%);
  animation: ec-drift-2 32s ease-in-out infinite;
}
.ec-blob-3 {
  width: 40vw; height: 40vw;
  bottom: -16vw; left: 22vw;
  background: radial-gradient(circle at 50% 50%, #e64980, transparent 70%);
  animation: ec-drift-3 29s ease-in-out infinite;
}
.ec-blob-4 {
  width: 34vw; height: 34vw;
  bottom: 6vh; right: 8vw;
  background: radial-gradient(circle at 40% 60%, #4c6ef5, transparent 70%);
  animation: ec-drift-4 35s ease-in-out infinite;
}
@keyframes ec-drift-1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(9vw, 6vh) scale(1.16); }
  66%     { transform: translate(4vw, -4vh) scale(0.92); }
}
@keyframes ec-drift-2 {
  0%,100% { transform: translate(0,0) scale(1); }
  40%     { transform: translate(-11vw, 9vh) scale(1.2); }
  70%     { transform: translate(-5vw, 3vh) scale(0.9); }
}
@keyframes ec-drift-3 {
  0%,100% { transform: translate(0,0) scale(1); }
  35%     { transform: translate(8vw, -8vh) scale(1.14); }
  68%     { transform: translate(-6vw, -3vh) scale(0.94); }
}
@keyframes ec-drift-4 {
  0%,100% { transform: translate(0,0) scale(1); }
  45%     { transform: translate(-9vw, -7vh) scale(1.18); }
  75%     { transform: translate(-3vw, 5vh) scale(0.92); }
}

/* 深色模式下降低亮度,避免刺眼 */
[data-theme="dark"] .ec-blob {
  opacity: 0.34;
}

/* 细网格纹理,增加科技感 */
.ec-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(color-mix(in srgb, var(--bs-body-color, #333) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--bs-body-color, #333) 7%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 35%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 35%, transparent 78%);
}
[data-theme="dark"] .ec-grid-overlay {
  opacity: 0.28;
}

/* 粒子画布(全屏) */
.ec-bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- 全屏登录页 ---------- */
.ec-login-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.ec-login-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 44px 40px 32px;
  border-radius: 22px;
  text-align: center;
  background: color-mix(in srgb, var(--bs-body-bg, #fff) 78%, transparent);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid color-mix(in srgb, var(--bs-body-color, #333) 13%, transparent);
  box-shadow:
    0 26px 70px rgba(20, 20, 43, 0.2),
    0 2px 10px rgba(20, 20, 43, 0.07),
    inset 0 1px 0 color-mix(in srgb, #fff 45%, transparent);
  animation: ec-card-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes ec-card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
[data-theme="dark"] .ec-login-card {
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.6),
    0 2px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 卡片顶部的流光描边 */
.ec-login-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 23px;
  padding: 1px;
  background: linear-gradient(130deg, #7c5cff, #22b8cf, #e64980, #7c5cff);
  background-size: 300% 300%;
  animation: ec-border-flow 8s linear infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes ec-border-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ---------- 登录卡片内部 ---------- */
.ec-login-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  filter: drop-shadow(0 8px 22px rgba(124, 92, 255, 0.42));
  animation: ec-float 5.5s ease-in-out infinite;
}
@keyframes ec-float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-7px); }
}

.ec-login-title {
  margin: 0 0 8px;
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ec-login-title .ec-grad-text {
  background: linear-gradient(120deg, #7c5cff, #22b8cf 45%, #e64980);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ec-shift 7s ease infinite;
}
.ec-login-sub {
  margin: 0 0 30px;
  font-size: var(--fs-sm)
  opacity: 0.6;
  letter-spacing: 0.01em;
}

.ec-login-form { text-align: left; }

.ec-login-field { margin-bottom: 17px; }
.ec-login-field label {
  display: block;
  margin-bottom: 7px;
  font-size: var(--fs-sm)
  font-weight: 600;
  opacity: 0.76;
}
.ec-login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ec-login-icon {
  position: absolute;
  left: 15px;
  font-size: var(--fs-sm)
  opacity: 0.36;
  pointer-events: none;
  z-index: 2;
}
.ec-login-input {
  width: 100%;
  height: 48px;
  padding: 0 46px 0 41px;
  border-radius: 11px;
  font-size: var(--fs-base)
  background: color-mix(in srgb, var(--bs-body-bg, #fff) 62%, transparent);
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.ec-login-input:focus {
  border-color: #7c5cff;
  background: var(--bs-body-bg, #fff);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.17);
  outline: none;
}

.ec-login-eye {
  position: absolute;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.ec-login-eye:hover {
  opacity: 0.85;
  background: color-mix(in srgb, var(--bs-body-color, #333) 11%, transparent);
}

.ec-login-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 50px;
  margin-top: 8px;
  border: 0;
  border-radius: 11px;
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(120deg, #7c5cff, #22b8cf 50%, #7c5cff);
  background-size: 220% 100%;
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.36);
  transition: transform 0.14s, box-shadow 0.22s, background-position 0.5s;
}
.ec-login-submit:hover {
  color: #fff;
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow: 0 15px 38px rgba(124, 92, 255, 0.48);
}
.ec-login-submit:active { transform: translateY(0); }

/* 按钮上的掠光 */
.ec-login-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.42), transparent);
  transform: skewX(-22deg);
  animation: ec-sheen 3.4s ease-in-out infinite;
}
@keyframes ec-sheen {
  0%, 62% { left: -80%; }
  100%    { left: 130%; }
}

.ec-login-error {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  margin-bottom: 18px;
  border-radius: 11px;
  font-size: var(--fs-sm)
  color: #b02a37;
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.26);
}
[data-theme="dark"] .ec-login-error { color: #ff8a95; }

.ec-login-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--bs-body-color, #333) 12%, transparent);
  font-size: var(--fs-xs)
  opacity: 0.48;
}

/* 沉浸式登录页:隐藏顶部导航条 */
.ec-login-immersive .navbar { display: none !important; }

@media (max-width: 520px) {
  .ec-login-card { padding: 32px 22px 24px; border-radius: 18px; }
  .ec-login-title { font-size: 1.26rem; }
  .ec-blob { filter: blur(54px); }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  .ec-blob,
  .ec-login-card,
  .ec-login-brand,
  .ec-login-submit::after,
  .ec-login-card::before,
  .ec-login-title .ec-grad-text {
    animation: none !important;
  }
  .ec-login-card { opacity: 1; transform: none; }
}
