/* ==========================================================
   拾遗 · 登录页（后台入口）
   宣纸底 + 水墨远山 + 朱红印记，与长卷同一套主题语言
   ========================================================== */

:root{
  --ink:#2b1c12;
  --ink-soft:rgba(43,28,18,.62);
  --ink-faint:rgba(43,28,18,.42);
  --paper:#f4ecdd;
  --card:#fffdf7;
  --gold:#b0863f;
  --gold-line:rgba(176,134,63,.28);
  --red:#8e2b1f;
  --red-lit:#a83424;
  --serif:"Source Han Serif SC","Noto Serif SC","Songti SC","STSong","SimSun",serif;
  --sans:"PingFang SC","Microsoft YaHei","Hiragino Sans GB","Source Han Sans SC",system-ui,sans-serif;
  --ease:cubic-bezier(.22,.61,.24,1);
}

*{margin:0;padding:0;box-sizing:border-box}
html,body{min-height:100%}
body{
  font-family:var(--sans);
  color:var(--ink);
  background:
    radial-gradient(120% 96% at 82% -6%, #fdf8ee 0%, #f6edda 36%, #eee1cb 68%, #e6d7bf 100%);
  min-height:100vh;
  display:flex;
  flex-direction:column;
  -webkit-font-smoothing:antialiased;
  position:relative;
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
button{font-family:inherit;cursor:pointer;border:0;background:none;color:inherit}
input{font-family:inherit}
img{display:block}
:focus-visible{outline:2px solid var(--gold);outline-offset:3px}

/* ---------- 纸面肌理 ---------- */
.grain{
  position:fixed;inset:0;z-index:0;pointer-events:none;
  opacity:.5;mix-blend-mode:multiply;
}

/* ---------- 水墨远山 / 云纹 ---------- */
.ink-bg{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.ink-bg svg{position:absolute}
.ink-hills{left:-6%;bottom:-4%;width:106%;height:66%;opacity:.5}
.ink-cloud{right:-8%;top:-6%;width:62%;height:70%;opacity:.36}
.ink-branch{left:2%;top:6%;width:30%;height:44%;opacity:.22}

/* ---------- 顶栏 ---------- */
.lg-top{
  position:relative;z-index:3;
  display:flex;align-items:center;justify-content:space-between;
  padding:26px clamp(20px,4vw,58px);
}
.brand{display:flex;align-items:center;gap:13px}
.brand img{width:42px;height:42px;border-radius:4px}
.brand-text{display:flex;flex-direction:column;gap:2px}
.brand-text strong{
  font-family:var(--serif);font-size:19px;font-weight:600;letter-spacing:.18em;
  color:#3a2517;
}
.brand-text em{
  font-style:normal;font-size:10.5px;letter-spacing:.24em;
  color:var(--ink-faint);
}
.back{
  display:inline-flex;align-items:center;gap:8px;
  font-size:12.5px;letter-spacing:.16em;color:var(--ink-soft);
  padding:9px 16px;border:1px solid var(--gold-line);border-radius:999px;
  transition:all .35s var(--ease);
  background:rgba(255,253,247,.5);
}
.back i{font-style:normal;transition:transform .35s var(--ease)}
.back:hover{color:var(--red);border-color:rgba(142,43,31,.4);background:#fffdf7}
.back:hover i{transform:translateX(-3px)}

/* ---------- 主体两栏 ---------- */
.lg-wrap{
  position:relative;z-index:2;flex:1;
  display:grid;
  grid-template-columns:minmax(320px,1fr) minmax(380px,430px);
  align-items:center;
  gap:clamp(28px,4vw,72px);
  padding:clamp(12px,2vw,36px) clamp(20px,5vw,70px) clamp(20px,2.4vw,44px);
  max-width:1160px;width:100%;margin:0 auto;
}

/* 左：题名 */
.lg-intro{align-self:center}
.lg-eyebrow{
  font-size:11.5px;letter-spacing:.4em;color:var(--ink-faint);
  margin-bottom:20px;
}
.lg-eyebrow::before{
  content:"";display:inline-block;width:26px;height:1px;
  background:var(--gold);vertical-align:middle;margin-right:12px;
}
.lg-intro h1{
  font-family:var(--serif);
  font-size:clamp(34px,3.5vw,56px);
  line-height:1.26;font-weight:600;letter-spacing:.06em;
  color:#2e1d11;
}
.lg-intro h1 em{
  display:block;font-style:normal;
  margin-top:6px;
  font-size:clamp(24px,2.3vw,36px);
  letter-spacing:.16em;
  color:#4a3220;
}
.lg-rule{
  width:74px;height:1px;background:linear-gradient(90deg,var(--gold),rgba(176,134,63,0));
  margin:26px 0 20px;
}
.lg-sub{
  font-size:clamp(13px,1.1vw,15.5px);line-height:1.9;letter-spacing:.12em;
  color:var(--ink-soft);max-width:22em;
}
.lg-tags{
  display:flex;flex-wrap:wrap;gap:9px;margin-top:28px;
}
.lg-tags span{
  font-size:11px;letter-spacing:.18em;color:#6c5138;
  padding:6px 12px;border:1px solid var(--gold-line);border-radius:3px;
  background:rgba(255,253,247,.55);
}

/* 中：登录卡 */
.lg-card{
  position:relative;
  background:var(--card);
  border:1px solid rgba(176,134,63,.22);
  border-radius:16px;
  padding:clamp(26px,2.6vw,38px) clamp(24px,2.4vw,34px) 26px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.9) inset,
    0 24px 60px -28px rgba(74,46,20,.34),
    0 4px 16px -8px rgba(74,46,20,.16);
  width:100%;
}
.lg-card::before{
  content:"";position:absolute;left:0;right:0;top:0;height:3px;
  border-radius:16px 16px 0 0;
  background:linear-gradient(90deg,rgba(176,134,63,0),var(--gold) 32%,var(--gold) 68%,rgba(176,134,63,0));
  opacity:.55;
}
.lg-card-head{
  display:flex;align-items:center;justify-content:center;gap:11px;
  margin-bottom:10px;
}
.lg-card-head .seal{
  width:34px;height:36px;border-radius:5px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#9d3123,#7c2419);
  box-shadow:0 4px 12px -4px rgba(142,43,31,.55);
  color:#f7e6d2;font-family:var(--serif);font-size:13px;line-height:1.05;
  letter-spacing:0;padding-top:1px;
}
.lg-card-head .seal span{display:block}
.lg-card-head h2{
  font-family:var(--serif);font-size:26px;font-weight:600;letter-spacing:.22em;
  color:#31200f;
}
.lg-divider{
  display:flex;align-items:center;gap:12px;
  font-size:10.5px;letter-spacing:.2em;color:var(--ink-faint);
  margin:14px 0 18px;
}
.lg-divider::before,.lg-divider::after{
  content:"";flex:1;height:1px;background:linear-gradient(90deg,rgba(176,134,63,0),var(--gold-line),rgba(176,134,63,0));
}

/* ---------- 登录 / 注册 选项卡 ---------- */
.lg-tabs{
  position:relative;display:grid;grid-template-columns:1fr 1fr;
  border-bottom:1px solid rgba(74,46,20,.12);
  margin:0 0 18px;
}
.lg-tabs .tab{
  position:relative;padding:0 0 12px;
  font-size:14.5px;letter-spacing:.18em;text-indent:.18em;
  color:rgba(43,28,18,.44);font-weight:400;
  transition:color .3s var(--ease);
}
.lg-tabs .tab:hover{color:#6c5138}
.lg-tabs .tab.on{color:#3a2517;font-weight:600}
.lg-tabs .tab:focus-visible{outline:2px solid var(--gold);outline-offset:-2px;border-radius:4px}
.lg-tabs .tab-ink{
  position:absolute;left:0;bottom:-1px;width:50%;height:2px;
  background:linear-gradient(90deg,rgba(142,43,31,0),var(--red) 18%,var(--red) 82%,rgba(142,43,31,0));
  transition:transform .42s var(--ease);
}
.lg-card.reg-mode .lg-tabs .tab-ink{transform:translateX(100%)}

/* 两个面板叠同一格：切换时高度不跳 */
.lg-panes{display:grid}
.pane{
  grid-area:1/1;
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .34s var(--ease),visibility .34s;
}
.pane.on{opacity:1;visibility:visible;pointer-events:auto}

/* 输入 */
.field{
  display:block;margin-bottom:12px;
}
.f-label{
  display:block;margin-bottom:8px;
  font-size:12.5px;letter-spacing:.1em;color:#4a3220;
}
.f-box{position:relative;display:block}
.f-box .ico{
  position:absolute;left:15px;top:50%;transform:translateY(-50%);
  width:17px;height:17px;stroke:#a98d63;fill:none;stroke-width:1.5;
  pointer-events:none;transition:stroke .3s;
}
.field input{
  width:100%;height:50px;
  padding:0 16px 0 44px;
  font-size:14.5px;letter-spacing:.02em;
  color:#301f0f;
  background:#fbf7ed;
  border:1px solid rgba(74,46,20,.14);
  border-radius:10px;
  transition:border-color .3s var(--ease),background .3s var(--ease),box-shadow .3s var(--ease);
}
.field input::placeholder{color:rgba(74,46,20,.34);letter-spacing:.14em;font-size:13px}
.field input:hover{border-color:rgba(74,46,20,.26)}
.field input:focus{
  outline:none;background:#fffdf7;
  border-color:rgba(176,134,63,.75);
  box-shadow:0 0 0 3px rgba(176,134,63,.13);
}
.field:focus-within .ico{stroke:var(--gold)}
.field.bad input{border-color:rgba(168,52,36,.62);background:#fdf5f1}
.field.bad .ico{stroke:#a83424}
.eye{
  position:absolute;right:8px;top:50%;transform:translateY(-50%);
  width:34px;height:34px;display:grid;place-items:center;border-radius:8px;
  color:#a98d63;transition:color .3s,background .3s;
}
.eye svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.5}
.eye:hover{color:#6c5138;background:rgba(176,134,63,.1)}

/* 记住我 / 忘记密码 */
.lg-row{
  display:flex;align-items:center;justify-content:space-between;
  margin:4px 0 20px;
}
.check{
  display:inline-flex;align-items:center;gap:9px;
  font-size:12.5px;color:var(--ink-soft);cursor:pointer;user-select:none;
}
.check input{position:absolute;opacity:0;width:0;height:0}
.check i{
  width:15px;height:15px;border:1px solid rgba(74,46,20,.3);border-radius:3px;
  background:#fbf7ed;position:relative;transition:all .25s var(--ease);
}
.check i::after{
  content:"";position:absolute;left:4px;top:1px;
  width:5px;height:9px;border:solid #fffdf7;border-width:0 1.6px 1.6px 0;
  transform:rotate(42deg) scale(0);transition:transform .25s var(--ease);
}
.check input:checked + i{background:var(--red);border-color:var(--red)}
.check input:checked + i::after{transform:rotate(42deg) scale(1)}
.check input:focus-visible + i{box-shadow:0 0 0 3px rgba(176,134,63,.25)}
.link{
  font-size:12.5px;color:var(--ink-soft);letter-spacing:.04em;
  border-bottom:1px solid transparent;transition:all .3s;
}
.link:hover{color:var(--red);border-bottom-color:rgba(142,43,31,.4)}

/* 按钮 */
.btn-enter{
  position:relative;width:100%;height:50px;
  display:flex;align-items:center;justify-content:center;gap:10px;
  font-size:15px;letter-spacing:.34em;text-indent:.34em;
  color:#f8ecdd;
  background:linear-gradient(160deg,#9a3223,#7d2419);
  border-radius:10px;
  box-shadow:0 12px 26px -12px rgba(142,43,31,.75),0 1px 0 rgba(255,255,255,.14) inset;
  transition:transform .28s var(--ease),box-shadow .28s var(--ease),background .28s;
  overflow:hidden;
}
.btn-enter:hover{
  background:linear-gradient(160deg,#ac3a29,#8a281b);
  transform:translateY(-1px);
  box-shadow:0 16px 30px -12px rgba(142,43,31,.8),0 1px 0 rgba(255,255,255,.16) inset;
}
.btn-enter:active{transform:translateY(0);box-shadow:0 8px 18px -12px rgba(142,43,31,.8)}
.btn-enter::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(100deg,rgba(255,255,255,0) 38%,rgba(255,255,255,.22) 50%,rgba(255,255,255,0) 62%);
  transform:translateX(-110%);
}
.btn-enter:hover::after{animation:sheen 1.1s var(--ease)}
@keyframes sheen{to{transform:translateX(110%)}}
.btn-enter[disabled]{cursor:progress;opacity:.86;transform:none}
.btn-enter .spin{
  width:15px;height:15px;border-radius:50%;
  border:2px solid rgba(248,236,221,.35);border-top-color:#f8ecdd;
  animation:spin .8s linear infinite;display:none;
}
@keyframes spin{to{transform:rotate(360deg)}}
.btn-enter.loading .spin{display:block}
.btn-enter.loading span{opacity:.75}
.btn-enter .btn-ico{
  width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round;opacity:.9;flex:none;
}

/* ---------- 社交账号登录 ---------- */
.lg-divider.social{margin:18px 0 12px;font-size:10.5px}
.social-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.sbtn{
  display:flex;align-items:center;justify-content:center;
  height:44px;border-radius:10px;
  border:1px solid rgba(74,46,20,.14);
  background:#fffdf7;
  transition:transform .28s var(--ease),border-color .28s,box-shadow .28s,background .28s;
}
.sbtn svg{width:21px;height:21px;display:block}
.s-wechat svg{width:23px;height:23px}
.s-wechat{color:#07c160}
.s-qq{color:#12b7f5}
.s-weibo{color:#e6162d}
.sbtn:hover{
  transform:translateY(-1px);
  border-color:rgba(176,134,63,.5);
  box-shadow:0 10px 20px -14px rgba(74,46,20,.6);
}
.sbtn:active{transform:translateY(0)}
.sbtn.loading{opacity:.6;cursor:progress}

/* 登录 / 注册 互跳 */
.lg-switch{
  margin:16px 0 0;text-align:center;
  font-size:12px;letter-spacing:.06em;color:var(--ink-faint);
}
.lg-switch a{
  color:var(--red);margin-left:5px;padding-bottom:1px;
  border-bottom:1px solid rgba(142,43,31,.3);
  transition:color .3s,border-color .3s;
}
.lg-switch a:hover{color:var(--red-lit);border-bottom-color:var(--red-lit)}

/* 提示 */
.lg-err{
  min-height:17px;margin:-6px 0 10px;
  font-size:12px;color:#a83424;letter-spacing:.04em;
  opacity:0;transform:translateY(-3px);transition:all .3s var(--ease);
}
.lg-err.on{opacity:1;transform:none}
.lg-err.hint{color:#6c5138}
.lg-note{
  display:flex;align-items:center;justify-content:center;gap:7px;
  margin-top:16px;padding-top:12px;
  border-top:1px dashed rgba(176,134,63,.32);
  font-size:11px;letter-spacing:.06em;color:var(--ink-faint);
}
.lg-note svg{width:13px;height:13px;stroke:var(--gold);fill:none;stroke-width:1.4;flex:none}

/* 底栏 */
.lg-foot{
  position:relative;z-index:2;
  padding:0 clamp(20px,5vw,70px) 24px;
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  font-size:11px;letter-spacing:.14em;color:rgba(74,46,20,.42);
}
.lg-foot .dot{margin:0 8px;color:var(--gold)}

/* ---------- 成功态 ---------- */
.done{
  display:none;text-align:center;padding:14px 4px 6px;
}
.lg-card.done-on .lg-tabs,
.lg-card.done-on .lg-panes,
.lg-card.done-on .lg-divider,
.lg-card.done-on .lg-note,
.lg-card.done-on .lg-card-head{display:none}
.lg-card.done-on .done{display:block;animation:rise .5s var(--ease) both}
@keyframes rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.done .stamp{
  width:76px;height:76px;margin:4px auto 18px;border-radius:8px;
  display:grid;place-items:center;
  border:2px solid rgba(142,43,31,.72);
  color:var(--red);font-family:var(--serif);font-size:26px;line-height:1.1;
  letter-spacing:.06em;
  transform:rotate(-6deg);
  box-shadow:0 8px 20px -12px rgba(142,43,31,.6);
}
.done h3{font-family:var(--serif);font-size:20px;letter-spacing:.18em;color:#31200f;margin-bottom:10px}
.done p{font-size:12.5px;line-height:1.9;color:var(--ink-soft);letter-spacing:.06em;margin-bottom:20px}
.done .btn-enter{height:44px;font-size:13.5px;letter-spacing:.24em}
.done-back{
  display:block;margin:14px auto 0;
  font-size:12px;letter-spacing:.1em;color:var(--ink-soft);
  border-bottom:1px solid transparent;padding-bottom:2px;
  transition:color .3s,border-color .3s;
}
.done-back:hover{color:var(--red);border-bottom-color:rgba(142,43,31,.4)}

/* ---------- 响应式 ---------- */
@media (max-width:1240px){
  .lg-wrap{grid-template-columns:minmax(300px,1fr) minmax(360px,410px)}
}
@media (max-width:900px){
  .lg-wrap{
    grid-template-columns:1fr;
    justify-items:center;
    gap:26px;
    padding-top:8px;
  }
  .lg-intro{text-align:center;max-width:560px}
  .lg-eyebrow::before{display:none}
  .lg-rule{margin:20px auto 16px}
  .lg-sub{margin:0 auto}
  .lg-tags{justify-content:center}
  .lg-card{max-width:430px}
  .lg-foot{flex-direction:column;gap:6px;text-align:center}
}
@media (max-width:520px){
  .lg-top{padding:18px}
  .brand-text em{display:none}
  .lg-card{padding:24px 20px 22px;border-radius:14px}
  .lg-intro h1{font-size:30px}
  .lg-tags{display:none}
  .lg-foot{font-size:10px}
}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001s !important;transition-duration:.001s !important}
}
