/* 登录页：左品牌 / 右表单的一张卡片，浮在带光斑的背景上。
   明暗两套由 body.theme-dark 切换（默认跟随系统，选择记在 localStorage）。
   配色只走变量，想换品牌色改 --brand 一处即可。 */

:root {
  /* 让勾选框、滚动条这些原生控件跟着主题走。深色下不声明这个，
     「记住这台设备」的方框会是一块刺眼的纯白。 */
  color-scheme: light;
  --bg: #f4f1ec;
  --card: #ffffff;
  --card2: #f7f8fa;
  --ink: #16181d;
  --ink2: #5a6270;
  --ink3: #99a1ae;
  --line: rgba(16, 24, 40, .10);
  --line2: rgba(16, 24, 40, .16);
  --brand: #2b5cff;
  --brand-soft: rgba(43, 92, 255, .10);
  --ok: #0f9960;
  --ok-bg: rgba(15, 153, 96, .10);
  --bad: #d92d20;
  --bad-bg: rgba(217, 45, 32, .07);
  --shadow: 0 24px 70px rgba(16, 24, 40, .13);
  --glow: rgba(43, 92, 255, .16);
}
body.theme-dark {
  color-scheme: dark;
  --bg: #0a0c10;
  --card: #14171d;
  --card2: #1b1f27;
  --ink: #eef1f6;
  --ink2: #a9b2c0;
  --ink3: #6f7887;
  --line: rgba(255, 255, 255, .09);
  --line2: rgba(255, 255, 255, .16);
  --brand: #6d8dff;
  --brand-soft: rgba(109, 141, 255, .14);
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, .12);
  --bad: #ff6b6b;
  --bad-bg: rgba(255, 107, 107, .10);
  --shadow: 0 30px 90px rgba(0, 0, 0, .62);
  --glow: rgba(109, 141, 255, .20);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .pane 用了 display:flex，会盖掉 hidden 的默认行为 */
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  overflow: hidden;
  transition: background-color .2s, color .2s;
}

/* 背景：两团品牌色光斑 + 极淡网格，别抢卡片 */
.bg {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(52% 46% at 22% 10%, var(--glow), transparent 70%),
    radial-gradient(42% 42% at 90% 90%, var(--glow), transparent 72%);
  opacity: .9;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 76px 76px;
  opacity: .30;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 100%);
  mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 100%);
}

/* ── 卡片 ── */
.shell {
  position: relative;
  width: 100%; max-width: 1080px;
  min-height: min(660px, calc(100vh - 56px));
  max-height: calc(100vh - 56px);
  display: grid; grid-template-columns: 1.06fr .94fr;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── 左：品牌 ── */
.hero {
  position: relative; overflow: hidden;
  padding: 34px 38px 26px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(70% 55% at 78% 4%, var(--brand-soft), transparent 70%),
    linear-gradient(160deg, var(--brand-soft), transparent 46%);
  /* 桌面壳：这块没有可点的东西，整块拿来拖窗口最顺手 */
  -webkit-app-region: drag;
}
.rings { position: absolute; right: -130px; top: -150px; width: 560px; height: 560px; pointer-events: none; }
.rings i { position: absolute; inset: 0; border: 1px solid var(--line2); border-radius: 50%; opacity: .75; }
.rings i:nth-child(2) { inset: 70px; opacity: .55; }
.rings i:nth-child(3) { inset: 148px; opacity: .38; }

.hero-top { position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand-line { display: flex; align-items: center; gap: 9px; }
.mark {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
}
.pname { font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.brand-sub { margin: 0; font-size: 11.5px; color: var(--ink3); letter-spacing: .16em; }

/* 上下的自动外边距（eyebrow 顶、页脚顶）把卡片剩余高度均分掉：
   品牌压顶、页脚落地，中间这块内容自然居中，不会在一侧堆出一大块空。 */
.eyebrow {
  position: relative;
  margin: auto 0 10px; font-size: 10px; letter-spacing: .3em;
  color: var(--ink3); text-transform: uppercase;
}
.hero h1 {
  position: relative;
  margin: 0 0 12px; font-size: 29px; line-height: 1.32; font-weight: 700; letter-spacing: -.02em;
}
.lead { position: relative; margin: 0 0 18px; font-size: 13px; line-height: 1.75; color: var(--ink2); max-width: 30em; }

.chips { position: relative; display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.chips span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--line2); border-radius: 999px;
  font-size: 11.5px; color: var(--ink2); background: var(--card);
}
.chips i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); opacity: .75; }

.grid4 {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line2); border-radius: 14px; overflow: hidden;
  background: var(--card);
}
.grid4 .cell { padding: 11px 14px 12px; }
.grid4 .cell:nth-child(odd) { border-right: 1px solid var(--line); }
.grid4 .cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.grid4 .no { display: block; font-size: 10px; letter-spacing: .12em; color: var(--ink3); font-variant-numeric: tabular-nums; }
.grid4 b { display: block; margin: 3px 0 2px; font-size: 12.5px; font-weight: 600; }
.grid4 p { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--ink3); }

/* 页脚两个小字压到卡片底边：左栏内容比右栏短，不压上去会留一大块空白，看着像没排完 */
.hero-foot { position: relative; margin: 18px 0 0; font-size: 11px; color: var(--ink3); letter-spacing: .02em; }
.hero-foot.push { margin-top: auto; }
.hero-foot.dim { margin-top: 4px; opacity: .7; }

/* ── 右：表单 ── */
.panel {
  display: flex; flex-direction: column; min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--card);
}
.panel-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 22px 0; flex: none;
  -webkit-app-region: drag;
}
.bar-label { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink3); letter-spacing: .04em; }
.bar-label::before { content: ""; width: 12px; height: 1px; background: var(--brand); }
.bar-tools { display: flex; align-items: center; gap: 6px; -webkit-app-region: no-drag; }
.icon-btn {
  width: 28px; height: 28px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line2); border-radius: 8px;
  background: transparent; color: var(--ink2); cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--ink); }
.icon-btn.danger:hover { background: rgba(217, 45, 32, .12); color: var(--bad); }

/* 表单块在栏内垂直居中：只有用户名+密码两格时，顶着上沿会显得下半栏空。
   用 auto 边距而不是 justify-content:center——后者在内容超高时会把顶部切掉，
   而 auto 边距会自行退化为 0，滚动照常从第一格开始。 */
.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 6px 34px 20px; display: flex; flex-direction: column; }
.pane { display: flex; flex-direction: column; gap: 12px; margin: auto 0; width: 100%; }
.pane h2 { margin: 8px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.hint { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--ink2); }
.hint.small { font-size: 11.5px; color: var(--ink3); }

label { display: block; font-size: 12px; color: var(--ink2); }
.label-line { display: flex; align-items: baseline; gap: 6px; }
.opt { font-size: 11px; color: var(--ink3); }
label input, .company-row > input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--line2); border-radius: 10px;
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--card2);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
label input::placeholder, .company-row > input::placeholder { color: var(--ink3); }
label input:focus, .company-row > input:focus {
  outline: none; border-color: var(--brand); background: var(--card);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* 密码框右侧的眼睛 */
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 38px; }
.peek {
  position: absolute; right: 6px; top: calc(50% + 3px); transform: translateY(-50%);
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink3); cursor: pointer;
}
.peek:hover { color: var(--ink); background: var(--brand-soft); }
.peek.on { color: var(--brand); }

/* 企业名称：本机已有企业直接列出来点选，不用回忆当初怎么起的名字 */
.company-row { display: block; }
.company-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.company-picks button {
  padding: 4px 10px; font-size: 11.5px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line2); background: transparent; color: var(--ink2);
  transition: border-color .15s, color .15s, background-color .15s;
}
.company-picks button:hover, .company-picks button.on {
  border-color: var(--brand); color: var(--brand); background: var(--brand-soft);
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row.end { justify-content: flex-end; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink2); }
.chk input { width: auto; margin: 0; accent-color: var(--brand); }

button { font-family: inherit; cursor: pointer; }
button.primary {
  width: 100%; margin-top: 2px; padding: 13px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 22px var(--brand-soft);
  transition: filter .15s, transform .06s;
}
button.primary:hover { filter: brightness(1.06); }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { opacity: .6; cursor: default; filter: none; }
button.ghost {
  width: 100%; padding: 11px; border: 1px solid var(--line2); border-radius: 10px;
  background: transparent; color: var(--ink2); font-size: 13px;
}
button.ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
button.ghost:disabled { color: var(--ink3); cursor: not-allowed; opacity: .7; }
button.link { border: 0; background: none; color: var(--ink3); font-size: 12.5px; padding: 0; }
button.link b { color: var(--brand); font-weight: 600; }
button.link:hover b { text-decoration: underline; }
.row.end button.primary { width: auto; margin-top: 0; padding: 11px 18px; }
.row.end button.ghost { width: auto; padding: 11px 16px; }
.soon { margin-left: 6px; font-size: 11px; color: var(--ink3); }

.or { display: flex; align-items: center; gap: 10px; color: var(--ink3); font-size: 11.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* 报错不当一行秃字：给一条左侧色条的淡底，视线能立刻抓住 */
.err { margin: 0; font-size: 12.5px; color: var(--bad); }
.err:empty { display: none; }
.err:not(:empty) {
  padding: 9px 12px; border-radius: 9px;
  background: var(--bad-bg); border-left: 2px solid var(--bad);
}
/* 报错里带一颗"改成那一家企业"的按钮：企业名选错时不用自己回去重打全称 */
.err > span { display: block; }
.err-fix {
  display: inline-flex; align-items: center; margin-top: 8px; padding: 4px 10px;
  border: 1px solid var(--bad); border-radius: 8px;
  background: transparent; color: var(--bad); font-size: 12px;
}
.err-fix:hover { background: var(--bad); color: #fff; }
.ok { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ok); background: var(--ok-bg); }
.note { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.6; color: var(--ink2); background: var(--card2); }

/* 步骤点 */
.steps { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.dot.on { background: var(--brand); }
.line { flex: 1; max-width: 60px; height: 1px; background: var(--line); }

/* 页脚 */
.panel-foot { flex: none; padding: 14px 34px 18px; border-top: 1px solid var(--line); }
.foot-links { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.foot-links .sep { color: var(--ink3); font-size: 11px; }
.copy { margin: 10px 0 0; font-size: 11px; color: var(--ink3); text-align: center; }

/* ── 桌面壳：整张卡片都能拖窗口 ──
   主窗是无边框的（frame:false），没有拖动区就完全拖不动。
   做法是把整块设为 drag，再把「要点的东西」逐个改回 no-drag——
   漏掉哪个，那个控件就点不动，所以这里把可交互元素一次列全。 */
body.in-shell { -webkit-app-region: drag; }
body.in-shell .shell,
body.in-shell .hero,
body.in-shell .panel-bar { -webkit-app-region: drag; }
body.in-shell .pane,
body.in-shell .panel-body,
body.in-shell .panel-foot,
body.in-shell .bar-tools,
body.in-shell .company-picks,
body.in-shell .foot-links,
body.in-shell button,
body.in-shell input,
body.in-shell label { -webkit-app-region: no-drag; }

/* ── 窄窗口 / 手机：收成一栏，品牌区只留标识和三行话 ── */
@media (max-width: 1000px) {
  body { padding: 16px; align-items: flex-start; overflow: auto; }
  .shell { grid-template-columns: 1fr; max-width: 560px; min-height: 0; max-height: none; margin: auto 0; }
  .hero { padding: 22px 24px 18px; }
  .rings { display: none; }
  .hero h1 { font-size: 21px; margin-bottom: 8px; }
  .lead { font-size: 12.5px; margin-bottom: 0; }
  .chips, .grid4, .hero-foot { display: none; }
  .eyebrow { margin: 16px 0 8px; font-size: 9.5px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .panel-bar { padding: 12px 18px 0; }
  .panel-body { padding: 4px 24px 16px; overflow: visible; }
  .panel-foot { padding: 12px 24px 16px; }
  .pane h2 { font-size: 19px; }
}

@media (max-width: 560px) {
  body { padding: 0; background: var(--card); }
  .bg { display: none; }
  .shell { border: 0; border-radius: 0; max-width: none; }
  .hero { padding: 18px 18px 14px; }
  .hero h1 { font-size: 19px; }
  .panel-body { padding: 4px 18px 14px; }
  .panel-bar { padding: 10px 14px 0; }
  .panel-foot { padding: 12px 18px 16px; }
}

/* ── 窗口矮（小窗、手机横屏）：品牌区只留标识 + 一句话 ──
   620×480 这种尺寸下，品牌区照常铺开会把输入框全挤到折叠线以下，
   人得先滚一屏才看见要填什么。矮窗口里把装饰性内容收掉，先给表单让位。 */
@media (max-height: 640px) {
  .hero { padding: 16px 20px 12px; }
  .eyebrow, .lead, .chips, .grid4, .hero-foot { display: none; }
  .hero h1 { margin: 10px 0 0; font-size: 18px; line-height: 1.3; }
  .panel-bar { padding-top: 10px; }
  .pane { gap: 10px; }
  .pane h2 { margin-top: 4px; font-size: 18px; }
}
/* 更矮：企业微信那行还是个「阶段 6」占位按钮，留着只会把真按钮推下去 */
@media (max-height: 620px) {
  .or, .pane .ghost:disabled { display: none; }
}
/* 再矮（620×480 小窗、手机横屏）：品牌区整块让开，进来就该看见输入框 */
@media (max-height: 560px) {
  .hero { display: none; }
  .panel { border-left: 0; }
  .panel-body { padding: 2px 20px 12px; }
  .panel-foot .copy { display: none; }
  /* 再挤一点：让「进入企业日历」整颗按钮落在首屏里，而不是被下沿切一半 */
  .pane { gap: 9px; }
  .pane h2 { margin-top: 2px; }
  .hint { font-size: 12px; line-height: 1.6; }
  label input, .company-row > input { padding: 10px 12px; }
}
