:root {
  --bg: #f5f7f6;
  --panel: #ffffff;
  --panel-strong: #f1f6f4;
  --ink: #1f2523;
  --muted: #65706b;
  --line: #d9e0dc;
  --line-soft: #edf1ef;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #e2f3ef;
  --gold: #aa7a24;
  --gold-soft: #f4ead2;
  --shadow: 0 18px 42px rgba(20, 34, 30, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(226, 243, 239, 0.72), rgba(255, 255, 255, 0) 42%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 24px;
  width: min(520px, 100%);
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.login-head > div {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.login-head strong,
.login-head span {
  display: block;
  min-width: 0;
}

.login-head strong {
  font-size: 18px;
  line-height: 1.25;
}

.login-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.login-title h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.entry-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 108px;
  padding: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.entry-card:hover,
.entry-card.active {
  background: #f8fbfa;
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.entry-card.home:hover,
.entry-card.home.active {
  background: #f8fbfa;
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.12);
}

.entry-card.purchase:hover,
.entry-card.purchase.active {
  background: #fffaf0;
  border-color: #e2c98d;
  box-shadow: 0 12px 28px rgba(170, 122, 36, 0.12);
}

.entry-card strong {
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button:hover {
  background: var(--accent-dark);
}

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

.message {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.message:not(:empty) {
  padding: 10px 12px;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

@media (max-width: 520px) {
  .login-shell {
    padding: 14px;
  }

  .login-card {
    gap: 22px;
    padding: 20px;
  }

  .login-title h1 {
    font-size: 26px;
  }

  .entry-grid {
    grid-template-columns: 1fr;
  }

  .entry-card {
    min-height: 78px;
  }
}
