/* =========================================================
   AI 创客家 · 登录页
   遵循 tokens.css 设计系统（PRD v2.0 §3.2）：
   米白底 / 白卡片 / 钴蓝主色 / 暖黄点缀，紫色仅用于 AI 信号。
   无动效装饰、无渐变、无玻璃拟态。
   ========================================================= */

:root {
  --c-primary: #1d4ed8;
  --c-primary-strong: #1743b8;
  --c-primary-soft: #eaf0fb;
  --c-accent: #ffc838;
  --c-bg: #f7f7f4;
  --c-surface: #ffffff;
  --c-text: #17181c;
  --c-text-2: #565b66;
  --c-line: #e4e6ea;
  --c-danger: #dc2626;
  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow-s: 0 1px 2px rgba(23, 24, 28, 0.05);
  --shadow: 0 6px 20px rgba(23, 24, 28, 0.07);
  --font: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

::selection { background: rgba(29, 78, 216, 0.18); }

/* ---------- 页面骨架 ---------- */
.login-page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(32px, 5vw, 88px);
  padding: clamp(24px, 4vw, 56px);
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- 左栏：品牌叙事 ---------- */
.brand-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  max-width: 540px;
  min-width: 0;
  padding-left: clamp(0px, 2vw, 24px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--c-text);
  text-decoration: none;
}

.brand-symbol img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}

.brand strong { display: block; font-size: 17px; line-height: 1.3; }
.brand small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--c-text-2); }

.brand-message { width: 100%; margin-top: 36px; }

.brand-message h1 {
  margin: 0;
  font-size: clamp(32px, 3.6vw, 50px);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

/* 暖黄荧光笔：约 30% 字高、贴 baseline，首次加载扫过一次 */
.brand-message h1 em {
  font-style: normal;
  position: relative;
  z-index: 0;
}

.brand-message h1 em::after {
  content: "";
  position: absolute;
  left: -0.06em;
  right: -0.06em;
  bottom: 0.04em;
  height: 0.3em;
  background: rgba(255, 200, 56, 0.85);
  z-index: -1;
  transform-origin: left center;
  animation: marker-sweep 600ms ease-out 350ms both;
}

.brand-message h1 em:nth-of-type(2)::after { animation-delay: 500ms; }

@keyframes marker-sweep {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.brand-sub {
  max-width: 30em;
  margin: 24px 0 0;
  color: var(--c-text-2);
  font-size: 16px;
  line-height: 1.7;
}

/* ---------- Idea Terminal：轻量灵感终端 ---------- */
.idea-terminal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  min-height: 120px;
  margin-top: 32px;
  padding: 18px 20px;
  background: #f5f6f8;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.75;
  color: var(--c-text-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}

/* 仅允许极轻微的状态变化：不浮起、不放大、不发光 */
.idea-terminal:hover { border-color: #d9dce3; background: #f2f3f6; }

.terminal-tag {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #6b7078;
}

.terminal-line { margin: 0; white-space: nowrap; overflow: hidden; }

.terminal-prompt { color: var(--c-primary); font-weight: 600; }

.terminal-cursor {
  display: inline-block;
  min-width: 0.6em;
  animation: cursor-blink 700ms linear infinite;
}

@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- 可以创造（滚动词条） ---------- */
.create-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  margin-top: 34px;
}

.create-label { flex: none; font-size: 14px; font-weight: 600; color: var(--c-text); }

.create-marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

/* 双份内容 + translateX(-50%)：首尾严格相接，无缝循环 */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 24s linear infinite;
}

.create-marquee:hover .marquee-track { animation-play-state: paused; }

@keyframes marquee-scroll {
  to { transform: translate3d(-50%, 0, 0); }
}

.marquee-seg { display: flex; align-items: center; flex: none; }

.marquee-seg span { font-size: 15px; font-weight: 500; color: #3f4450; white-space: nowrap; }

.marquee-seg i {
  flex: none;
  margin: 0 16px;
  font-style: normal;
  font-size: 13px;
  color: #6b7078;
}

/* ---------- 成长路径 ---------- */
.growth-module { width: 100%; margin-top: 36px; }

.module-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.growth-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 32px;
}

.growth-node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.node-index {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  color: #6b7078;
}

.node-name { font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--c-text); }

.node-desc { font-size: 13px; line-height: 1.5; color: var(--c-text-2); }

/* 节点间细连接线 + 末端小箭头（落在 32px 列间距内，无卡片无背景） */
.growth-node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 30px;
  left: calc(100% + 7px);
  width: 14px;
  height: 1px;
  background: #d9dce3;
}

.growth-node:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 30px;
  left: calc(100% + 21px);
  width: 5px;
  height: 5px;
  border-top: 1px solid #9ba1ab;
  border-right: 1px solid #9ba1ab;
  transform: translateY(-50%) rotate(45deg);
}

/* ---------- 创造方法 ---------- */
.method-module { width: 100%; margin-top: 28px; }

.method-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 32px;
  row-gap: 16px;
}

.method-step { display: flex; align-items: baseline; gap: 8px; }

.step-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #6b7078;
}

.step-name { font-size: 15px; font-weight: 500; color: #3f4450; }

/* ---------- 右栏：登录卡 ---------- */
.login-panel {
  width: 100%;
  max-width: 440px;
  min-width: 0;
  justify-self: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-box {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-l);
  padding: clamp(26px, 3vw, 38px);
  box-shadow: var(--shadow);
}

.login-heading { margin-bottom: 22px; }

.login-heading h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
}

.login-heading > p:last-child {
  margin: 8px 0 0;
  color: var(--c-text-2);
  font-size: 13.5px;
}

/* 角色切换：分段控件 */
.role-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  background: #eef0f3;
  border-radius: 10px;
}

.role-option {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--c-text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.role-option:hover { color: var(--c-text); }

.role-option.active {
  color: var(--c-primary);
  background: var(--c-surface);
  border-color: #d5d9e0;
  font-weight: 600;
  box-shadow: var(--shadow-s);
}

/* 表单 */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 7px; }

.field > span:first-child {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #d9dce3;
  border-radius: var(--radius-s);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder { color: #a2a7b1; }
.field input:hover { border-color: #c2c7d1; }

.field input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.password-field { display: block; position: relative; }
.password-field input { padding-right: 64px; }

.password-field button {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  min-width: 52px;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--c-primary);
  font-size: 13px;
  transition: color 0.15s ease;
}

.password-field button:hover { color: var(--c-primary-strong); }

.login-error {
  padding: 10px 13px;
  border: 1px solid #f3c1c1;
  border-radius: var(--radius-s);
  background: #fdf1f1;
  color: #b42323;
  font-size: 13px;
  line-height: 1.5;
}

.login-error[hidden] { display: none; }

/* 主按钮 */
.primary-btn {
  min-height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: var(--radius-s);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  background: var(--c-primary);
  transition: background 0.15s ease;
}

.primary-btn:hover { background: var(--c-primary-strong); }
.primary-btn:active { background: #133a9e; transform: translateY(1px); }
.primary-btn:disabled { cursor: progress; opacity: 0.7; }

/* 键盘可达性 */
.role-option:focus-visible,
.primary-btn:focus-visible,
.password-field button:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.field input:focus-visible { outline: none; }

/* 支持信息 + 页脚 */
.login-support {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--c-line);
  color: #8a8f99;
  font-size: 12.5px;
  line-height: 1.7;
}

.login-support p { margin: 0; }
.login-support p:first-child { color: var(--c-text-2); }

.login-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8a8f99;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 11px 20px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 13.5px;
  box-shadow: var(--shadow);
}

.toast[hidden] { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 36px;
    padding: 40px 20px 44px;
  }

  .brand-panel { padding-left: 0; }
  .login-panel { max-width: 460px; justify-self: start; }
}

/* 小于 768px：成长路径转纵向，创造方法改 2 列 */
@media (max-width: 767px) {
  .brand-message h1 { font-size: 28px; }

  .growth-grid { grid-template-columns: 1fr; row-gap: 22px; }
  .growth-node:not(:last-child)::before,
  .growth-node:not(:last-child)::after { content: none; }

  .method-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .login-page { padding: 28px 16px 36px; }
  .login-box { padding: 22px 18px; border-radius: var(--radius); }
  .login-footer { flex-direction: column; gap: 6px; align-items: center; }
}

/* ---------- 动效减免：静态直出，无循环动画 ---------- */
@media (prefers-reduced-motion: reduce) {
  .brand-message h1 em::after,
  .terminal-cursor { animation: none; }

  .marquee-track { animation: none; width: auto; flex-wrap: wrap; }
  .marquee-seg + .marquee-seg { display: none; }
  .create-marquee { -webkit-mask-image: none; mask-image: none; overflow: visible; }
}
