/* =========================================================
   hPanel 高保真原型 · 样式表（Hostinger 紫色主题）
   ========================================================= */

:root{
  /* 品牌主色 */
  --purple:        #673DE6;
  --purple-hover:  #5429C3;
  --purple-soft:   #F1ECFF;
  --purple-border: #D9CFFF;

  /* 功能色 */
  --blue:   #2F7BF6;
  --green:  #1FA463;
  --amber:  #FF9E1B;
  --red:    #E63946;
  --teal:   #0FA3A3;

  /* 文本 */
  --text:       #1D1F20;
  --text-2:     #4B4E51;
  --text-muted: #74787A;
  --text-faint: #9AA0A6;

  /* 背景与描边 */
  --bg:       #F6F7F9;
  --surface:  #FFFFFF;
  --surface-2:#FAFAFB;
  --border:   #E6E8EB;
  --border-2: #EEEFF1;

  /* 尺寸 */
  --sidebar-w: 252px;
  --topbar-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,p,ul,ol{ margin: 0; padding: 0; }
ul,ol{ list-style: none; }
a{ color: inherit; text-decoration: none; }

button, input, select{ font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 图标 ---------- */
.ic{ width: 20px; height: 20px; flex: none; }
.ic-xs{ width: 14px; height: 14px; }
.ic-muted{ color: var(--text-muted); }

/* =========================================================
   布局
   ========================================================= */
.app{ display: flex; min-height: 100vh; }

/* ---------- 左侧导航栏 ---------- */
.sidebar{
  width: var(--sidebar-w);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
}

.sidebar-brand{
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-2);
  flex: none;
}
.brand-logo{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--purple);
}
.brand-logo span{ color: var(--text); font-weight: 700; }
.sidebar-close{
  display: none;
  background: none; border: 0; cursor: pointer;
  color: var(--text-muted); padding: 4px;
}

/* 账户切换器 */
.account-switcher{
  margin: 12px 12px 4px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 24px);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.account-switcher:hover{ background: #F1F2F4; border-color: var(--border); }
.account-switcher-txt{ display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-switcher-name{ font-size: 13px; font-weight: 600; color: var(--text); }
.account-switcher-mail{
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-switcher-arrow{ flex: none; }

.avatar{
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #673DE6);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.avatar-sm{ width: 30px; height: 30px; font-size: 12px; }
.avatar-sm.blue{ background: linear-gradient(135deg, #57A0FF, #2F7BF6); }
.avatar-sm.purple{ background: linear-gradient(135deg, #A78BFA, #7C3AED); }
.avatar-sm.green{ background: linear-gradient(135deg, #4ADE9B, #1FA463); }
.avatar-sm.amber{ background: linear-gradient(135deg, #FFC14D, #FF9E1B); }
.avatar-sm.grey{ background: linear-gradient(135deg, #C4C8CC, #9AA0A6); }

/* 导航 */
.nav{ flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.nav-label{
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  color: var(--text-faint);
  padding: 16px 12px 6px;
}
.nav-item{
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item:hover{ background: var(--surface-2); color: var(--text); }
.nav-item.active{
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 600;
}
.nav-item.active .ic{ color: var(--purple); }
.nav-item .ic{ color: var(--text-faint); }
.nav-item span{ flex: 1; }
.nav-count{
  font-size: 12px; font-style: normal; font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 20px; padding: 2px 8px;
}
.nav-item.active .nav-count{ background: #fff; color: var(--purple); }
.nav-count.dot{ background: var(--red); color: #fff; padding: 2px 7px; }

.sidebar-footer{ flex: none; padding: 12px; border-top: 1px solid var(--border-2); }
.upgrade-card{
  background: linear-gradient(150deg, #F4F0FF, #EDE7FF);
  border: 1px solid var(--purple-border);
  border-radius: var(--radius);
  padding: 16px;
}
.upgrade-card-icon{
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--purple); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.upgrade-card-title{ font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.upgrade-card-desc{ font-size: 12px; color: var(--text-2); margin-bottom: 12px; line-height: 1.6; }
.sidebar-support{
  display: flex; align-items: center; gap: 8px;
  padding: 12px 4px 2px;
  font-size: 12px; color: var(--text-muted);
  cursor: pointer;
}
.sidebar-support:hover{ color: var(--purple); }

.sidebar-mask{
  display: none;
  position: fixed; inset: 0;
  background: rgba(16, 24, 40, .45);
  z-index: 55;
}

/* ---------- 主区域 ---------- */
.main{
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部用户信息栏 ---------- */
.topbar{
  height: var(--topbar-h);
  flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 40;
}
.topbar-menu{ display: none; }

.search{
  flex: 1; max-width: 380px;
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background .15s, border-color .15s;
}
.search:focus-within{ background: #fff; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(103,61,230,.1); }
.search input{ flex: 1; border: 0; outline: 0; background: none; min-width: 0; }
.search input::placeholder{ color: var(--text-faint); }
.search-kbd{
  font-size: 11px; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; background: #fff;
}

.topbar-actions{ margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-divider{ width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

.icon-btn{
  width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover{ background: var(--surface-2); color: var(--text); border-color: #D5D8DC; }
.icon-btn:disabled{ opacity: .45; cursor: not-allowed; }
.icon-btn.danger:hover{ color: var(--red); border-color: #F6C9CD; background: #FDF1F2; }
.icon-btn.has-dot{ position: relative; }
.icon-btn.has-dot::after{
  content: ""; position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid #fff;
}

/* 用户下拉 */
.user-menu{ position: relative; }
.user-trigger{
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 10px 0 6px;
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.user-trigger:hover{ background: var(--surface-2); }
.user-txt{ display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-name{ font-size: 13px; font-weight: 600; }
.user-mail{ font-size: 11px; color: var(--text-muted); }

.dropdown{
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 244px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 50;
}
.user-menu.open .dropdown{ opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-head{ display: flex; align-items: center; gap: 10px; padding: 8px; }
.dropdown-name{ font-size: 14px; font-weight: 600; }
.dropdown-mail{ font-size: 12px; color: var(--text-muted); word-break: break-all; }
.dropdown-sep{ height: 1px; background: var(--border-2); margin: 6px 0; }
.dropdown-item{
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.dropdown-item .ic{ color: var(--text-faint); }
.dropdown-item:hover{ background: var(--surface-2); color: var(--text); }
.dropdown-item.danger, .dropdown-item.danger .ic{ color: var(--red); }
.dropdown-item.danger:hover{ background: #FDF1F2; }

/* =========================================================
   内容区
   ========================================================= */
.content{ padding: 24px 28px 48px; flex: 1; min-width: 0; }
.page{ display: none; animation: fade .18s ease; }
.page.active{ display: block; }
@keyframes fade{ from{ opacity: 0; transform: translateY(4px); } to{ opacity: 1; transform: none; } }

.page-head{
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-title{ font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.page-sub{ font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-actions{ display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-head{
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-2);
}
.card-title{ font-size: 15px; font-weight: 700; }
.card-sub{ font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-body{ padding: 20px; }
.muted{ color: var(--text-muted); }
.mono{ font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.ellipsis{ max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }

/* 栅格 */
.grid{ display: grid; gap: 20px; margin-bottom: 20px; }
.grid > .card{ margin-bottom: 0; }
.grid-2-1{ grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-sidebar{ grid-template-columns: 260px minmax(0, 1fr); }

/* ---------- 统计卡片 ---------- */
.stat-grid{
  display: grid; gap: 16px; margin-bottom: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat-grid-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid .card{ margin-bottom: 0; }

.stat-card{ padding: 18px; }
.stat-top{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon{
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon.purple{ background: var(--purple-soft); color: var(--purple); }
.stat-icon.blue{ background: #E8F1FE; color: var(--blue); }
.stat-icon.green{ background: #E4F7EE; color: var(--green); }
.stat-icon.amber{ background: #FFF3E0; color: var(--amber); }
.stat-icon.red{ background: #FDEAEC; color: var(--red); }
.stat-icon.teal{ background: #E0F6F6; color: var(--teal); }

.stat-value{ font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; }
.stat-value em{ font-size: 15px; font-weight: 600; font-style: normal; color: var(--text-faint); }
.stat-label{ font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stat-link{
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--purple);
}
.stat-link:hover{ color: var(--purple-hover); }
.stat-card .progress{ margin-top: 12px; }

/* ---------- 按钮 ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn .ic{ width: 17px; height: 17px; }
.btn-primary{ background: var(--purple); color: #fff; }
.btn-primary:hover{ background: var(--purple-hover); box-shadow: 0 4px 12px rgba(103,61,230,.25); }
.btn-secondary{ background: #fff; border-color: var(--border); color: var(--text); }
.btn-secondary:hover{ background: var(--surface-2); border-color: #D5D8DC; }
.btn-ghost{ background: none; color: var(--text-muted); }
.btn-ghost:hover{ background: var(--surface-2); color: var(--text); }
.btn-danger{ background: var(--red); color: #fff; }
.btn-sm{ height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block{ width: 100%; }

/* ---------- 徽章 ---------- */
.badge{
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge .ic{ width: 13px; height: 13px; }
.badge-success{ background: #E4F7EE; color: #14794A; }
.badge-warning{ background: #FFF3E0; color: #A0650A; }
.badge-danger{ background: #FDEAEC; color: #B32430; }
.badge-info{ background: #E8F1FE; color: #1A5FC4; }
.badge-neutral{ background: #F0F1F3; color: var(--text-2); }
.badge-purple{ background: var(--purple-soft); color: var(--purple); }
.badge-success-soft{ background: #F0FBF5; color: #14794A; border: 1px solid #CDEEDD; }
.badge-danger-soft{ background: #FEF6F7; color: #B32430; border: 1px solid #F6CFD4; }

.tag{
  display: inline-block;
  padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}

/* 状态圆点 */
.pulse{
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); display: inline-block;
  box-shadow: 0 0 0 0 rgba(31,164,99,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse{
  70%{ box-shadow: 0 0 0 6px rgba(31,164,99,0); }
  100%{ box-shadow: 0 0 0 0 rgba(31,164,99,0); }
}

/* ---------- 开关 ---------- */
.switch{ position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input{ position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch .slider{
  position: absolute; inset: 0;
  background: #D3D7DB; border-radius: 999px;
  transition: background .2s;
}
.switch .slider::after{
  content: ""; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.switch input:checked + .slider{ background: var(--purple); }
.switch input:checked + .slider::after{ transform: translateX(18px); }
.switch input:focus-visible + .slider{ box-shadow: 0 0 0 3px rgba(103,61,230,.18); }
.switch input:disabled + .slider{ opacity: .5; cursor: not-allowed; }
.switch input:disabled{ cursor: not-allowed; }
.switch-lg{ width: 50px; height: 28px; }
.switch-lg .slider::after{ width: 22px; height: 22px; }
.switch-lg input:checked + .slider::after{ transform: translateX(22px); }

/* ---------- 进度条 ---------- */
.progress{
  height: 8px; border-radius: 999px;
  background: #EEEFF1; overflow: hidden;
}
.progress.slim{ height: 6px; }
.progress-bar{
  height: 100%; border-radius: 999px;
  background: var(--purple);
  transition: width .4s ease;
}
.progress-bar.blue{ background: var(--blue); }
.progress-bar.green{ background: var(--green); }
.progress-bar.amber{ background: var(--amber); }
.progress-bar.grey{ background: #C4C8CC; }

/* 堆叠条 */
.stack-bar{
  display: flex; height: 10px; border-radius: 999px; overflow: hidden;
  margin: 8px 0 12px;
}
.stack-bar .seg{ display: block; height: 100%; }
.seg.purple{ background: var(--purple); }
.seg.blue{ background: var(--blue); }
.seg.green{ background: var(--green); }
.seg.amber{ background: var(--amber); }
.seg.grey{ background: #C4C8CC; }

.legend{
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: 12px; color: var(--text-2); margin-bottom: 20px;
}
.legend span{ display: inline-flex; align-items: center; gap: 6px; }
.dot{ width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.purple{ background: var(--purple); }
.dot.blue{ background: var(--blue); }
.dot.green{ background: var(--green); }
.dot.amber{ background: var(--amber); }
.dot.grey{ background: #C4C8CC; }

/* ---------- 资源使用行 ---------- */
.usage-row{ margin-bottom: 16px; }
.usage-row:last-child{ margin-bottom: 0; }
.usage-info{
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px; font-size: 13px;
}
.usage-info span{ color: var(--text-2); }
.usage-info strong{ font-size: 13px; }
.usage-info em{ font-style: normal; color: var(--text-faint); font-weight: 500; }

/* ---------- 环形指标 ---------- */
.mini-gauge-row{ display: flex; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
.mini-gauge{ text-align: center; flex: 1; }
.mini-gauge p{ font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.ring{
  position: relative;
  width: 74px; height: 74px; margin: 0 auto;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #EEEFF1;
}
.ring::before{
  content: ""; position: absolute; inset: 7px;
  background: #fff; border-radius: 50%;
}
.ring > span{
  position: relative; z-index: 2;
  font-size: 14px; font-weight: 700;
}
.ring-lg{ width: 104px; height: 104px; }
.ring-lg::before{ inset: 10px; }
.ring-lg > span{ font-size: 22px; }
.ring-lg > span small{ font-size: 12px; font-weight: 600; color: var(--text-muted); }

.gauge-grid{
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px; padding: 20px;
  border-top: 1px solid var(--border-2);
  background: var(--surface-2);
}
.gauge{ text-align: center; }
.gauge-label{ font-size: 13px; font-weight: 600; margin-top: 10px; }
.gauge-sub{ font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- 键值列表 ---------- */
.kv-list li{
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 9px 0;
  border-bottom: 1px dashed var(--border-2);
  font-size: 13px;
}
.kv-list li:last-child{ border-bottom: 0; }
.kv-list li span{ color: var(--text-muted); flex: none; }
.kv-list li strong{ font-weight: 600; text-align: right; display: inline-flex; align-items: center; gap: 5px; }
.kv-list.compact li{ padding: 7px 0; font-size: 12.5px; }

/* ---------- 图表 ---------- */
.chart{ width: 100%; height: 220px; }
.chart svg{ width: 100%; height: 100%; display: block; overflow: visible; }
.chart-legend{ display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.chart-legend span{ display: inline-flex; align-items: center; gap: 6px; }

.chart-metrics{
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border-2);
}
.chart-metrics p{ font-size: 12px; color: var(--text-muted); }
.chart-metrics strong{ display: block; font-size: 16px; margin: 2px 0; }
.chart-metrics .up{ font-size: 12px; color: var(--green); font-weight: 600; }
.chart-metrics .down{ font-size: 12px; color: var(--red); font-weight: 600; }

/* ---------- 时间轴 ---------- */
.timeline li{ display: flex; gap: 12px; padding-bottom: 18px; position: relative; }
.timeline li:not(:last-child)::before{
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0;
  width: 2px; background: var(--border-2);
}
.timeline-icon{
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.timeline-icon.green{ background: #E4F7EE; color: var(--green); }
.timeline-icon.purple{ background: var(--purple-soft); color: var(--purple); }
.timeline-icon.blue{ background: #E8F1FE; color: var(--blue); }
.timeline-icon.amber{ background: #FFF3E0; color: var(--amber); }
.timeline-icon.grey{ background: #F0F1F3; color: var(--text-muted); }
.timeline-title{ font-size: 13px; font-weight: 500; }
.timeline-meta{ font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- 待办 ---------- */
.todo-list{ display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.todo-item{
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--surface-2);
}
.todo-icon{
  width: 36px; height: 36px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.todo-item.danger .todo-icon{ background: #FDEAEC; color: var(--red); }
.todo-item.warning .todo-icon{ background: #FFF3E0; color: var(--amber); }
.todo-item.info .todo-icon{ background: #E8F1FE; color: var(--blue); }
.todo-txt{ flex: 1; min-width: 0; }
.todo-title{ font-size: 14px; font-weight: 600; }
.todo-desc{ font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ---------- 快捷操作 ---------- */
.quick-grid{ display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.quick-item{
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 8px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border-2);
  font-size: 13px; color: var(--text-2); cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.quick-item:hover{ background: #fff; border-color: var(--purple-border); transform: translateY(-2px); }
.quick-icon{
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.quick-icon.purple{ background: linear-gradient(135deg, #8B5CF6, #673DE6); }
.quick-icon.blue{ background: linear-gradient(135deg, #57A0FF, #2F7BF6); }
.quick-icon.green{ background: linear-gradient(135deg, #4ADE9B, #1FA463); }
.quick-icon.amber{ background: linear-gradient(135deg, #FFC14D, #FF9E1B); }
.quick-icon.teal{ background: linear-gradient(135deg, #2EC4C4, #0FA3A3); }
.quick-icon.red{ background: linear-gradient(135deg, #F87171, #E63946); }

/* =========================================================
   表格 / 工具栏
   ========================================================= */
.toolbar{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--border-2);
}
.toolbar-left, .toolbar-right{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-hint{ font-size: 13px; color: var(--text-muted); }

.input-inline{
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: background .15s, border-color .15s;
}
.input-inline:focus-within{ background: #fff; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(103,61,230,.1); }
.input-inline input{ flex: 1; border: 0; outline: 0; background: none; min-width: 0; }
.input-inline input::placeholder{ color: var(--text-faint); }

.select{
  height: 36px; padding: 0 32px 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2374787A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none; cursor: pointer; font-size: 13px;
}
.select:hover{ border-color: #D5D8DC; }

.table-wrap{ overflow-x: auto; }
.data-table{ width: 100%; border-collapse: collapse; }
.data-table th{
  text-align: left; padding: 11px 16px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td{
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
  font-size: 13.5px;
}
.data-table tbody tr{ transition: background .12s; }
.data-table tbody tr:hover{ background: #FAFBFC; }
.data-table tbody tr:last-child td{ border-bottom: 0; }
.data-table tr.row-muted td{ background: #FCFCFD; }
.data-table tr.row-muted .cell-title{ color: var(--text-muted); }
.col-check{ width: 44px; }
.col-actions{ width: 176px; }
.table-plain th{ background: transparent; }

input[type="checkbox"]{
  width: 16px; height: 16px; accent-color: var(--purple); cursor: pointer;
}

.cell-main{ display: flex; align-items: center; gap: 10px; }
.cell-title{ font-size: 13.5px; font-weight: 600; }
.cell-sub{ font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.row-actions{ display: flex; gap: 6px; }
.row-actions .icon-btn{ width: 32px; height: 32px; }
.row-actions .icon-btn .ic{ width: 16px; height: 16px; }

.favicon{
  width: 34px; height: 34px; flex: none;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.favicon.wp{ background: #21759B; }
.favicon.wc{ background: #7F54B3; }
.favicon.html{ background: #E44D26; font-size: 11px; }
.favicon.php{ background: #777BB4; }
.favicon.jm{ background: #F9A623; }
.favicon.domain{ background: #EEF0F3; color: var(--text-2); font-size: 10px; }
.favicon.db{ background: linear-gradient(135deg, #8B5CF6, #673DE6); font-size: 11px; }
.favicon.purple{ background: var(--purple-soft); color: var(--purple); font-size: 13px; }

.cell-file{ display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.folder-ico{ color: #FFB74D; }
.file-ico{ color: var(--text-faint); }

.link-cell{ display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); }
.link-cell.muted{ color: var(--text-muted); }

.usage-cell{ min-width: 130px; }
.usage-txt{ font-size: 12px; color: var(--text-muted); display: block; margin-top: 4px; }
.usage-txt.warn{ color: var(--amber); font-weight: 600; }

.table-footer{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--border-2);
  font-size: 13px;
}
.pager{ display: flex; align-items: center; gap: 6px; }
.pager-num{
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; font-size: 13px; cursor: pointer;
}
.pager-num:hover{ background: var(--surface-2); }
.pager-num.active{ background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 600; }

.empty-row td{
  padding: 40px 16px !important;
  text-align: center; color: var(--text-faint);
}

/* =========================================================
   各页面专用组件
   ========================================================= */

/* 服务器状态卡（仪表盘） */
.check-list li{
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 13px; color: var(--text-2);
}
.check{
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.check.ok{ background: #E4F7EE; color: var(--green); }
.check.warn{ background: #FFF3E0; color: var(--amber); }

/* 文件管理器 Hero */
.card-hero{ padding: 24px; }
.hero-content{ display: flex; gap: 18px; align-items: flex-start; }
.hero-icon{
  width: 56px; height: 56px; flex: none; border-radius: 14px;
  background: linear-gradient(135deg, #FFC14D, #FF9E1B);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.hero-title{ font-size: 19px; font-weight: 700; }
.hero-desc{ font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.7; }
.hero-actions{ display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.hero-stats{
  display: flex; gap: 32px; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border-2);
}
.hero-stats li{ display: flex; flex-direction: column; }
.hero-stats strong{ font-size: 18px; }
.hero-stats span{ font-size: 12px; color: var(--text-muted); }

/* 甜甜圈图 */
.donut-wrap{ position: relative; width: 168px; margin: 0 auto 18px; }
.donut{
  width: 168px; height: 168px; border-radius: 50%;
  background: #EEEFF1;
}
.donut::before{ content: ""; position: absolute; inset: 20px; background: #fff; border-radius: 50%; }
.donut-center{
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-center strong{ font-size: 20px; }
.donut-center span{ font-size: 12px; color: var(--text-muted); }
.legend-list li{
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; font-size: 13px; color: var(--text-2);
  border-bottom: 1px dashed var(--border-2);
}
.legend-list li:last-child{ border-bottom: 0; }
.legend-list strong{ margin-left: auto; }

/* 目录树 */
.tree-card .card-body{ padding: 12px 16px; }
.tree li{ position: relative; }
.tree-row{
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.tree-row:hover{ background: var(--surface-2); }
.tree-row.active{ background: var(--purple-soft); color: var(--purple); font-weight: 600; }
.tree-ico{ color: var(--text-faint); }
.tree-row.active .tree-ico{ color: var(--purple); }
.tree-item > ul{ display: none; padding-left: 20px; }
.tree-item.open > ul{ display: block; }

.breadcrumb{ display: flex; align-items: center; gap: 6px; font-size: 13px; }
.breadcrumb a{ color: var(--text-muted); }
.breadcrumb a:hover{ color: var(--purple); }
.breadcrumb span{ color: var(--text); font-weight: 600; }

/* 配置块 */
.config-grid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.config-block{
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border-2);
}
.config-title{ font-size: 13px; font-weight: 700; margin-bottom: 6px; }

/* 提示条 */
.notice{
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 16px; padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #F0FBF5; border: 1px solid #CDEEDD;
  color: #14794A;
}
.notice .ic{ margin-top: 1px; }
.notice-title{ font-size: 13px; font-weight: 700; }
.notice-desc{ font-size: 12.5px; margin-top: 2px; color: var(--text-2); }
.card-body > .notice:last-child{ margin-bottom: 0; }
.kv-list + .notice{ margin-top: 16px; }

/* 邮箱域名列表 */
.plan-list li{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 0;
  border-bottom: 1px dashed var(--border-2);
}
.plan-list li:last-child{ border-bottom: 0; }
.plan-name{ font-size: 13.5px; font-weight: 600; }
.plan-meta{ font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* SSL 卡片 */
.ssl-grid{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ssl-grid .card{ margin-bottom: 0; }
.ssl-card{ border-top: 3px solid var(--green); }
.ssl-card.warn{ border-top-color: var(--amber); }
.ssl-card.danger{ border-top-color: var(--red); }
.ssl-head{
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; padding: 16px 18px 12px;
}
.ssl-domain{ font-size: 14px; font-weight: 700; margin-bottom: 6px; word-break: break-all; }
.ssl-badge{
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  white-space: nowrap;
}
.ssl-badge.free{ background: #E4F7EE; color: #14794A; }
.ssl-badge.paid{ background: var(--purple-soft); color: var(--purple); }
.ssl-badge.none{ background: #F0F1F3; color: var(--text-muted); }
.ssl-card .kv-list{ padding: 0 18px; }
.ssl-progress{ padding: 12px 18px 0; }
.ssl-progress span{ font-size: 12px; color: var(--text-muted); display: block; margin-top: 5px; }
.ssl-progress .warn{ color: var(--amber); font-weight: 600; }
.ssl-progress .danger{ color: var(--red); font-weight: 600; }
.ssl-actions{
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; margin-top: 12px;
  border-top: 1px solid var(--border-2); background: var(--surface-2);
}
.ssl-actions-txt{ font-size: 13px; color: var(--text-2); margin-right: auto; }

/* 账单：套餐卡 */
.plan-card{ padding: 24px; }
.plan-card-head{ display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.plan-tag{
  display: inline-block; font-size: 11px; font-weight: 700;
  color: var(--purple); background: var(--purple-soft);
  padding: 3px 9px; border-radius: 6px; margin-bottom: 8px;
}
.plan-title{ font-size: 20px; font-weight: 700; }
.plan-desc{ font-size: 13px; color: var(--text-muted); margin-top: 6px; max-width: 420px; line-height: 1.7; }
.plan-price{ text-align: right; }
.price-value{ font-size: 28px; font-weight: 800; color: var(--purple); letter-spacing: -.5px; }
.price-value em{ font-size: 14px; font-style: normal; color: var(--text-muted); font-weight: 600; }
.price-note{ font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.plan-meta-row{
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin: 22px 0;
  padding: 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border-2);
}
.plan-meta-label{ font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.plan-meta-value{ font-size: 13.5px; font-weight: 600; }
.plan-actions{ display: flex; gap: 10px; flex-wrap: wrap; }

/* 支付方式 */
.pay-list li{
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); margin-bottom: 10px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.pay-list li:hover{ border-color: #D5D8DC; }
.pay-list li.active{ border-color: var(--purple-border); background: var(--purple-soft); }
.pay-icon{
  width: 44px; height: 30px; flex: none; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
}
.pay-icon.visa{ background: #1A1F71; }
.pay-icon.alipay{ background: #1677FF; font-size: 11px; }
.pay-icon.paypal{ background: #003087; font-size: 9px; }
.pay-name{ font-size: 13.5px; font-weight: 600; }
.pay-meta{ font-size: 12px; color: var(--text-muted); }
.pay-list li .badge{ margin-left: auto; }

/* VPS 服务器卡 */
.server-card{ padding: 0; }
.server-head{
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px;
}
.server-icon{
  width: 48px; height: 48px; flex: none; border-radius: 12px;
  background: var(--purple-soft); color: var(--purple);
  display: flex; align-items: center; justify-content: center;
}
.server-info{ flex: 1; min-width: 240px; }
.server-title-row{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.server-name{ font-size: 17px; font-weight: 700; }
.server-meta{ font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.server-uptime{ text-align: right; }
.server-uptime-label{ font-size: 12px; color: var(--text-muted); }
.server-uptime-value{ font-size: 15px; font-weight: 700; margin-top: 2px; }

.net-stats{ display: flex; gap: 32px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-2); }
.net-stats p{ font-size: 12px; color: var(--text-muted); }
.net-stats strong{ display: block; font-size: 17px; margin: 2px 0; }
.net-stats span{ font-size: 12px; }

/* 标签页 */
.tabs{ display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: var(--radius-sm); }
.tab{
  padding: 6px 12px; border-radius: 6px; border: 0;
  background: none; font-size: 13px; color: var(--text-muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover{ color: var(--text); }
.tab.active{ background: #fff; color: var(--purple); font-weight: 600; box-shadow: var(--shadow-sm); }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1400px){
  .quick-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ssl-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1200px){
  .stat-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid-3, .stat-grid-4{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1{ grid-template-columns: minmax(0, 1fr); }
  .grid-sidebar{ grid-template-columns: minmax(0, 1fr); }
  .gauge-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px){
  .sidebar{
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open{ transform: translateX(0); }
  .sidebar-close{ display: block; }
  .sidebar-mask.show{ display: block; }
  .main{ margin-left: 0; }
  .topbar-menu{ display: inline-flex; }
  .content{ padding: 20px 16px 40px; }
  .topbar{ padding: 0 16px; gap: 12px; }
  .user-txt{ display: none; }
  .search-kbd{ display: none; }
}

@media (max-width: 768px){
  .stat-grid, .stat-grid-3, .stat-grid-4{ grid-template-columns: minmax(0, 1fr); }
  .quick-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ssl-grid{ grid-template-columns: minmax(0, 1fr); }
  .gauge-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .config-grid{ grid-template-columns: minmax(0, 1fr); }
  .plan-meta-row{ grid-template-columns: minmax(0, 1fr); }
  .chart-metrics{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats{ gap: 20px; flex-wrap: wrap; }
  .page-title{ font-size: 20px; }
  .search{ max-width: none; }
}
