:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --line: #d8e0ea;
  --primary: #1769aa;
  --primary-dark: #0f4f82;
  --accent: #2f9e73;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px max(24px, calc((100vw - 1120px) / 2)) 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
}

.brand-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.logout-link:hover,
.logout-link:focus-visible {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  outline: none;
}

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

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

.login-panel h1 {
  font-size: 32px;
}

.field-label {
  display: block;
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.password-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.password-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.16);
  outline: none;
}

.login-error {
  margin: 12px 0 0;
  color: #b42318;
  font-size: 14px;
  font-weight: 700;
}

.login-button {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  cursor: pointer;
}

.login-button:hover,
.login-button:focus-visible {
  background: var(--primary-dark);
  outline: none;
}

.layout {
  display: grid;
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto;
}

.panel {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.link-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.link-item {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 16px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.link-item:hover,
.link-item:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(23, 105, 170, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.link-item strong {
  font-size: 17px;
}

.link-item small {
  color: var(--muted);
  word-break: break-word;
}

.info-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.info-list div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.info-list dt {
  color: var(--muted);
  font-size: 13px;
}

.info-list dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  background: var(--primary);
}

.button-link:hover,
.button-link:focus-visible {
  background: var(--primary-dark);
  outline: none;
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    padding-top: 24px;
  }

  .brand-icon {
    width: 48px;
    height: 48px;
  }

  .panel {
    padding: 18px;
  }

  .section-title {
    display: block;
  }

  .section-title span {
    display: block;
    margin-top: 4px;
  }
}
