:root {
  --paper: #f4f0e8;
  --paper-soft: #faf8f3;
  --paper-warm: #ebe3d7;
  --ink: #1e241f;
  --muted: #6f746e;
  --green: #1f3c31;
  --green-deep: #162c24;
  --copper: #a36f4c;
  --line: rgba(30, 36, 31, .14);
  --line-strong: rgba(30, 36, 31, .26);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Times New Roman", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper-soft);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper-soft);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

.login-page {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-columns: minmax(420px, .94fr) minmax(500px, 1.06fr);
}

.login-visual {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  background: var(--green-deep);
}

.login-visual__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% center;
  animation: visual-in 1.4s var(--ease) both;
}

.login-visual::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 29, 24, .42) 0%, rgba(15, 29, 24, .05) 42%, rgba(15, 29, 24, .78) 100%),
    linear-gradient(90deg, rgba(15, 29, 24, .2), transparent 55%);
  content: "";
  pointer-events: none;
}

.login-visual__inner {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(30px, 4.2vw, 64px);
  color: #fff;
}

.login-brand {
  display: inline-flex;
  width: max-content;
  flex-direction: column;
  line-height: 1;
}

.login-brand__cn {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: .22em;
}

.login-brand__en {
  margin-top: 8px;
  color: rgba(255, 255, 255, .68);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .29em;
}

.login-visual__copy { max-width: 510px; }

.login-visual__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: #e0b996;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.login-visual__eyebrow::before {
  width: 28px;
  height: 1px;
  background: currentColor;
  content: "";
}

.login-visual__copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 400;
  letter-spacing: .04em;
  line-height: 1.34;
}

.login-visual__copy p {
  max-width: 440px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  letter-spacing: .05em;
  line-height: 2;
}

.login-visual__stamp {
  position: absolute;
  z-index: 2;
  right: clamp(24px, 4vw, 54px);
  bottom: clamp(28px, 4vw, 58px);
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  background: rgba(19, 42, 33, .16);
  color: #fff;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .18em;
  line-height: 1.8;
  text-align: center;
  backdrop-filter: blur(8px);
}

.login-panel {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  padding: 28px clamp(34px, 6vw, 96px) 24px;
  background:
    radial-gradient(640px 320px at 110% -10%, rgba(163, 111, 76, .11), transparent 64%),
    var(--paper-soft);
}

.login-panel__top {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: flex-end;
}

.login-home-link {
  position: relative;
  padding: 9px 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .1em;
}

.login-home-link::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  background: var(--green);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease);
}

.login-home-link:hover { color: var(--green); }
.login-home-link:hover::after { transform: scaleX(1); transform-origin: left; }

.login-panel__main {
  display: flex;
  width: min(100%, 450px);
  flex: 1;
  flex-direction: column;
  justify-content: center;
  margin: 30px auto;
  animation: form-in .75s var(--ease) both;
}

.login-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--copper);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.login-eyebrow::before {
  width: 28px;
  height: 1px;
  background: currentColor;
  content: "";
}

.login-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4.5vw, 56px);
  font-weight: 400;
  letter-spacing: .04em;
  line-height: 1.28;
}

.login-intro {
  margin: 18px 0 34px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
  line-height: 1.85;
}

.flash-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.flash {
  padding: 12px 14px;
  border-left: 2px solid;
  background: var(--paper);
  font-size: 13px;
  line-height: 1.6;
}

.flash.danger,
.flash.error {
  border-color: #9b4933;
  background: #f9eeea;
  color: #8c3d2a;
}

.flash.warning {
  border-color: #b8883b;
  background: #fbf4e4;
  color: #806028;
}

.flash.success {
  border-color: #4e715f;
  background: #edf4ef;
  color: #315742;
}

.flash.info {
  border-color: #657b72;
  background: #eef2ef;
  color: #43584f;
}

.login-form { display: grid; gap: 22px; }

.login-field { display: grid; gap: 8px; }

.login-label {
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
}

.login-input-wrap { position: relative; }

.login-input {
  width: 100%;
  height: 56px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  font-size: 15px;
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.login-input::placeholder { color: rgba(111, 116, 110, .7); }

.login-input:focus {
  border-color: var(--green);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 60, 49, .09);
}

.login-input--password { padding-right: 78px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
  transform: translateY(-50%);
}

.password-toggle:hover {
  border-color: currentColor;
  color: var(--green);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: -4px;
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.remember-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--green);
}

.remember-option label { cursor: pointer; user-select: none; }

.login-security-note {
  color: rgba(111, 116, 110, .78);
  font-size: 10px;
  letter-spacing: .04em;
}

.login-submit {
  display: inline-flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  transition: background .3s ease, transform .3s var(--ease), opacity .3s ease;
}

.login-submit::after {
  width: 8px;
  height: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform .3s var(--ease);
}

.login-submit:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
}

.login-submit:hover::after { transform: translateX(4px) rotate(45deg); }
.login-submit:disabled { cursor: wait; opacity: .65; transform: none; }

.login-support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.login-support a {
  border-bottom: 1px solid rgba(31, 60, 49, .34);
  color: var(--green);
}

.login-support a:hover { border-color: var(--green); }

.login-notice {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.login-notice summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--green);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .08em;
  list-style: none;
}

.login-notice summary::-webkit-details-marker { display: none; }

.login-notice summary::after {
  color: var(--muted);
  content: "展开 ＋";
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .06em;
}

.login-notice[open] summary::after { content: "收起 －"; }

.login-notice__content {
  max-height: 240px;
  overflow: auto;
  padding: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.login-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: rgba(111, 116, 110, .7);
  font-size: 9px;
  letter-spacing: .1em;
}

.login-panel__footer span:last-child { text-align: right; }

@keyframes visual-in {
  from { opacity: 0; transform: scale(1.045); }
  to { opacity: 1; transform: none; }
}

@keyframes form-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .login-page { grid-template-columns: minmax(340px, .82fr) minmax(440px, 1.18fr); }
  .login-visual__stamp { display: none; }
  .login-visual__copy h2 { font-size: 38px; }
}

@media (max-width: 760px) {
  .login-page { display: block; }
  .login-visual { min-height: 250px; height: 32vh; max-height: 330px; }
  .login-visual__inner { padding: 24px; }
  .login-visual__copy { display: none; }
  .login-visual__image { object-position: center 44%; }
  .login-panel { min-height: auto; padding: 18px 22px 24px; }
  .login-panel__top { min-height: 34px; }
  .login-panel__main { margin: 32px auto 52px; }
  .login-title { font-size: 40px; }
}

@media (max-width: 480px) {
  .login-visual { min-height: 190px; height: 25vh; }
  .login-visual__inner { padding: 19px 18px; }
  .login-brand__cn { font-size: 21px; }
  .login-panel { padding-inline: 18px; }
  .login-panel__main { margin-top: 24px; }
  .login-title { font-size: 35px; }
  .login-intro { margin-bottom: 28px; }
  .login-form { gap: 18px; }
  .login-options { align-items: flex-start; flex-direction: column; gap: 8px; }
  .login-support { align-items: flex-start; flex-direction: column; gap: 9px; }
  .login-panel__footer { align-items: flex-start; flex-direction: column; }
  .login-panel__footer span:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
