:root {
  color-scheme: light dark;
  --gate-bg: #fff;
  --gate-text: #242424;
  --gate-muted: #777;
  --gate-line: #dedede;
  --gate-soft: #f6f6f6;
  --gate-action: #252525;
  --gate-action-text: #fff;
  --gate-error: #b33838;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--gate-bg);
  color: var(--gate-text);
  font-family: "Times New Roman", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gate-muted); outline-offset: 4px; }
.gate-shell {
  display: flex;
  flex-direction: column;
  max-width: 1120px;
  min-height: 100svh;
  margin: auto;
  padding: 0 28px;
}
.gate-skip { position: absolute; left: 20px; top: -60px; background: var(--gate-bg); padding: 12px; z-index: 10; }
.gate-skip:focus { top: 12px; }
.gate-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 90px; border-bottom: .8px solid var(--gate-line); }
.gate-brand { font-size: 20px; font-weight: 700; white-space: nowrap; }
.gate-brand span { margin-left: 8px; font-size: 13px; color: var(--gate-muted); font-weight: 400; }
.site-toolbar { display: flex; align-items: center; gap: 24px; }
.work-category-nav { display: flex; gap: 5px; }
.work-category-tab { padding: 10px 12px; white-space: nowrap; font-size: 14px; color: var(--gate-muted); }
.work-category-tab:hover { color: var(--gate-text); }
.work-category-tab.is-active { color: var(--gate-text); text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 1px; }
.nav-label-compact { display: none; }
.language-switch { display: flex; gap: 8px; font-size: 13px; color: var(--gate-muted); white-space: nowrap; }
.language-switch .is-active { color: var(--gate-text); border-bottom: 1px solid; padding-bottom: 3px; }
.gate-content { flex: 1; padding: 32px 0; }
.gate-section-heading h1 { margin: 0; font-size: 24px; font-weight: 600; }
.gate-panel { max-width: 390px; margin: clamp(40px, 9vh, 88px) auto clamp(60px, 14vh, 120px); text-align: center; }
.gate-panel h2 { margin: 0 0 24px; font-size: 18px; font-weight: 500; line-height: 1.6; }
.gate-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#access-form { text-align: left; }
.gate-field { position: relative; }
.gate-field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 52px 12px 14px;
  border: 1px solid var(--gate-line);
  border-radius: 4px;
  background: var(--gate-bg);
  color: var(--gate-text);
  font-family: system-ui, sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color .15s;
}
.gate-field input::placeholder { color: var(--gate-muted); font-family: "Microsoft YaHei", system-ui, sans-serif; font-size: 14px; }
.gate-field input:focus { border-color: var(--gate-text); }
.gate-field input[aria-invalid="true"] { border-color: var(--gate-error); }
.gate-field button { position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; border: 0; border-radius: 3px; color: var(--gate-muted); background: transparent; }
.gate-field button:hover { background: var(--gate-soft); color: var(--gate-text); }
.gate-field button svg { width: 20px; height: 20px; vertical-align: middle; }
#access-message { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--gate-error); }
#access-message:empty { display: none; }
.gate-submit { display: block; width: 100%; min-height: 46px; margin-top: 14px; border: 0; border-radius: 4px; background: var(--gate-action); color: var(--gate-action-text); font-size: 15px; font-weight: 500; transition: opacity .15s; }
.gate-submit:hover { opacity: .85; }
.gate-submit:disabled, .gate-page[data-restoring] .gate-submit { opacity: .6; }
.gate-return { display: flex; align-items: center; justify-content: center; gap: 7px; width: fit-content; min-height: 44px; margin: 16px auto 0; padding: 8px 12px; color: var(--gate-muted); font-size: 13px; }
.gate-return:hover { color: var(--gate-text); }
.gate-footer { border-top: .8px solid var(--gate-line); padding: 22px 0 26px; color: var(--gate-muted); font-size: 12px; }
@media (max-width: 850px) {
  .gate-header { align-items: flex-start; flex-direction: column; gap: 14px; min-height: auto; padding: 22px 0 17px; }
  .site-toolbar { width: 100%; justify-content: space-between; gap: 12px; }
  .work-category-tab { padding: 9px 10px; }
  .gate-content { padding-top: 26px; }
}
@media (max-width: 520px) {
  .gate-shell { padding: 0 18px; }
  .gate-header { padding-top: 20px; }
  .gate-brand { font-size: 19px; }
  .site-toolbar { gap: 7px; }
  .work-category-nav { gap: 0; flex: 1; justify-content: space-between; }
  .work-category-tab { padding: 9px 5px; font-size: 12px; }
  .nav-label-wide { display: none; }
  .nav-label-compact { display: inline; }
  .language-switch { gap: 6px; font-size: 12px; }
  .gate-section-heading h1 { font-size: 22px; }
  .gate-panel { margin-top: 48px; }
  .gate-panel h2 { font-size: 16px; margin-bottom: 20px; }
}
@media (prefers-color-scheme: dark) {
  :root { --gate-bg: #171717; --gate-text: #f0f0f0; --gate-muted: #aaa; --gate-line: #424242; --gate-soft: #242424; --gate-action: #eee; --gate-action-text: #171717; --gate-error: #ef9696; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
