:root {
  color-scheme: light;
  --ink: #171714;
  --muted: #68635b;
  --paper: rgba(251, 248, 239, 0.94);
  --line: rgba(83, 70, 51, 0.23);
  --red: #833329;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #d7d5c8;
  color: var(--ink);
}

button,
input { font: inherit; }

.access-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 82px 24px 54px;
}

.landscape {
  position: fixed;
  z-index: 0;
  inset: 0;
}

.landscape img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(0.92);
}

.landscape::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(242, 239, 226, 0.4);
}

.home-link {
  position: absolute;
  z-index: 2;
  top: 24px;
  left: 28px;
  color: #312d27;
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.access-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  padding: 34px;
  border: 1px solid rgba(105, 91, 68, 0.28);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(42, 38, 29, 0.2);
  backdrop-filter: blur(16px);
}

.panel-intro p {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 750;
}

.panel-intro h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 34px;
  letter-spacing: 0;
}

.panel-intro span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 28px 0 22px;
  border-bottom: 1px solid var(--line);
}

.mode-tabs button {
  padding: 11px 8px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.mode-tabs button.active {
  border-bottom-color: var(--red);
  color: var(--ink);
}

.access-form {
  display: grid;
  gap: 17px;
}

.access-form[hidden] { display: none; }

.access-form label {
  display: grid;
  gap: 7px;
}

.access-form label > span {
  font-size: 13px;
  font-weight: 700;
}

.access-form input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  outline: none;
}

.access-form input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(131, 51, 41, 0.1);
}

.access-form small {
  color: var(--muted);
  font-size: 12px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button {
  height: 48px;
  margin-top: 3px;
  border: 1px solid #68261f;
  border-radius: 5px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
}

.primary-button:disabled { opacity: 0.55; cursor: wait; }

.form-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: #9f2e25;
  font-size: 13px;
}

.icp-link {
  position: absolute;
  z-index: 2;
  bottom: 20px;
  color: #514c44;
  font-size: 13px;
  text-decoration: none;
}

.icp-link:hover,
.icp-link:focus-visible {
  color: var(--red);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .access-shell { place-items: end center; padding: 62px 12px 48px; }
  .home-link { top: 18px; left: 18px; }
  .access-panel { padding: 26px 20px; }
  .panel-intro h1 { font-size: 29px; }
  .field-row { grid-template-columns: 1fr; }
}
