:root {
  color-scheme: light;
  --navy: #0a315f;
  --blue: #1268d6;
  --blue-dark: #0a4ea8;
  --blue-pale: #eaf3ff;
  --ink: #142b46;
  --muted: #60758d;
  --line: #c5d5e7;
  --surface: #ffffff;
  --background: #edf3fa;
  --error: #b42318;
  --success: #18794e;
}

/* 全站統一使用使用者指定的微軟雅黑，缺少時才使用系統無襯線字體。 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    linear-gradient(180deg, #dfeaf7 0, #edf3fa 220px, #edf3fa 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
}

.download-panel {
  width: min(860px, 100%);
  background: var(--surface);
  border: 1px solid #b9cce2;
  box-shadow: 0 18px 46px rgba(32, 66, 105, 0.14);
}

.page-header {
  padding: 34px 40px 30px;
  border-top: 6px solid var(--blue);
  border-bottom: 1px solid var(--line);
}

.product-label,
.file-type {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.2;
}

.page-summary,
.section-heading p,
.download-card > p:not(.file-type),
footer p {
  color: var(--muted);
  line-height: 1.7;
}

.page-summary,
.section-heading p,
footer p {
  margin-bottom: 0;
}

.panel-section {
  padding: 32px 40px 36px;
}

.panel-section + .panel-section {
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 21px;
}

.step-number {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 8px 6px;
  background: var(--navy);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.success-heading .step-number {
  background: var(--success);
}

label {
  display: block;
  margin-bottom: 9px;
  color: var(--navy);
  font-weight: 700;
}

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

input,
button,
.download-button {
  min-height: 48px;
  border-radius: 3px;
  font: inherit;
}

input {
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid #8fa9c6;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input:focus {
  border-color: var(--blue);
  outline: 3px solid #bcd9ff;
}

button,
.download-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--blue);
  padding: 11px 22px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.download-button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

button:focus-visible,
.download-button:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.message {
  min-height: 26px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.message.error {
  color: var(--error);
}

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

.download-card {
  display: flex;
  min-height: 238px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  background: #f8fbff;
}

.download-card h3 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 20px;
}

.download-card > p:not(.file-type) {
  margin-bottom: 22px;
}

.download-card .download-button {
  margin-top: auto;
}

.download-button.secondary {
  border-color: var(--navy);
  background: var(--navy);
}

.logout-button {
  margin-top: 20px;
  border-color: #7890a9;
  background: #7890a9;
}

footer {
  padding: 18px 40px;
  border-top: 1px solid var(--line);
  background: var(--blue-pale);
  font-size: 14px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  body {
    padding: 16px 10px;
  }

  .page-header,
  .panel-section {
    padding-right: 22px;
    padding-left: 22px;
  }

  footer {
    padding-right: 22px;
    padding-left: 22px;
  }

  .login-row,
  .download-grid {
    grid-template-columns: 1fr;
  }

  .download-card {
    min-height: 0;
  }
}
