* { box-sizing: border-box; }
:root {
  --ui-bg: #f1f5f9;
  --ui-card: #ffffff;
  --ui-text: #0f172a;
  --ui-muted: #64748b;
  --ui-border: #e2e8f0;
  --ui-primary: #2563eb;
}
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, var(--ui-bg) 100%);
  color: var(--ui-text);
  line-height: 1.5;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
}
.topbar a { color: #fff; margin-left: 16px; text-decoration: none; }
.brand { font-weight: 700; }
.container { max-width: 1200px; margin: 20px auto; padding: 0 16px; }
.container--split {
  max-width: 1480px;
}
.app-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
  min-height: calc(100vh - 120px);
}
.app-sidebar {
  width: min(380px, 100%);
  min-width: 300px;
  flex-shrink: 0;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  align-self: flex-start;
}
.app-sidebar-title {
  margin: 0 0 12px 0;
  font-size: 18px;
}
.app-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.app-sidebar-head .app-sidebar-title {
  margin: 0;
}
.sidebar-add-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.device-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.device-sidebar-empty {
  color: #6b7280;
  font-size: 14px;
  padding: 8px 0;
}
.device-sidebar-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
a.device-sidebar-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.device-sidebar-item.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #2563eb;
}
.device-sidebar-item--disabled {
  cursor: not-allowed;
  opacity: 0.88;
}
.device-sidebar-item--disabled:hover {
  border-color: #e5e7eb;
  box-shadow: none;
}
.device-sidebar-item--expired {
  border-color: #f87171;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}
.device-sidebar-item--expired.is-active {
  border-color: #ef4444;
  background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
}
a.device-sidebar-item--expired:hover {
  border-color: #ef4444;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.2);
}
.device-sidebar-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
}
.device-sidebar-item-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}
.device-sidebar-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #374151;
}
.device-sidebar-more {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: #e5e7eb;
  color: #111827;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-size: 14px;
}
.device-sidebar-more:hover:not(:disabled) {
  background: #d1d5db;
}
.device-sidebar-more:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}
.app-main-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  padding: 32px 16px;
  text-align: center;
  min-height: 320px;
}
.app-main-hint {
  margin-top: 8px;
  font-size: 13px;
  color: #9ca3af;
}
.app-detail-iframe {
  width: 100%;
  flex: 1;
  min-height: 720px;
  border: 0;
  border-radius: 8px;
  background: #fff;
}
.app-detail-iframe--loading {
  visibility: hidden;
}
.app-main-loading {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #64748b;
}
.app-main-loading p {
  margin: 0;
  font-size: 14px;
}
.app-main-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: appSpin 0.8s linear infinite;
}
@keyframes appSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.embed-body {
  margin: 0;
  background: #f4f6f8;
  padding: 12px;
}
.card.card--embed {
  margin: 0;
}
.card {
  background: var(--ui-card);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--ui-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}
.card.small { max-width: 360px; margin: 80px auto; }
.login-page-shell {
  position: relative;
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  isolation: isolate;
}
.login-page-shell .login-card {
  transform: translateY(-9vh);
}
.login-page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(59,130,246,.28) 0%, rgba(59,130,246,0) 58%),
    radial-gradient(980px 620px at 92% 112%, rgba(6,182,212,.24) 0%, rgba(6,182,212,0) 58%),
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 45%, #f4fbff 100%);
}
.login-mode {
  background: #f4f8ff;
}
.login-mode .container {
  max-width: none;
  margin: 0;
  padding: 0;
}
.login-card {
  position: relative;
  overflow: hidden;
  z-index: 1;
  width: min(430px, 100%);
  padding: 48px 28px 42px;
  border-color: #e7edf5;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  text-align: left;
}
.login-card > h1 {
  text-align: center;
}
.login-card::before {
  content: "";
  position: absolute;
  right: -92px;
  top: -92px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37,99,235,.09) 0%, rgba(37,99,235,0) 76%);
  pointer-events: none;
}
.login-brand-logo {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
  padding: 6px;
  margin-bottom: 12px;
  margin-left: auto;
  margin-right: auto;
}
.login-subtitle {
  margin: -2px 0 16px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}
.login-form {
  gap: 12px;
  text-align: left;
}
.login-form input {
  min-height: 42px;
  border-radius: 10px;
  border-color: #e2e8f0;
  background: #ffffff;
}
.password-field {
  position: relative;
}
.password-field input {
  width: 100%;
  padding-right: 42px;
}
.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #dbe3ee;
  font-size: 14px;
  line-height: 1;
  box-shadow: none;
}
.password-toggle-btn:hover:not(:disabled) {
  background: #e2e8f0;
  box-shadow: none;
}
.login-form input:focus {
  background: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}
.login-submit-btn {
  margin-top: 12px;
  min-height: 44px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: .5px;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  box-shadow: 0 6px 16px rgba(37,99,235,.20);
}
.login-submit-btn:hover:not(:disabled) {
  box-shadow: 0 8px 18px rgba(37,99,235,.24);
}
h1 { margin-top: 0; font-size: 24px; }
h2 { margin-top: 24px; font-size: 18px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.space-between { justify-content: space-between; }
.top-gap { margin-top: 12px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-width: 500px;
}
input, button {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
input, select {
  background: #fff;
  color: var(--ui-text);
  transition: border-color .16s, box-shadow .16s;
  margin-top: 10px;
}
input:focus, select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
button {
  background: var(--ui-primary);
  border: 0;
  color: #fff;
  cursor: pointer;
  transition: transform .05s ease, filter .15s ease, box-shadow .15s ease;
}
button:hover:not(:disabled) {
  filter: brightness(.96);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .24);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: .75;
  cursor: not-allowed;
}
button.danger { background: #dc2626; }
.btn-link {
  display: inline-block;
  padding: 6px 10px;
  background: #e5e7eb;
  color: #111827;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.btn-link.active {
  background: #2563eb;
  color: #fff;
}
.btn-link.disabled {
  opacity: .6;
  cursor: not-allowed;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
th, td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}
.center { text-align: center; }
.alert {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.alert.error { background: #fee2e2; color: #7f1d1d; border-color: #fecaca; }
.alert.success { background: #dcfce7; color: #14532d; border-color: #86efac; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  color: #fff;
  font-size: 12px;
}
.badge.ok { background: #16a34a; }
.badge.bad { background: #6b7280; }

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.device-card {
  display: block;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
}
.device-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .15);
}
.device-card--disabled {
  cursor: not-allowed;
  display: block;
  color: inherit;
  text-decoration: none;
}
.device-card--disabled:hover {
  border-color: #e5e7eb;
  box-shadow: none;
}
.device-card.expired {
  border-color: #fca5a5;
  background: #fff1f2;
}
.device-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.device-card-sub {
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
  word-break: break-all;
}
.kv {
  margin-top: 6px;
  font-size: 14px;
}
.kv--with-icon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kv--with-icon .kv-label {
  color: #6b7280;
  font-size: 13px;
}
.kv--with-icon .kv-icon {
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  object-fit: contain;
  display: block;
}

.solar-top-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
}
.solar-top-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.solar-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.solar-metric {
  background: rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.solar-metric span {
  font-size: 12px;
  opacity: .9;
}
.solar-metric b {
  font-size: 15px;
}

.solar-chart-stack {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.solar-chart-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  height: 280px;
}
.solar-chart-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.solar-switch-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}
.solar-switch-card.state-on {
  background: linear-gradient(135deg, #ecfdf5 0%, #dcfce7 100%);
  border-color: #86efac;
}
.solar-switch-card.state-off {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-color: #cbd5e1;
}
.solar-switch-title {
  font-weight: 700;
}
.solar-switch-sub {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
}
.solar-switch-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}
.solar-switch-state.is-on {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.solar-switch-state.is-off {
  background: #e2e8f0;
  color: #334155;
  border-color: #cbd5e1;
}
.solar-switch-card button.is-counting {
  background: #64748b;
  cursor: not-allowed;
}
.solar-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.solar-signal-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  line-height: 1.7;
}
.solar-signal-name {
  font-weight: 700;
  margin-bottom: 4px;
}
.solar-mode-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.solar-mode-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  background: #f9fafb;
}
.solar-mode-item.is-active {
  border-width: 2px;
}
.solar-mode-item.is-active.mode-normal {
  background: #ecfdf5;
  border-color: #22c55e;
}
.solar-mode-item.is-active.mode-expert {
  background: #eff6ff;
  border-color: #3b82f6;
}
.solar-mode-item.is-active.mode-timer {
  background: #fff7ed;
  border-color: #f59e0b;
}
.solar-mode-main {
  min-width: 0;
}
.solar-mode-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.solar-mode-name {
  font-weight: 700;
}
button.solar-mode-help {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #94a3b8;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
button.solar-mode-help:hover {
  background: #e2e8f0;
  border-color: #64748b;
}
.solar-mode-help-modal {
  z-index: 1001;
}
.modal-dialog--wide {
  max-width: 480px;
}
.solar-mode-help-modal-text {
  margin: 0;
  line-height: 1.65;
  color: #374151;
  font-size: 15px;
}
.solar-mode-desc {
  color: #6b7280;
  font-size: 13px;
  margin-top: 2px;
}
.solar-mode-meta {
  margin-top: 4px;
  color: #111827;
  font-size: 13px;
}
.solar-mode-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.solar-mode-form select {
  min-width: 96px;
}
.solar-mode-form .mode-on {
  background: #16a34a;
}
.solar-mode-timer-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.solar-mode-form-col {
  flex-direction: column;
  align-items: stretch;
}
.solar-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.solar-time-row input[type="time"] {
  min-width: 120px;
}
.solar-time-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.solar-time-help {
  font-size: 12px;
  color: #6b7280;
}

.name-with-edit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
button.btn-edit {
  padding: 4px 10px;
  font-size: 13px;
  background: #e5e7eb;
  color: #111827;
}
button.btn-edit:hover {
  background: #d1d5db;
}
button.btn-secondary {
  background: #6b7280;
  color: #fff;
}
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}
.modal-overlay.is-open {
  display: flex;
}
.modal-dialog {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  max-width: 420px;
  width: 100%;
  border: 1px solid #e2e8f0;
  box-shadow: 0 14px 48px rgba(15, 23, 42, 0.24);
}
.modal-dialog h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
}
.modal-dialog label {
  display: block;
  font-size: 13px;
  color: #374151;
  margin-bottom: 4px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}
.modal-actions button {
  min-width: 88px;
}

/* ----- 設備詳情頁（太陽能 embed / 獨立 device 頁），與側欄 slate·藍風格統一 ----- */
.solar-detail,
.device-detail-page {
  --detail-border: #e2e8f0;
  --detail-muted: #64748b;
  position: relative;
}

.solar-detail > h1,
.device-detail-page > h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--detail-border);
}

/* 頂部操作／分頁列 */
.solar-detail > .top-gap.row.wrap,
.device-detail-page > .top-gap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px !important;
  padding: 6px;
  background: #f1f5f9;
  border-radius: 10px;
  border: 1px solid var(--detail-border);
}

.solar-detail > .top-gap.row.wrap .btn-link,
.device-detail-page > .top-gap .btn-link {
  border: 0;
  background: transparent;
  font-weight: 500;
  color: #475569;
}

.solar-detail > .top-gap.row.wrap .btn-link:hover,
.device-detail-page > .top-gap .btn-link:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.solar-detail > .top-gap.row.wrap .btn-link.active,
.device-detail-page > .top-gap .btn-link.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.solar-detail h2,
.device-detail-page h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
  margin-top: 28px;
  margin-bottom: 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

/* 管理員／操作記錄（embed）：導航列下方的子標題 */
.solar-detail > h2.solar-embed-subheading {
  margin-top: 16px;
  font-size: 1.15rem;
  color: #0f172a;
}

.solar-detail table,
.device-detail-page table {
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--detail-border);
  border-collapse: separate;
  border-spacing: 0;
}

.solar-detail th,
.device-detail-page th {
  width: 38%;
  max-width: 200px;
  background: #f8fafc;
  color: var(--detail-muted);
  font-weight: 600;
  font-size: 13px;
  border-color: var(--detail-border);
}

.solar-detail td,
.device-detail-page td {
  border-color: var(--detail-border);
  background: #fff;
  font-size: 14px;
}

.solar-detail .solar-top-card {
  margin-top: 16px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.22);
}

.solar-detail .solar-switch-card,
.solar-detail .solar-signal-item {
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.solar-detail .solar-chart-card {
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

/* 圖表／電池分頁：日期列 */
.solar-detail form.row.top-gap {
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--detail-border);
  margin-top: 16px !important;
}

.solar-detail form.row.top-gap input[type="date"] {
  min-height: 38px;
  padding: 8px 10px;
}

.solar-detail .row.space-between.top-gap {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--detail-border);
  margin-top: 16px !important;
}

.embed-body {
  background: #f1f5f9;
  padding: 16px;
  min-height: 100vh;
  box-sizing: border-box;
}

.card.card--embed {
  padding: 20px 22px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  border-radius: 12px;
}

/* Dashboard 主欄（不影響左側 aside） */
.app-main.card {
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.app-main-placeholder {
  background: linear-gradient(165deg, #f8fafc 0%, #ffffff 55%);
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  margin: 4px 0;
}

.app-main-placeholder p {
  margin: 0;
  max-width: 22rem;
  line-height: 1.65;
  color: #475569;
}

.app-main-placeholder strong {
  color: #2563eb;
  font-weight: 600;
}

.app-main-hint {
  color: #94a3b8 !important;
}

.app-detail-iframe {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* 輕量滾動條美化（Webkit） */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #f8fafc;
}
*::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* fixed：長頁面捲動後仍能在「目前視窗」中央看到 spinner（absolute 會以整頁高度置中，視窗外看不到） */
.detail-tab-loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: #475569;
  pointer-events: none;
}
.detail-tab-loading.is-open {
  display: flex;
  pointer-events: auto;
}
.detail-tab-loading p {
  margin: 0;
  font-size: 14px;
}
