@charset "UTF-8";
/* 雲端服務狀態卡（2026-11-04），外觀跟資訊匯流卡一致 */
.tn-cs { --cs-line: color-mix(in srgb, var(--color-border) 80%, transparent); margin: 0 0 18px; border: 1px solid var(--cs-line); border-radius: 14px; background: var(--color-bg); box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.05); overflow: hidden; font-size: 13px; }
html.dark-mode .tn-cs { box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.tn-cs-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.tn-cs-h b { font-size: 14px; }
.tn-cs-all { margin-left: auto; padding: 1px 8px; border-radius: 999px; font: 700 11px/1.7 inherit; }
.tn-cs-all.is-ok { background: rgba(34,197,94,.13); color: #16a34a; }
.tn-cs-all.is-bad { background: rgba(245,158,11,.15); color: #d97706; }
html.dark-mode .tn-cs-all.is-ok { color: #4ade80; } html.dark-mode .tn-cs-all.is-bad { color: #fbbf24; }
.tn-cs-list { list-style: none; margin: 0; padding: 0 8px 6px; }
.tn-cs-list li { margin: 0; }
.tn-cs-list a { display: grid; grid-template-columns: 10px 1fr auto; grid-template-areas: "d n e" ". x x"; align-items: center; column-gap: 8px; padding: 7px 6px; border-radius: 8px; color: var(--color-text); text-decoration: none !important; }
.tn-cs-list a:hover { background: color-mix(in srgb, var(--color-primary, #2e8555) 8%, transparent); }
.tn-cs-dot { grid-area: d; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.tn-cs-n { grid-area: n; display: flex; align-items: baseline; gap: 6px; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-cs-n small { font-size: 10.5px; color: var(--color-text-light); font-weight: 400; }
.tn-cs-list em { grid-area: e; font: 600 11px/1 var(--font-mono, ui-monospace, monospace); font-style: normal; color: #16a34a; }
.tn-cs-note { grid-area: x; margin-top: 3px; font-size: 11.5px; line-height: 1.45; color: var(--color-text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-minor .tn-cs-dot { background: #f59e0b; } .st-minor em { color: #d97706; }
.st-major .tn-cs-dot { background: #ef4444; } .st-major em { color: #dc2626; }
.st-maint .tn-cs-dot { background: #3b82f6; } .st-maint em { color: #2563eb; }
.st-unknown .tn-cs-dot { background: #94a3b8; } .st-unknown em { color: var(--color-text-light); }
html.dark-mode .tn-cs-list em { color: #4ade80; } html.dark-mode .st-minor em { color: #fbbf24; } html.dark-mode .st-major em { color: #f87171; } html.dark-mode .st-maint em { color: #60a5fa; }
.tn-cs-list li.is-changed a { animation: tnCsFlash 1.5s ease; }
@keyframes tnCsFlash { 0%, 40% { background: color-mix(in srgb, #f59e0b 18%, transparent); } }
.tn-cs-foot { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--cs-line); background: var(--color-bg-secondary); font-size: 11px; color: var(--color-text-light); }
.tn-cs-foot time { margin-left: auto; font-family: var(--font-mono, ui-monospace, monospace); }
.tn-cs-pulse { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
@media (prefers-reduced-motion: no-preference) {
  .st-ok .tn-cs-dot { animation: tnCsBeat 2.4s ease-out infinite; }
  .st-minor .tn-cs-dot, .st-major .tn-cs-dot { animation: tnCsAlert 1.2s ease-out infinite; }
  @keyframes tnCsBeat { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 100% { box-shadow: 0 0 0 6px transparent; } }
  @keyframes tnCsAlert { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,.7); } 100% { box-shadow: 0 0 0 7px transparent; } }
  .tn-cs-pulse { animation: tnCsBeat 2s ease-out infinite; }
}

/* ===== 心跳圖（2026-11-04 v2） ===== */
.tn-cs-g { padding: 8px 6px 2px; font: 700 10.5px/1.4 inherit; letter-spacing: .08em; color: var(--color-text-light); }
.tn-cs-list a { grid-template-columns: minmax(0, 1fr) 54px 44px; grid-template-areas: "n g e" "x x x"; column-gap: 6px; padding: 5px 6px; }
.tn-cs-dot { display: none; }
.tn-cs-n { font-size: 12.5px; }
.tn-cs-list em { text-align: right; font-size: 10.5px; }
.tn-cs-ecg { grid-area: g; position: relative; height: 16px; overflow: hidden; border-radius: 3px; background: color-mix(in srgb, currentColor 6%, transparent); }
.tn-cs-ecg svg { position: absolute; left: 0; top: 0; width: 200%; height: 100%; }
.tn-cs-ecg path, .tn-cs-mon path { fill: none; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tn-cs-ecg .ecg-ok, .tn-cs-mon .ecg-ok { stroke: #22c55e; }
.tn-cs-ecg .ecg-warn { stroke: #f59e0b; display: none; }
.tn-cs-ecg .ecg-flat, .tn-cs-mon .ecg-flat { stroke: #ef4444; display: none; }
.st-minor .tn-cs-ecg .ecg-ok { display: none; } .st-minor .tn-cs-ecg .ecg-warn { display: inline; }
.st-major .tn-cs-ecg .ecg-ok { display: none; } .st-major .tn-cs-ecg .ecg-flat { display: inline; }
.st-maint .tn-cs-ecg .ecg-ok { stroke: #3b82f6; }
.st-unknown .tn-cs-ecg .ecg-ok { stroke: #94a3b8; stroke-dasharray: 3 3; }
.st-major .tn-cs-ecg { background: rgba(239,68,68,.1); }

/* 總監視器 */
.tn-cs-mon { position: relative; height: 34px; margin: 0 12px 4px; border-radius: 8px; overflow: hidden;
  background: #04110a linear-gradient(rgba(34,197,94,.08) 1px, transparent 1px) 0 0 / 100% 8px; box-shadow: inset 0 0 0 1px rgba(34,197,94,.25); }
.tn-cs-mon svg { position: absolute; left: 0; top: 0; width: 200%; height: 100%; }
.tn-cs-mon .ecg-ok { stroke-width: 1.8; filter: drop-shadow(0 0 3px rgba(34,197,94,.9)); }
.tn-cs-bpm { position: absolute; right: 6px; top: 3px; font: 700 9.5px/1 var(--font-mono, ui-monospace, monospace); letter-spacing: .08em; color: #4ade80; text-shadow: 0 0 6px rgba(34,197,94,.8); }
.tn-cs.is-warn .tn-cs-mon .ecg-ok { stroke: #f59e0b; filter: drop-shadow(0 0 3px rgba(245,158,11,.9)); }
.tn-cs.is-warn .tn-cs-bpm { color: #fbbf24; }
.tn-cs.is-alert .tn-cs-mon { background-color: #1a0505; box-shadow: inset 0 0 0 1px rgba(239,68,68,.45); }
.tn-cs.is-alert .tn-cs-mon .ecg-ok { display: none; } .tn-cs.is-alert .tn-cs-mon .ecg-flat { display: inline; }
.tn-cs.is-alert .tn-cs-bpm { color: #f87171; text-shadow: 0 0 6px rgba(239,68,68,.9); }

@media (prefers-reduced-motion: no-preference) {
  .tn-cs-ecg svg { animation: tnCsRun 2.4s linear infinite; }
  .st-minor .tn-cs-ecg svg { animation-duration: 1.5s; }
  .st-major .tn-cs-ecg svg, .tn-cs.is-alert .tn-cs-mon svg { animation: none; }
  .st-major .tn-cs-ecg .ecg-flat, .tn-cs.is-alert .tn-cs-mon .ecg-flat, .tn-cs.is-alert .tn-cs-bpm { animation: tnCsBlink 1s steps(2, start) infinite; }
  .tn-cs-mon svg { animation: tnCsRun 3.2s linear infinite; }
  @keyframes tnCsRun { to { transform: translateX(-50%); } }
  @keyframes tnCsBlink { to { opacity: .25; } }
  .tn-cs-list li:nth-child(3n) .tn-cs-ecg svg { animation-delay: -.8s; }
  .tn-cs-list li:nth-child(3n+1) .tn-cs-ecg svg { animation-delay: -1.6s; }
}

/* v3：標題改 ONLINE n/N、維護視同正常 */
.tn-cs-all { display: inline-flex; align-items: center; gap: 5px; font: 700 10.5px/1.8 var(--font-mono, ui-monospace, monospace); letter-spacing: .06em; }
.tn-cs-all i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tn-cs-all.is-bad { background: rgba(239,68,68,.14); color: #dc2626; }
html.dark-mode .tn-cs-all.is-bad { color: #f87171; }
.st-maint .tn-cs-ecg .ecg-ok { stroke: #22c55e; }
.st-maint em { color: #3b82f6 !important; font-weight: 500; }
@media (prefers-reduced-motion: no-preference) { .tn-cs-all.is-ok i { animation: tnCsBeat 2s ease-out infinite; } }

/* v4：標題不換行、分組字級、監測面板（LED 陣列＋掃描＋時鐘） */
.tn-cs-h { flex-wrap: nowrap; }
.tn-cs-h b { white-space: nowrap; font-size: 13.5px; }
.tn-cs-all { white-space: nowrap; flex: none; }
.tn-cs-list li.tn-cs-g { padding: 10px 6px 2px !important; margin: 0 !important; font: 700 10.5px/1.4 var(--font-mono, ui-monospace, monospace) !important; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-light) !important; border: 0 !important; }
.tn-cs-mon { height: auto; padding: 9px 10px 7px; background: #03100a; box-shadow: inset 0 0 0 1px rgba(34,197,94,.28), inset 0 0 18px rgba(34,197,94,.12); }
.tn-cs-mon svg { display: none; }
.tn-cs-rack { position: relative; display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-right: 0; }
.tn-cs-rack i { height: 9px; border-radius: 2px; background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.75); }
.tn-cs-rack i.led-minor { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.8); }
.tn-cs-rack i.led-major { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,.95); }
.tn-cs-rack i.led-maint { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,.8); }
.tn-cs-rack i.led-unknown { background: #475569; box-shadow: none; }
.tn-cs-term { display: flex; justify-content: space-between; margin-top: 7px; font: 600 9.5px/1 var(--font-mono, ui-monospace, monospace); letter-spacing: .06em; color: #4ade80; text-shadow: 0 0 6px rgba(34,197,94,.6); }
.tn-cs-bpm { position: static; display: block; margin-top: 4px; font-size: 9.5px; opacity: .85; }
.tn-cs.is-alert .tn-cs-mon { background: #160404; box-shadow: inset 0 0 0 1px rgba(239,68,68,.5), inset 0 0 18px rgba(239,68,68,.2); }
.tn-cs.is-alert .tn-cs-term { color: #f87171; text-shadow: 0 0 6px rgba(239,68,68,.7); }
.tn-cs-mon::after { content: ""; position: absolute; top: 0; bottom: 0; left: -30%; width: 30%; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(74,222,128,.22), transparent); }
@media (prefers-reduced-motion: no-preference) {
  .tn-cs-mon svg { animation: none; }
  .tn-cs-rack i { animation: tnCsLed 1.7s steps(1) infinite; animation-delay: var(--d, 0s); }
  .tn-cs-rack i:nth-child(3n) { animation-duration: 2.3s; } .tn-cs-rack i:nth-child(4n) { animation-duration: 1.1s; }
  @keyframes tnCsLed { 0%, 70% { opacity: 1; } 72% { opacity: .35; } 76% { opacity: 1; } 80% { opacity: .5; } 84%, 100% { opacity: 1; } }
  .tn-cs-rack i.led-major { animation: tnCsBlink .6s steps(2, start) infinite; }
  .tn-cs-mon::after { animation: tnCsScan 3s ease-in-out infinite; }
  @keyframes tnCsScan { 0% { left: -30%; } 55%, 100% { left: 110%; } }
  .tn-cs-clk::after { content: "_"; animation: tnCsBlink 1s steps(2, start) infinite; }
}

.tn-cs-h { gap: 6px; padding: 12px 12px 8px; }
.tn-cs-h b { white-space: nowrap !important; display: inline-block !important; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tn-cs-all { padding: 1px 7px; letter-spacing: .02em; }

/* v5：淺色模式監測面板白底；窄寬度時標題自動縮小、不換行 */
html:not(.dark-mode) .tn-cs-mon { background: #fff linear-gradient(rgba(22,163,74,.06) 1px, transparent 1px) 0 0 / 100% 8px; box-shadow: inset 0 0 0 1px rgba(22,163,74,.28), 0 1px 3px rgba(15,23,42,.06); }
html:not(.dark-mode) .tn-cs-term { color: #15803d; text-shadow: none; }
html:not(.dark-mode) .tn-cs-bpm { color: #15803d; text-shadow: none; }
html:not(.dark-mode) .tn-cs-rack i { box-shadow: 0 0 4px rgba(34,197,94,.45); }
html:not(.dark-mode) .tn-cs-rack i.led-minor { box-shadow: 0 0 4px rgba(245,158,11,.5); }
html:not(.dark-mode) .tn-cs-rack i.led-maint { box-shadow: 0 0 4px rgba(59,130,246,.5); }
html:not(.dark-mode) .tn-cs-mon::after { background: linear-gradient(90deg, transparent, rgba(22,163,74,.12), transparent); }
html:not(.dark-mode) .tn-cs.is-alert .tn-cs-mon { background: #fff5f5; box-shadow: inset 0 0 0 1px rgba(239,68,68,.4); }
html:not(.dark-mode) .tn-cs.is-alert .tn-cs-term, html:not(.dark-mode) .tn-cs.is-alert .tn-cs-bpm { color: #dc2626; }
.tn-cs { container: tncs / inline-size; }
@container tncs (max-width: 230px) { .tn-cs-h b { font-size: 12.5px; } .tn-cs-all { font-size: 9.5px; padding: 1px 5px; } }
