@charset "UTF-8";

:root {
  --paper: #fcf8ed;
  --paper-light: #fcf8ed;
  --ink: #463712;
  --heading: #463712;
  --muted: #463712;
  --sage: #fcf8ed;
  --sage-deep: #463712;
  --pear: #ffe9b4;
  --line: rgba(70, 55, 18, .18);
  --danger: #463712;
}

* { box-sizing: border-box; }
body {
  min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper);
  font-family: "Source Han Sans SC", "Source Han Sans CN", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; font-weight: 700; line-height: 1.6;
}
button, input { font: inherit; }
.auth-shell { width: min(calc(100% - 32px), 520px); margin: 0 auto; padding: 42px 0 70px; }
.auth-shell-wide { width: min(calc(100% - 40px), 1180px); }
.auth-brand { display: flex; align-items: center; gap: .55rem; width: fit-content; margin-bottom: 52px; color: inherit; font-size: 15px; font-weight: 700; line-height: 1; text-decoration: none; }
.auth-brand strong, .auth-brand span { color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: normal; }
.auth-card, .admin-card { padding: clamp(28px, 6vw, 48px); border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 28px 80px rgba(70,55,18,.08); }
.auth-kicker { margin: 0 0 1rem; color: var(--sage-deep); font-size: .72rem; font-weight: 700; letter-spacing: .16em; }
h1 { margin: 0; color: var(--heading); font-family: "Source Han Sans SC", "Source Han Sans CN", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 900; line-height: 1.16; letter-spacing: -.045em; }
h2 { margin: 0; color: var(--heading); font-family: "Source Han Sans SC", "Source Han Sans CN", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; font-size: 1.35rem; font-weight: 900; letter-spacing: -.04em; }
.auth-intro { margin: 1rem 0 2.2rem; color: var(--muted); }
.auth-form { display: grid; gap: 1rem; }
label { display: grid; gap: .45rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
input { width: 100%; min-height: 48px; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--ink); background: var(--paper); }
input:focus { border-color: var(--sage-deep); box-shadow: 0 0 0 3px rgba(82,98,71,.12); }
button { border: 0; cursor: pointer; }
.auth-form button, .create-form > button { display: flex; justify-content: space-between; align-items: center; min-height: 50px; margin-top: .5rem; padding: .7rem 1.1rem; border-radius: 999px; background: var(--pear); color: var(--ink); font-weight: 700; }
.back-link { display: inline-block; margin-top: 1.5rem; color: var(--muted); font-size: .78rem; text-decoration: none; }
.account-help-link { display: block; width: fit-content; margin: 24px auto 0; color: var(--ink); font-size: 14px; font-weight: 700; text-underline-offset: 4px; }
.account-help { scroll-margin-top: 24px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); text-align: center; }
.account-help img { width: 180px; height: 180px; margin: 0 auto; object-fit: contain; }
.account-help p { margin: 16px 0 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.form-error { padding: .75rem 1rem; border-radius: 12px; background: var(--pear); color: var(--ink); font-size: .82rem; }

.admin-header { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.admin-header p:not(.auth-kicker) { margin: .65rem 0 0; color: var(--muted); font-size: .8rem; }
.quiet-button { padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); }
.admin-card { margin-top: 1.2rem; padding: 28px; border-radius: 18px; box-shadow: 0 14px 45px rgba(62,65,47,.06); }
.create-form { display: grid; grid-template-columns: 1fr 1fr .8fr 1fr auto; gap: 1rem; align-items: end; margin-top: 1.4rem; }
.create-form > button { min-width: 110px; justify-content: center; padding-inline: 1.2rem; }
.result-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: 0 0 1rem; padding: 1rem 1.2rem; border-radius: 14px; background: var(--sage); color: var(--sage-deep); }
.password-reveal { padding: .35rem .65rem; border-radius: 7px; background: var(--paper); font-family: inherit; font-size: 1rem; user-select: all; }
.card-heading { display: flex; align-items: center; justify-content: space-between; }
.card-heading span { color: var(--muted); font-size: .75rem; }
.table-scroll { overflow-x: auto; margin-top: 1.3rem; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { padding: 1rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .68rem; letter-spacing: .08em; }
td strong { display: block; }
td small { display: block; color: var(--muted); }
.state { display: inline-flex; padding: .25rem .55rem; border-radius: 999px; font-size: .68rem; }
.state-on { background: var(--sage); color: var(--sage-deep); }
.state-off { background: var(--pear); color: var(--ink); }
.table-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.table-actions button { padding: .38rem .58rem; border-radius: 7px; background: var(--sage); color: var(--sage-deep); font-size: .7rem; }
.table-actions .danger { background: var(--pear); color: var(--danger); }
.empty-row { padding: 2.5rem; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .create-form { grid-template-columns: 1fr 1fr; }
  .create-form > button { min-height: 48px; }
}
@media (max-width: 620px) {
  .auth-brand { font-size: 13px; }
  .admin-header { align-items: flex-start; }
  .create-form { grid-template-columns: 1fr; }
  .admin-card { padding: 20px; }
  .table-actions { min-width: 170px; }
}

/* Public training login */
body.login-page {
  --paper: #FAF7F2;
  --pear: #FFE8A8;
  --ink: #3D2E1F;
  min-height: 100vh;
  padding: 0;
  display: grid;
  place-items: center;
  background: #FAF7F2;
  color: #3D2E1F;
  font-family: "Source Han Sans SC", "Noto Sans SC", sans-serif;
  font-weight: 400;
}
.login-page button,
.login-page input { font-family: "Source Han Sans SC", "Noto Sans SC", sans-serif; }
.login-page .auth-shell { width: 440px; margin: 0; padding: 64px 0; }
.login-page .auth-brand { justify-content: center; margin: 0 auto 48px; color: #3D2E1F; font-size: 15px; font-weight: 700; }
.login-page .login-card { width: 440px; padding: 48px 40px; border: 2px solid #FFE8A8; border-radius: 24px; background: #FAF7F2; box-shadow: none; }
.login-page .auth-kicker { margin: 0; color: rgba(61, 46, 31, .6); font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 6px; }
.login-page .auth-kicker::before { content: ""; display: block; width: 28px; height: 1px; margin-bottom: 12px; background: rgba(61, 46, 31, .6); }
.login-page h1 { margin: 24px 0 0; color: #3D2E1F; font-size: 36px; font-weight: 900; line-height: 1.3; letter-spacing: normal; }
.login-page .auth-form { margin-top: 40px; display: grid; gap: 24px; }
.login-page label { display: grid; gap: 10px; color: #3D2E1F; font-size: 14px; font-weight: 500; line-height: 1.4; }
.login-page input { width: 100%; min-height: 0; padding: 14px 16px; border: 1px solid #FFE8A8; border-radius: 12px; outline: none; background: #FFFFFF; box-shadow: none; color: #3D2E1F; font-size: 16px; font-weight: 400; line-height: 1.4; }
.login-page input::placeholder { color: rgba(61, 46, 31, .35); }
.login-page input:focus { border: 2px solid #FFE8A8; outline: none; box-shadow: none; }
.login-page .auth-form > button { width: 100%; min-height: 0; margin: 8px 0 0; padding: 16px; display: block; border: 0; border-radius: 12px; background: #FFE8A8; box-shadow: none; color: #3D2E1F; font-size: 16px; font-weight: 700; line-height: 1.4; text-align: center; }
.login-page .auth-form > button:hover { background: #FFE8A8; }
.login-page .account-help-trigger { width: fit-content; margin: 24px auto 0; padding: 0 0 2px; display: block; border: 0; border-bottom: 2px solid #FFE8A8; border-radius: 0; background: transparent; color: #3D2E1F; font-size: 14px; font-weight: 500; line-height: 1.4; cursor: pointer; }
.login-page .back-link { display: block; width: fit-content; margin: 20px 0 0; color: rgba(61, 46, 31, .6); font-size: 14px; font-weight: 400; line-height: 1.4; text-decoration: none; cursor: pointer; }
.login-page .account-modal { position: fixed; inset: 0; z-index: 999; width: 100%; height: 100%; display: none; align-items: center; justify-content: center; background: rgba(61, 46, 31, .4); }
.login-page .account-modal-content { position: relative; width: 360px; padding: 40px 32px; border: 2px solid #FFE8A8; border-radius: 24px; background: #FAF7F2; box-shadow: none; text-align: center; }
.login-page .account-modal-close { position: absolute; top: 20px; right: 20px; padding: 0; border: 0; background: transparent; color: rgba(61, 46, 31, .5); font-size: 24px; font-weight: 400; line-height: 1; cursor: pointer; }
.login-page .account-modal-close:hover { color: rgba(61, 46, 31, .8); }
.login-page .account-modal-content h2 { margin: 0; color: #3D2E1F; font-size: 18px; font-weight: 700; line-height: 1.5; letter-spacing: normal; text-align: center; }
.login-page .account-modal-content img { width: 180px; height: 180px; margin: 28px auto 0; display: block; border: 0; border-radius: 0; object-fit: contain; }

@media (max-width: 479px) {
  body.login-page { padding-inline: 20px; }
  .login-page .auth-shell { width: min(100%, 360px); padding-block: 40px; }
  .login-page .login-card { width: 100%; padding: 48px 24px; }
  .login-page h1 { font-size: 28px; }
  .login-page .account-modal-content { width: 90%; max-width: 320px; }
  .login-page .account-modal-content img { width: 150px; height: 150px; }
}
