.portal-body { background: var(--paper); min-height: 100vh; }

/* .portal-user 的 display:flex、.portal-list 的 display:grid 會蓋過 hidden 屬性的預設隱藏，必須強制 */
.portal-body [hidden] { display: none !important; }

.portal-main { max-width: 860px; margin: 0 auto; padding: 120px 24px 80px; }

.portal-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
}

.portal-login { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.portal-login h1 { font-family: var(--f-display); color: var(--ink); margin-bottom: 8px; }
.portal-google { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; }

.portal-muted { color: var(--slate); }
.portal-error { color: var(--sev-critical); margin-top: 16px; }

.portal-user { display: flex; align-items: center; gap: 12px; }
.portal-user span { color: #fff; font-weight: 500; }
.portal-avatar { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--teal); }

.portal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.portal-head h1 { font-family: var(--f-display); color: var(--ink); }

.portal-empty { text-align: center; padding: 56px 32px; }
.portal-empty h2 { font-family: var(--f-display); color: var(--ink); margin-bottom: 8px; }
.portal-empty .btn { margin-top: 20px; }

.portal-error-box { text-align: center; color: var(--sev-critical); }
.portal-error-box .btn { margin-top: 12px; }

.portal-list { list-style: none; padding: 0; display: grid; gap: 14px; }
.portal-item {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
}
.portal-item summary {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  font-family: var(--f-body); color: var(--ink); font-weight: 600;
  list-style: none;
}
.portal-item summary::-webkit-details-marker { display: none; }
.portal-domain { font-family: var(--f-mono); }
.portal-date { color: var(--slate); font-weight: 400; font-size: 0.9em; margin-left: auto; }

.portal-status {
  font-size: 0.78em; font-weight: 600; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; letter-spacing: 0.04em;
}
.portal-status[data-status="pending"]  { background: #eef2f7; color: var(--slate); }
.portal-status[data-status="scanning"] { background: #e0f2fe; color: var(--sev-low); }
.portal-status[data-status="done"]     { background: #dcfce7; color: #15803d; }
.portal-status[data-status="failed"]   { background: #fee2e2; color: var(--sev-critical); }

.portal-report { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.portal-counts { display: flex; gap: 18px; margin-bottom: 14px; }
.portal-counts strong { font-family: var(--f-mono); }
.portal-counts .hi { color: var(--sev-high); }
.portal-counts .md { color: var(--sev-medium); }
.portal-counts .lo { color: var(--sev-low); }

.portal-finding { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.portal-finding:last-child { border-bottom: none; }
.portal-finding h4 { color: var(--ink); margin-bottom: 4px; }
.portal-finding p { color: var(--ink-2); font-size: 0.92em; }

.scan-submit { margin-bottom: 16px; }
.scan-submit h2 { font-family: var(--f-display); color: var(--ink); margin-bottom: 14px; }
.scan-submit form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.scan-submit input[type="text"] {
  width: 100%; max-width: 360px;
  padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px;
  font-family: var(--f-mono); font-size: 14px; color: var(--ink); background: var(--paper-2);
}
.scan-consent { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 0.92em; cursor: pointer; }
.scan-consent input { width: 15px; height: 15px; flex: none; }
