:root {
  --bg: #f2f6f8;
  --panel: #ffffff;
  --ink: #1a2a35;
  --muted: #60707d;
  --line: #d4dee5;
  --brand: #2e5e74;
  --brand-soft: #e8f1f6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
}

a {
  color: inherit;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

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

.brand h1 {
  margin: 0;
  font-size: 20px;
}

.brand p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.portal-header nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-header nav a,
.portal-header nav button {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #20343f;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.portal-header nav a.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}

.portal-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
}

.bulletin-list,
.policy-list {
  display: grid;
  gap: 12px;
}

.bulletin-card,
.policy-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.bulletin-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.bulletin-card h2,
.policy-card h2 {
  margin: 0;
  font-size: 20px;
}

.bulletin-card time {
  color: var(--muted);
  font-size: 13px;
}

.bulletin-card p,
.policy-card p {
  margin: 12px 0 0;
  line-height: 1.7;
  color: #2e4553;
}

.bulletin-card img,
.policy-card img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  border: 1px solid #dbe4ea;
  background: #f9fbfd;
  margin-top: 10px;
}

.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 22px;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: grid;
  gap: 12px;
}

.login-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.login-card h1 {
  margin: 0;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

.login-card form {
  display: grid;
  gap: 10px;
}

.login-card label {
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  border: 1px solid #c2ced8;
  border-radius: 8px;
  padding: 10px;
}

.login-card button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  min-height: 40px;
  cursor: pointer;
}

#login-error {
  min-height: 18px;
  color: #a33636;
}

@media (max-width: 900px) {
  .portal-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .portal-header nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .portal-header nav a,
  .portal-header nav button {
    flex: 1 1 auto;
  }

  .portal-main {
    padding: 12px;
  }

  .bulletin-card h2,
  .policy-card h2 {
    font-size: 18px;
  }
}
