:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #687386;
  --line: #dde3ec;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --brand: #174ea6;
  --brand-dark: #123d82;
  --success: #176b4d;
  --success-bg: #eaf7f0;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input { font: inherit; }

.page-shell { min-height: 100vh; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: auto;
  height: 44px;
  object-fit: contain;
}

.brand-compact img { height: 34px; }

.login-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 15% 15%, rgba(23, 78, 166, .12), transparent 34%),
    radial-gradient(circle at 90% 85%, rgba(28, 126, 103, .1), transparent 30%),
    var(--canvas);
}

.login-card {
  width: min(100%, 480px);
  padding: 40px;
  border: 1px solid rgba(218, 224, 234, .9);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(34, 52, 82, .13);
}

.eyebrow {
  margin-top: 32px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.login-card h1,
.dashboard-hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.18;
  letter-spacing: -.025em;
}

.lead,
.dashboard-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.messages { margin: 22px 0 -4px; }
.message {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff0f0;
  color: #9d2d2d;
  font-size: 14px;
}

.login-form { margin-top: 28px; }
.login-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #cfd7e3;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.login-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 78, 166, .12);
}

.login-form button {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.login-form button:hover { background: var(--brand-dark); }
.login-form button:disabled { cursor: not-allowed; opacity: .45; }

.privacy-note,
.configuration-warning {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.configuration-warning { color: #9d2d2d; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px max(22px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(215, 222, 232, .9);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}

.topbar form { margin: 0; }
.logout-button,
.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #cad3df;
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.logout-button:hover,
.home-link:hover { border-color: var(--brand); color: var(--brand); }

.dashboard {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 72px;
}

.dashboard-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.dashboard-hero .eyebrow { margin-top: 0; }

.compatibility-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 30px 0 44px;
  padding: 15px 18px;
  border: 1px solid #cde8d9;
  border-radius: 12px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 14px;
}

.compatibility-note span { color: #426b5b; }

.module-section + .module-section { margin-top: 48px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 { margin: 0 0 5px; font-size: 22px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.section-heading > span { color: var(--muted); font-size: 12px; }

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

.module-card {
  display: flex;
  min-height: 244px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(40, 57, 82, .05);
}

.module-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.module-index {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #edf3fc;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.sensitivity {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-card h3 { margin: 21px 0 8px; font-size: 18px; }
.module-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.module-actions { display: flex; gap: 9px; margin-top: auto; padding-top: 22px; }
.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.primary-action { background: var(--brand); color: white; }
.primary-action:hover { background: var(--brand-dark); }
.secondary-action { border: 1px solid #d3dbe6; color: #4f5c70; }
.secondary-action:hover { border-color: var(--brand); color: var(--brand); }

.portal-footer {
  padding: 28px 20px 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

:focus-visible { outline: 3px solid rgba(23, 78, 166, .32); outline-offset: 3px; }

@media (max-width: 860px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .login-card { padding: 30px 24px; border-radius: 18px; }
  .brand img { height: 38px; }
  .topbar { padding-inline: 16px; }
  .brand-compact span { display: none; }
  .dashboard { width: min(100% - 28px, 1120px); padding-top: 36px; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .compatibility-note { align-items: flex-start; flex-direction: column; gap: 5px; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 220px; }
  .section-heading > span { display: none; }
}
