/* ============================================
   芯添风格 ServerStatus 主题
   ============================================ */

:root {
  --bg: #0a0e14;
  --bg-card: #12171f;
  --bg-card-hover: #181e28;
  --border: #1c2333;
  --border-accent: #00e5a0;
  --text: #e6edf3;
  --text-secondary: #b0b8c4;
  --text-muted: #8b949e;
  --accent: #00e5a0;
  --accent-dim: rgba(0, 229, 160, 0.08);
  --online: #00e5a0;
  --offline: #f87171;
  --bar-bg: #1c2333;
  --mono: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
  --sans: 'Noto Sans SC', -apple-system, 'PingFang SC', sans-serif;
}

[data-theme="light"] {
  --bg: #f8f9fb;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f6;
  --border: #e1e4e8;
  --border-accent: #009977;
  --text: #1f2328;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent: #009977;
  --accent-dim: rgba(0, 153, 119, 0.06);
  --online: #009977;
  --offline: #dc2626;
  --bar-bg: #e1e4e8;
}

/* Reset & Base */
* { box-sizing: border-box; }

body {
  background: var(--bg) !important;
  background-image: none !important;
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}

/* 强制覆盖原背景（包括 base64 编码的动漫图） */
html, html body, body {
  background: var(--bg) !important;
  background-image: none !important;
}
html::before, html::after, body::before, body::after {
  background-image: none !important;
  background: none !important;
}

/* 移除 header 中的动漫封面图 */
#header {
  background: var(--bg-card) !important;
  background-image: none !important;
}

/* 移除移动端 header 背景图 */
@media (max-width: 768px) {
  #app #header, #header {
    background: var(--bg-card) !important;
    background-image: none !important;
  }
}

/* Header */
#header {
  background: linear-gradient(135deg, #0a0e14 0%, #12171f 50%, #0a0e14 100%) !important;
  background-image: none !important;
  height: 14rem !important;
  position: relative;
}

/* 强制覆盖 header 背景图 */
#header, #header::before, #header::after {
  background-image: none !important;
}

/* 隐藏原版 header::after 的 Pixiv 来源 */
#header::after {
  content: 'Xin.Knit · ServerStatus' !important;
}

#header:before {
  background: rgba(0, 229, 160, 0.03) !important;
}

#header:after {
  content: 'Xin.Knit · ServerStatus' !important;
  position: absolute;
  right: 15px;
  bottom: 10px;
  z-index: 2;
  color: var(--text-muted) !important;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-shadow: none !important;
}

#header-content {
  text-align: center;
}

#header h1 {
  font-family: var(--mono) !important;
  font-size: 2rem !important;
  color: var(--text) !important;
  text-shadow: none !important;
  letter-spacing: 2px;
}

#header h1::before {
  content: '> ';
  color: var(--accent);
}

#header p {
  font-size: 0.9rem !important;
  color: var(--text-secondary) !important;
  font-family: var(--mono);
  text-shadow: none !important;
}

/* Table */
#table {
  background: transparent !important;
}

#table thead tr th {
  color: var(--text-muted) !important;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border) !important;
  font-weight: 500;
}

tr.tableRow {
  background-color: var(--bg-card) !important;
  border-bottom: 1px solid var(--border) !important;
  transition: background 0.2s;
}

tr.tableRow:hover {
  background-color: var(--bg-card-hover) !important;
}

tr td {
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
  border: none !important;
  font-family: var(--sans);
  font-size: 0.85rem;
}

/* Status indicator */
/* 隐藏状态小圆点 */
tr td:first-child::before {
  display: none !important;
}

tr td:first-child {
  padding-left: 14px !important;
}

/* Progress bars */
/* 状态进度条 - 在第一列显示 */
.status-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.status-bar.online {
  background: var(--online);
}

.status-bar.slow {
  background: var(--warning);
}

.status-bar.offline {
  background: var(--offline);
}

/* Progress bars */
div.progress {
  background: var(--bar-bg) !important;
  border-radius: 4px !important;
  overflow: hidden;
  height: 25px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0.6em 0 !important;
  display: block !important;
}

/* 表格中的进度条 */
tr td div.progress {
  width: 100% !important;
  max-width: none !important;
  display: block !important;
}

div.progress div.bar {
  background: var(--accent) !important;
  border-radius: 4px !important;
  font-size: 0.9rem !important;
  line-height: 25px !important;
  color: #fff !important;
  min-width: 0 !important;
  height: 25px !important;
  transition: width 0.5s ease;
}

/* 卡片中的进度条 - 细长条 */
div.card div.progress {
  width: 100% !important;
  max-width: none !important;
  margin: 1em 0 !important;
  height: 8px !important;
}

div.card div.progress div.bar {
  height: 8px !important;
  line-height: 8px !important;
  font-size: 0 !important;
  color: transparent !important;
}

/* Cards */
div.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  transition: all 0.2s;
}

div.card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-card-hover) !important;
}

div.card div.card-header span {
  font-family: var(--mono);
  font-size: 1rem !important;
  font-weight: 600;
  color: var(--text);
}

div.card div.card-header p {
  color: var(--text-muted) !important;
  font-size: 0.75rem;
  font-family: var(--mono);
}

div.card div.card-content p {
  color: var(--text-secondary) !important;
  font-size: 0.8rem;
}

/* Cards section */
#cards {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

/* Footer */
.footer p {
  text-align: center;
  padding: 15px 0;
  color: var(--text-muted) !important;
  font-family: var(--mono);
  font-size: 0.7rem;
}

.footer p a {
  color: var(--accent) !important;
  text-decoration: none;
  transition: color 0.2s;
}

.footer p a:hover {
  color: var(--text);
}

/* Error text */
p.error {
  color: var(--offline) !important;
}

/* Updated time */
.updated {
  color: var(--text-muted) !important;
  font-family: var(--mono);
  font-size: 0.7rem;
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 1000;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Responsive */
@media (max-width: 767px) {
  #header {
    height: 10rem !important;
  }
  #header h1 {
    font-size: 1.4rem !important;
  }
  #cards .column {
    width: 100% !important;
    margin: 0 auto !important;
  }
}
