:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #dde3ea;
  --text: #1e2933;
  --muted: #5f6f7f;
  --accent: #0f5f8f;
  --ok: #1f7a45;
  --warn: #9a6700;
  --plan: #7d4d00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  background: linear-gradient(180deg, #eef3f8 0%, #f8fafc 45%, #edf2f7 100%);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fefefe;
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
}

.subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.badge {
  background: #e7f0f7;
  color: #0e4263;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.notice {
  margin: 1rem;
  background: #fff9e7;
  border: 1px solid #f1d597;
  color: #6a4a00;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
}

.section-nav {
  margin: 0 1rem 1rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.section-nav a {
  text-decoration: none;
  color: var(--accent);
  border: 1px solid #c8d8e5;
  background: #f6fbff;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.layout {
  padding: 0 1rem 1.2rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.panel-desc {
  margin: 0 0 0.65rem;
  color: var(--muted);
}

.tag {
  font-size: 0.74rem;
  color: #764300;
  background: #fff2db;
  border: 1px solid #f1d2a0;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

.tenant {
  margin-bottom: 0.65rem;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  background: #fcfdff;
}

.card .label {
  color: var(--muted);
  font-size: 0.82rem;
}

.card .value {
  margin-top: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.provider-btn {
  border: 1px solid #cad4df;
  background: #f9fbfd;
  color: #1b3348;
  border-radius: 10px;
  padding: 0.6rem;
  text-align: left;
  cursor: pointer;
}

.provider-btn.active {
  border-color: #1d6fa2;
  background: #e8f4fb;
}

.provider-btn .provider-name {
  display: block;
  font-weight: 700;
}

.provider-btn .provider-note {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.selection-actions {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
}

button {
  border: 1px solid #266d9a;
  background: #0f5f8f;
  color: #fff;
  border-radius: 9px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

button:hover {
  background: #0c4f76;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th,
td {
  border-bottom: 1px solid #e4eaf1;
  padding: 0.55rem 0.4rem;
  text-align: left;
  font-size: 0.87rem;
}

th {
  color: #3e5368;
  background: #f7f9fb;
}

.status {
  display: inline-block;
  padding: 0.14rem 0.4rem;
  border-radius: 999px;
  font-size: 0.74rem;
}

.status.enabled,
.status.active,
.status.success {
  background: #e6f8ee;
  color: var(--ok);
}

.status.planned {
  background: #fff4db;
  color: var(--plan);
}

.status.future {
  background: #f0f2f5;
  color: #596474;
}

.status.warning {
  background: #fff4df;
  color: var(--warn);
}

.context-list,
.simple-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.context-list li,
.simple-list li {
  border: 1px solid #e2e8ef;
  border-radius: 9px;
  padding: 0.5rem 0.6rem;
  background: #fbfdff;
}

.hint {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.context-list {
  display: grid;
  gap: 0.45rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.split h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.simple-list {
  display: grid;
  gap: 0.4rem;
}

.footer {
  margin: 0 1rem 1rem;
  color: #506071;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .cards,
  .provider-grid,
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .selection-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .cards,
  .provider-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .section-nav a {
    font-size: 0.82rem;
  }
}
