/* 守护者 Guardian v0.4.0 - 样式 */
:root {
    --bg: #0f172a; --surface: #1e293b; --surface2: #334155;
    --text: #f1f5f9; --text2: #94a3b8; --accent: #3b82f6;
    --green: #22c55e; --red: #ef4444; --orange: #f59e0b; --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.header { display: flex; justify-content: space-between; align-items: center; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--surface2); position: sticky; top: 0; z-index: 100; }
.logo { font-size: 1.2em; font-weight: 700; }
.version { font-size: 0.6em; color: var(--accent); margin-left: 6px; }
.header-info { display: flex; align-items: center; gap: 14px; font-size: 0.85em; color: var(--text2); }
.ws-dot { width: 10px; height: 10px; border-radius: 50%; }
.ws-dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }
.ws-dot.offline { background: var(--red); }
.nav-link { color: var(--accent); text-decoration: none; font-size: 0.9em; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--accent); transition: all 0.2s; }
.nav-link:hover { background: var(--accent); color: #fff; }

.dashboard { padding: 18px 28px; max-width: 1500px; margin: 0 auto; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--surface2); }
.stat-icon { font-size: 1.6em; }
.stat-value { font-size: 1.6em; font-weight: 700; }
.stat-label { font-size: 0.78em; color: var(--text2); }
.alert-card .stat-value { color: var(--orange); }
.unread-card .stat-value { color: var(--red); }

.score-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.score-card { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); border-radius: var(--radius); padding: 18px; border: 1px solid var(--surface2); display: flex; align-items: center; gap: 18px; }
.score-circle { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4em; font-weight: 700; flex-shrink: 0; }
.score-excellent { background: rgba(34,197,94,0.15); color: var(--green); border: 3px solid var(--green); }
.score-good { background: rgba(59,130,246,0.15); color: var(--accent); border: 3px solid var(--accent); }
.score-normal { background: rgba(245,158,11,0.15); color: var(--orange); border: 3px solid var(--orange); }
.score-warn { background: rgba(239,68,68,0.15); color: var(--red); border: 3px solid var(--red); }
.score-info h3 { font-size: 0.95em; margin-bottom: 4px; }
.score-info p { font-size: 0.78em; color: var(--text2); line-height: 1.5; }

.trend-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.trend-card { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); border-radius: var(--radius); padding: 14px 18px; border: 1px solid var(--surface2); }
.trend-header { font-size: 0.9em; font-weight: 600; margin-bottom: 10px; color: var(--accent); }
.trend-body { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.trend-item { text-align: center; }
.trend-label { display: block; font-size: 0.72em; color: var(--text2); margin-bottom: 3px; }
.trend-val { font-size: 1.05em; font-weight: 600; }
.trend-pred { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--surface2); display: flex; justify-content: center; gap: 10px; align-items: center; }

.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.chart-panel { min-height: 300px; }
.chart-box { width: 100%; height: 280px; }

.main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .charts-grid, .main-grid { grid-template-columns: 1fr; } .stats-row { grid-template-columns: repeat(2, 1fr); } .score-row, .trend-row { grid-template-columns: 1fr; } }

.panel { background: var(--surface); border-radius: var(--radius); padding: 16px; border: 1px solid var(--surface2); }
.panel h2 { font-size: 0.95em; margin-bottom: 12px; }
.live-dot { color: var(--red); font-size: 0.7em; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.health-table-wrap { max-height: 350px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.83em; }
th { text-align: left; padding: 7px 10px; color: var(--text2); border-bottom: 1px solid var(--surface2); position: sticky; top: 0; background: var(--surface); }
td { padding: 6px 10px; border-bottom: 1px solid rgba(148,163,184,0.08); }
tr:hover td { background: rgba(59,130,246,0.05); }
tr.new-row { animation: flash-in 0.5s ease; }
@keyframes flash-in { from { background: rgba(59,130,246,0.2); } to { background: transparent; } }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.78em; font-weight: 600; }
.badge-normal { background: rgba(34,197,94,0.2); color: var(--green); }
.badge-danger { background: rgba(239,68,68,0.2); color: var(--red); }

.alert-list { max-height: 350px; overflow-y: auto; }
.alert-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 8px; margin-bottom: 6px; background: var(--surface2); cursor: pointer; }
.alert-item.unread { border-left: 3px solid var(--red); }
.alert-item.read { opacity: 0.5; }
.alert-icon { font-size: 1.2em; flex-shrink: 0; }
.alert-content { flex: 1; }
.alert-message { font-size: 0.88em; margin-bottom: 3px; }
.alert-meta { font-size: 0.75em; color: var(--text2); }

.btn-sm { margin-top: 10px; width: 100%; padding: 8px; border: 1px dashed var(--surface2); border-radius: 8px; background: transparent; color: var(--accent); cursor: pointer; font-size: 0.85em; transition: all 0.2s; }
.btn-sm:hover { background: rgba(59,130,246,0.1); border-color: var(--accent); }

.med-list { max-height: 300px; overflow-y: auto; }
.med-item { display: flex; align-items: center; justify-content: space-between; padding: 10px; background: var(--surface2); border-radius: 8px; margin-bottom: 6px; }
.med-info { flex: 1; }
.med-name { font-weight: 600; font-size: 0.9em; }
.med-detail { font-size: 0.78em; color: var(--text2); }
.med-delete { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1.2em; padding: 0 6px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 24px; width: 400px; max-width: 90vw; border: 1px solid var(--surface2); }
.modal-box h3 { margin-bottom: 16px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.83em; color: var(--text2); margin-bottom: 4px; }
.form-group input, .form-group select { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--surface2); background: var(--bg); color: var(--text); font-size: 0.95em; outline: none; }
.form-group input:focus { border-color: var(--accent); }
.modal-btns { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }
.btn-cancel { padding: 10px 20px; border: 1px solid var(--surface2); border-radius: 8px; background: transparent; color: var(--text2); cursor: pointer; }
.btn-save { padding: 10px 20px; border: none; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font-weight: 600; }

.empty-state { text-align: center; padding: 30px; color: var(--text2); }
.empty-state .icon { font-size: 2em; margin-bottom: 8px; }
