/* static/style.css - Clean Dark Mode */
:root {
  --bg-body: #121212;
  --bg-card: #1e1e1e;
  --bg-hover: #2c2c2c;
  --border-color: #333;
  
  --text-main: #e0e0e0;
  --text-muted: #888;
  
  /* 状态颜色 - 核心需求 */
  --color-safe: #4caf50;   /* 绿色 > 2h */
  --color-warn: #ffc107;   /* 黄色 1-2h */
  --color-danger: #ff5252; /* 红色 < 1h */
  --color-done: #607d8b;   /* 灰色 已刷新 */
  
  --accent-blue: #2196f3;
  --accent-glow: rgba(33, 150, 243, 0.4);

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-stack);
  line-height: 1.5;
  font-size: 14px;
}

.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* 头部 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}
.header h1 { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--text-main); }
.header h1 small { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-left: 8px; }

/* 卡片通用 */
.card {
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header h2 { font-size: 16px; font-weight: 600; color: var(--accent-blue); text-transform: uppercase; }

/* 实时指示器 */
.live-indicator {
    font-size: 12px;
    color: var(--color-safe);
    font-weight: bold;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

/* 表格样式 */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: center; }
th { 
    background: #252525; 
    color: var(--text-muted); 
    font-weight: 500; 
    padding: 12px; 
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}
td { 
    padding: 12px; 
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid #2a2a2a;
    transition: background 0.2s;
}

/* 交互单元格 */
td.interactive { cursor: pointer; position: relative; }
td.interactive:hover { background-color: var(--bg-hover); }
/* 点击后的选中效果 */
td.interactive:active { background-color: #383838; }

/* 状态色彩系统 */
.status-safe { color: var(--color-safe); font-weight: 500; }
.status-warn { color: var(--color-warn); font-weight: 700; }
.status-danger { color: var(--color-danger); font-weight: 700; text-shadow: 0 0 5px rgba(255, 82, 82, 0.3); }
.status-done { color: var(--color-done); opacity: 0.7; }
.status-na { color: #444; }

/* 倒计时闪烁 (只针对红色预警) */
.blink-danger { animation: flashRed 1.5s infinite; }
@keyframes flashRed { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; color: #ff8a80; } }

/* 筛选按钮组 */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-filter {
    background: transparent;
    border: 1px solid #444;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.btn-filter:hover { border-color: var(--text-muted); color: var(--text-main); }
.btn-filter.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Modal 弹窗系统 */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    opacity: 1; transition: opacity 0.2s;
}
.modal-overlay.hidden { opacity: 0; pointer-events: none; }

.modal-content {
    background: #222;
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    width: 90%; max-width: 400px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transform: scale(1); transition: transform 0.2s;
}
.modal-header {
    padding: 15px 20px;
    background: #2a2a2a;
    border-bottom: 1px solid #333;
    display: flex; justify-content: space-between; align-items: center;
}
.close-btn { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

.modal-body { padding: 20px; }

.target-info {
    display: flex; justify-content: center; align-items: center; gap: 10px;
    margin-bottom: 20px; font-size: 18px; color: #fff;
}
.highlight-text { color: var(--accent-blue); font-weight: bold; }

.time-inputs { display: flex; gap: 15px; margin-bottom: 20px; }
.input-group { flex: 1; }
.input-group label { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 12px; }
.input-lcd {
    width: 100%;
    background: #000;
    border: 1px solid #444;
    color: var(--color-safe);
    font-family: monospace;
    font-size: 24px;
    padding: 10px;
    text-align: center;
    border-radius: 4px;
}
.input-lcd:focus { outline: none; border-color: var(--accent-blue); }

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.btn-chip {
    background: #333; border: none; color: #ccc;
    padding: 5px 10px; border-radius: 12px; font-size: 12px; cursor: pointer;
}
.btn-chip:hover { background: #444; color: #fff; }

.modal-footer { padding: 15px 20px; border-top: 1px solid #333; text-align: center; }

/* 按钮通用 */
.btn { border: none; border-radius: 4px; padding: 10px 20px; cursor: pointer; font-size: 14px; transition: opacity 0.2s; }
.btn-primary { background: var(--accent-blue); color: white; font-weight: 600; width: 100%; }
.btn-primary:hover { opacity: 0.9; }
.btn-logout { background: #333; color: #aaa; text-decoration: none; padding: 6px 12px; font-size: 12px; }
.btn-logout:hover { background: #d32f2f; color: white; }

.status-msg { margin-top: 10px; height: 20px; font-size: 12px; color: var(--color-safe); }

/* ===== 大区切换 ===== */
.region-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn-region {
  background: transparent;
  border: 1px solid #444;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-region:hover {
  border-color: var(--accent-blue);
  color: var(--text-main);
}

.btn-region.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* 登录错误 */
.error-msg {
  color: #ff5252;
  margin-bottom: 12px;
  font-size: 13px;
}