/* writer · 登录页 */

:root {
  --ink: #232a21;
  --ink-2: #4d554a;
  --muted: #85897d;
  --muted-2: #a2a59a;
  --line: #ded9cb;
  --line-strong: #cfc8b8;
  --cream: #fbf9f3;
  --cream-2: #f4f0e6;
  --paper: #efe8d7;
  --paper-deep: #e2dac6;
  --gold: #b39a68;
  --gold-deep: #9a8051;
  --olive: #29322a;
  --olive-deep: #1e2820;
  --olive-soft: #66725d;
  --red: #9c4d42;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --shadow: 0 32px 90px rgba(35, 40, 31, 0.16);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 255, 255, 0.72), transparent 34%),
    radial-gradient(circle at 88% 96%, rgba(197, 185, 155, 0.22), transparent 34%),
    #f0ece2;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.auth-shell {
  width: min(1600px, calc(100vw - 48px));
  min-height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 27px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

/* ---------------- 左侧品牌区 ---------------- */
.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 38px clamp(34px, 4.2vw, 58px) 30px;
  overflow: hidden;
  color: #f0edde;
  background:
    radial-gradient(ellipse at 12% 4%, rgba(160, 174, 137, 0.22), transparent 44%),
    radial-gradient(ellipse at 92% 88%, rgba(185, 164, 117, 0.12), transparent 42%),
    linear-gradient(145deg, #303b2f 0%, #283229 48%, #202a22 100%);
}
.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
.brand-panel::after {
  content: "";
  position: absolute;
  width: 470px;
  height: 470px;
  left: -190px;
  bottom: -300px;
  border-radius: 50%;
  border: 1px solid rgba(211, 196, 160, 0.12);
  box-shadow: 0 0 0 60px rgba(211, 196, 160, 0.025), 0 0 0 120px rgba(211, 196, 160, 0.018);
  pointer-events: none;
}
.brand-top, .brand-copy, .paper-scene, .brand-foot { position: relative; z-index: 1; }
.brand-top { display: flex; align-items: center; gap: 18px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #f3efdf; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid rgba(229, 215, 178, 0.38);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}
.brand-word { display: flex; flex-direction: column; gap: 1px; }
.brand-word b { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: 0.4px; }
.brand-word small { font-size: 7px; letter-spacing: 1.5px; color: rgba(236, 232, 215, 0.48); text-transform: uppercase; }
.brand-tag {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 9px; letter-spacing: 2.4px; color: rgba(236, 232, 215, 0.48);
}
.brand-tag::before { content: ""; width: 25px; height: 1px; background: rgba(206, 190, 153, 0.35); }

.brand-copy { margin-top: clamp(46px, 8.5vh, 94px); max-width: 540px; }
.eyebrow {
  margin: 0 0 20px;
  font-size: 8.5px; line-height: 1.4;
  letter-spacing: 3.2px; text-transform: uppercase;
  color: rgba(199, 181, 140, 0.78);
}
.brand-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 4.25vw, 66px);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: 2px;
  color: #f0ecdd;
}
.brand-copy h1 em { font-style: normal; color: #c8ab77; }
.brand-copy > p:last-child {
  margin: 25px 0 0;
  font-size: 13.5px;
  line-height: 2;
  letter-spacing: 0.5px;
  color: rgba(236, 232, 215, 0.66);
}

/* 纸张堆叠 */
.paper-scene {
  position: relative;
  width: min(440px, 82%);
  height: clamp(240px, 34vh, 340px);
  margin-top: clamp(28px, 5vh, 54px);
  margin-left: 8px;
  flex: 0 0 auto;
}
.paper {
  position: absolute;
  border-radius: 2px;
}
.paper-back {
  width: min(300px, 74%);
  height: clamp(255px, 31vh, 335px);
  left: 58px; top: 22px;
  background: #d9d2bf;
  opacity: 0.46;
  transform: rotate(8deg);
  box-shadow: 0 18px 40px rgba(9, 15, 10, 0.2);
}
.paper-back.two {
  left: 82px; top: 38px;
  width: min(286px, 70%);
  background: #697364;
  opacity: 0.28;
  transform: rotate(13deg);
}
.paper-front {
  width: min(325px, 79%);
  min-height: clamp(258px, 32vh, 340px);
  left: 30px; top: 2px;
  padding: 27px 28px 22px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.32), transparent 24%),
    linear-gradient(160deg, #f2ecdc 0%, #e7dfcb 100%);
  border: 1px solid rgba(255, 255, 255, 0.48);
  transform: rotate(-7deg);
  box-shadow: 0 30px 55px rgba(8, 13, 9, 0.28);
  color: #4a4335;
}
.paper-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 7.5px; letter-spacing: 1.5px;
  color: #918873;
  border-bottom: 1px solid rgba(126, 112, 84, 0.28);
  padding-bottom: 10px;
}
.paper-top em { font-style: normal; font-family: var(--serif); color: #8a7b5d; }
.paper-front h2 {
  margin: 22px 0 3px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.1vw, 31px);
  font-weight: 500;
  letter-spacing: 3px;
  color: #4b4232;
}
.paper-chapter { margin: 0 0 19px; font-size: 7.5px; letter-spacing: 1.2px; color: #9a907b; }
.paper-excerpt {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(11.5px, 1.1vw, 14px);
  line-height: 2.05;
  letter-spacing: 1px;
  color: #5b5140;
}
.paper-lines { margin-top: 19px; width: 70%; display: flex; flex-direction: column; gap: 7px; }
.paper-lines i { display: block; height: 1px; background: rgba(126, 112, 84, 0.25); }
.paper-lines i:nth-child(2) { width: 83%; }
.paper-lines i:nth-child(3) { width: 58%; }
.paper-seal {
  position: absolute; right: 27px; bottom: 24px;
  width: 31px; height: 31px;
  display: grid; place-items: center;
  border: 1.5px solid rgba(148, 74, 60, 0.68);
  border-radius: 2px;
  color: rgba(148, 74, 60, 0.82);
  font-family: var(--serif);
  font-size: 17px;
  transform: rotate(-5deg);
}
.paper-ribbon {
  position: absolute;
  right: -12px; top: 30px;
  width: 29px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  padding-top: 4px;
  writing-mode: vertical-rl;
  font-size: 7.5px; letter-spacing: 1.5px;
  color: #4d422d;
  background: linear-gradient(180deg, #c8ad79 0%, #b79a66 58%, #9d8153 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 91%, 0 100%);
  box-shadow: 0 6px 16px rgba(9, 13, 9, 0.18);
}
.brand-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(222, 209, 176, 0.14);
  display: flex; justify-content: space-between; gap: 20px;
  font-size: 9px; letter-spacing: 1.6px;
  color: rgba(236, 232, 215, 0.42);
}

/* ---------------- 右侧表单 ---------------- */
.form-panel {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(38px, 7.5vh, 72px) clamp(34px, 6.2vw, 108px) 38px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 85% 8%, rgba(255, 255, 255, 0.8), transparent 40%),
    linear-gradient(135deg, #fcfaf5 0%, #f8f5ed 100%);
}
.form-panel::before {
  content: "";
  position: absolute; inset: 24px;
  border: 1px solid rgba(197, 187, 164, 0.18);
  border-radius: 18px;
  pointer-events: none;
}
.form-wrap { width: min(100%, 490px); position: relative; z-index: 1; }
.form-head { margin-bottom: clamp(34px, 5.4vh, 55px); }
.form-head .eyebrow { color: #8c9084; margin-bottom: 15px; letter-spacing: 2.4px; }
.form-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(33px, 3.2vw, 45px);
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.3;
  color: #293027;
}
.form-head .form-sub {
  margin: 13px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: #8c9084;
}

.auth-field { margin-bottom: clamp(18px, 2.8vh, 28px); }
.field-label {
  display: block;
  margin-bottom: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: #4d5449;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 55px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.72);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input-wrap:focus-within {
  border-color: #9ba889;
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(122, 139, 105, 0.09);
}
.input-icon { width: 17px; height: 17px; flex: 0 0 17px; color: #a8a58f; }
.input-wrap input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 11px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #333a30;
  font-size: 14px;
  letter-spacing: 0.2px;
}
.input-wrap input::placeholder { color: #b4b1a6; }
.secret-input { -webkit-text-security: disc; letter-spacing: 1.5px; }
.secret-input.is-revealed { -webkit-text-security: none; letter-spacing: 0.2px; }
.input-wrap input:-webkit-autofill { -webkit-text-fill-color: #333a30; -webkit-box-shadow: 0 0 0 40px #fffdf8 inset; }
.eye-toggle, .code-btn {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.eye-toggle {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #9d9b8e;
}
.eye-toggle:hover { background: rgba(104, 114, 91, 0.08); color: #5d6957; }
.eye-toggle svg { width: 17px; height: 17px; }
.eye-toggle .eye-closed { display: none; }
.eye-toggle.is-visible .eye-open { display: none; }
.eye-toggle.is-visible .eye-closed { display: block; }
.code-btn {
  height: 30px;
  padding: 0 10px;
  border-left: 1px solid var(--line);
  color: #667458;
  font-size: 11px;
  white-space: nowrap;
}
.code-btn:hover { color: #3d4b36; }
.code-btn:disabled { color: #adafa4; cursor: default; }
.field-note {
  margin: 7px 0 0;
  min-height: 15px;
  font-size: 10px;
  line-height: 1.5;
  color: #a4a69a;
}
.field-note.is-warn { color: #a25b4d; }
.auth-field.is-invalid .input-wrap { border-color: rgba(156, 77, 66, 0.55); background: #fffaf7; }
.demo-code {
  margin: 8px 0 0;
  padding: 7px 9px;
  border: 1px dashed rgba(179, 154, 104, 0.55);
  border-radius: 5px;
  background: rgba(179, 154, 104, 0.06);
  color: #8d7549;
  font-size: 10px;
  line-height: 1.5;
}
.demo-code.is-live {
  border-color: rgba(103, 132, 89, 0.3);
  background: rgba(103, 132, 89, 0.07);
  color: #5e7451;
}
.form-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: clamp(4px, 1.2vh, 10px) 0 clamp(32px, 5vh, 50px);
}
.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #69745f;
  font-size: 11.5px;
  cursor: pointer;
  transition: color 0.16s;
}
.text-link:hover { color: #2f3a2b; text-decoration: underline; text-underline-offset: 4px; }
.form-error {
  display: flex; align-items: flex-start; gap: 7px;
  min-height: 18px;
  margin: 0 0 10px;
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.55;
}
.form-error::before {
  content: "!";
  width: 14px; height: 14px;
  flex: 0 0 14px;
  display: grid; place-items: center;
  border: 1px solid rgba(156, 77, 66, 0.55);
  border-radius: 50%;
  font-size: 9px;
  line-height: 1;
  margin-top: 1px;
}
.submit-btn {
  width: 100%;
  height: 57px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0;
  border-radius: 8px;
  background: #29331f;
  color: #f8f4e7;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.2px;
  cursor: pointer;
  box-shadow: 0 13px 26px rgba(39, 49, 31, 0.15);
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
}
.submit-btn:hover { background: #1f2818; transform: translateY(-1px); box-shadow: 0 17px 30px rgba(39, 49, 31, 0.2); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.72; cursor: default; transform: none; }
.submit-btn .arrow { width: 16px; height: 16px; transition: transform 0.18s; }
.submit-btn:hover .arrow { transform: translateX(3px); }
.spinner {
  width: 15px; height: 15px;
  border: 1.5px solid rgba(248, 244, 231, 0.3);
  border-top-color: #f8f4e7;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.switch-line {
  margin: clamp(24px, 3.8vh, 38px) 0 0;
  text-align: center;
  color: #909387;
  font-size: 11.5px;
}
.switch-line .text-link { color: #424d3b; font-size: 11.5px; margin-left: 1px; }
.trust-line {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: clamp(48px, 8.5vh, 82px);
  padding-top: clamp(19px, 2.8vh, 27px);
  border-top: 1px solid #e9e4d8;
  color: #a3a499;
  font-size: 10px;
  letter-spacing: 0.6px;
}
.trust-line svg { width: 14px; height: 14px; color: #b4a681; }
.local-note {
  margin: 10px 0 0;
  text-align: center;
  color: #b0b1a6;
  font-size: 9px;
  line-height: 1.6;
}

/* ---------------- 已登录提示 ---------------- */
.session-banner {
  display: flex; align-items: center; gap: 9px;
  margin: -12px 0 24px;
  padding: 10px 12px;
  border: 1px solid rgba(122, 139, 105, 0.22);
  border-radius: 7px;
  background: rgba(122, 139, 105, 0.06);
  color: #68745e;
  font-size: 10.5px;
  line-height: 1.55;
}
.session-banner b { color: #3d4937; font-weight: 500; }
.session-banner .session-go { margin-left: auto; white-space: nowrap; }

/* ---------------- 找回密码弹窗 ---------------- */
.auth-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(25, 31, 24, 0.5);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.18s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.auth-modal-card {
  width: min(100%, 460px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 31px 32px 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  background: var(--cream);
  box-shadow: 0 30px 80px rgba(19, 25, 19, 0.28);
  animation: riseIn 0.22s ease-out;
}
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.auth-modal-card .eyebrow { margin-bottom: 10px; color: #979b8e; }
.auth-modal-card h2 { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: 1.5px; color: #333b2f; }
.auth-modal-card .modal-sub { margin: 10px 0 22px; font-size: 11px; line-height: 1.7; color: #95988d; }
.modal-close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: #8b8e83;
  cursor: pointer;
}
.modal-close:hover { color: #3d4638; border-color: var(--line-strong); }
.modal-close svg { width: 14px; height: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }
.btn-ghost, .btn-dark {
  height: 40px;
  padding: 0 17px;
  border-radius: 7px;
  font-size: 11.5px;
  cursor: pointer;
}
.btn-ghost { border: 1px solid var(--line); background: transparent; color: #717a6b; }
.btn-ghost:hover { border-color: var(--line-strong); color: #3d4638; }
.btn-dark { border: 1px solid #29331f; background: #29331f; color: #f8f4e7; }
.btn-dark:hover { background: #1f2818; }

/* ---------------- toast ---------------- */
.auth-toast {
  position: fixed;
  left: 50%; bottom: 30px;
  z-index: 120;
  transform: translate(-50%, 12px);
  max-width: min(90vw, 460px);
  padding: 11px 17px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(34, 43, 33, 0.96);
  box-shadow: 0 14px 36px rgba(20, 26, 19, 0.25);
  color: #f2eedf;
  font-size: 11.5px;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.auth-toast.show { opacity: 1; transform: translate(-50%, 0); }
.auth-toast.error { background: #5c302b; }

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .auth-shell { width: calc(100vw - 28px); margin: 14px auto; max-height: calc(100vh - 28px); min-height: calc(100vh - 28px); }
  .brand-panel { padding: 28px 30px 24px; }
  .brand-copy h1 { font-size: clamp(38px, 4.4vw, 52px); }
  .brand-copy > p:last-child { font-size: 12px; }
  .paper-scene { width: 380px; transform: scale(0.88); transform-origin: left top; margin-top: 22px; }
  .brand-foot { font-size: 8px; }
  .form-panel { padding: 34px 42px; }
  .form-wrap { max-width: 440px; }
}

@media (max-width: 860px) {
  body { background: var(--cream); }
  .auth-shell {
    width: 100%;
    min-height: 100vh;
    max-height: none;
    margin: 0;
    display: block;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .brand-panel { min-height: 0; padding: 26px 24px 25px; }
  .brand-copy { margin-top: 38px; }
  .brand-copy h1 { font-size: clamp(35px, 8vw, 48px); line-height: 1.26; }
  .brand-copy > p:last-child { margin-top: 15px; font-size: 12px; line-height: 1.8; }
  .brand-top { gap: 10px; }
  .brand-tag { font-size: 8px; letter-spacing: 1.4px; }
  .brand-tag::before { width: 14px; }
  .paper-scene { display: none; }
  .brand-foot { display: none; }
  .form-panel {
    display: block;
    padding: 34px 24px 46px;
    overflow: visible;
    border-radius: 24px 24px 0 0;
    background: var(--cream);
  }
  .form-panel::before { display: none; }
  .form-wrap { max-width: 520px; margin: 0 auto; }
  .form-head { margin-bottom: 25px; }
  .form-head h1 { font-size: 32px; }
  .form-head .eyebrow { margin-bottom: 10px; }
  .form-head .form-sub { margin-top: 9px; }
  .input-wrap { height: 52px; }
  .trust-line { margin-top: 34px; }
}

@media (max-width: 520px) {
  .brand-panel { padding: 22px 20px 23px; }
  .brand-word small { display: none; }
  .brand-tag { display: none; }
  .brand-copy { margin-top: 28px; }
  .brand-copy h1 { font-size: 33px; letter-spacing: 1px; }
  .brand-copy > p:last-child { font-size: 11.5px; }
  .form-panel { padding: 28px 20px 38px; }
  .form-head h1 { font-size: 29px; }
  .form-links { margin-bottom: 22px; }
  .submit-btn { height: 53px; }
  .auth-modal-card { padding: 25px 21px 22px; }
  .auth-modal-card h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
