/* ============================================================
   迅速云虚拟主机仪表盘 - iOS 风格全局样式
   设计语言：SF Pro 字体栈 / 毛玻璃 / 圆角卡片 / iOS 系统色
   ============================================================ */

:root {
  --ios-blue:   #007AFF;
  --ios-bg:     #F2F2F7;
  --ios-card:   #FFFFFF;
  --ios-red:    #FF3B30;
  --ios-orange: #FF9500;
  --ios-green:  #34C759;
  --ios-gray:   #8E8E93;
  --ios-gray2:  #C7C7CC;
  --ios-gray3:  #E5E5EA;
  --ios-label:  #1C1C1E;
  --ios-text:   #3A3A3C;
  --radius:     16px;
  --sidebar-w:  240px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  background: var(--ios-bg);
  color: var(--ios-label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

/* ---------------- 应用骨架：侧边栏 + 主区 ---------------- */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---------------- 侧边栏（iOS 毛玻璃） ---------------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-right: 1px solid rgba(0,0,0,.06);
  padding: 22px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(10,132,255,.35);
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
}

.brand-sub {
  font-size: 11px;
  color: var(--ios-gray);
  margin-top: 2px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ios-gray);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 18px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--ios-label);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background .18s, color .18s;
}

.nav-item:hover {
  background: rgba(0,0,0,.05);
}

.nav-item.active {
  background: var(--ios-blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,122,255,.35);
}

.nav-icon {
  width: 24px;
  text-align: center;
  font-size: 17px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 12px 4px;
  border-top: 1px solid rgba(0,0,0,.06);
  font-size: 13px;
  color: var(--ios-gray);
}

.sidebar-footer .user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--ios-label);
}

/* ---------------- 主区 ---------------- */
.main {
  flex: 1;
  padding: 28px 34px 48px;
  max-width: 1500px;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.3px;
  line-height: 1.15;
}

.page-desc {
  font-size: 14px;
  color: var(--ios-gray);
  margin-top: 6px;
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--ios-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
}

.card-sub {
  font-size: 13px;
  color: var(--ios-gray);
  font-weight: 400;
}

/* ---------------- 按钮（iOS 风格胶囊） ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .18s, transform .12s, background .18s;
  white-space: nowrap;
}

.btn:active { transform: scale(.97); }
.btn:hover { opacity: .88; }

.btn-primary { background: var(--ios-blue); color: #fff; box-shadow: 0 4px 14px rgba(0,122,255,.35); }
.btn-danger  { background: var(--ios-red);  color: #fff; }
.btn-green   { background: var(--ios-green); color: #fff; }
.btn-gray    { background: #E9E9EB; color: var(--ios-label); }
.btn-small   { padding: 7px 15px; font-size: 13px; }
.btn-block   { width: 100%; }

/* ---------------- 表单（iOS 输入框） ---------------- */
.form-row {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ios-gray);
  margin-bottom: 7px;
}

.input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--ios-bg);
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ios-label);
  outline: none;
  transition: border .18s, background .18s, box-shadow .18s;
}

.input:focus {
  background: #fff;
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,.15);
}

textarea.input { resize: vertical; min-height: 80px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }

table.ios-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ios-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ios-gray);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ios-gray3);
  white-space: nowrap;
}

.ios-table td {
  padding: 15px 14px;
  border-bottom: 1px solid rgba(0,0,0,.05);
  font-size: 14px;
  vertical-align: middle;
  word-break: break-all;
}

.ios-table tbody tr { transition: background .15s; }
.ios-table tbody tr:hover { background: rgba(0,122,255,.04); }
.ios-table tbody tr:last-child td { border-bottom: none; }

/* 仪表盘节点表格列宽 */
.dash-table th:nth-child(1), .dash-table td:nth-child(1) { width: 13%; }
.dash-table th:nth-child(2), .dash-table td:nth-child(2) { width: 12%; }
.dash-table th:nth-child(3), .dash-table td:nth-child(3) { width: 8%; }
.dash-table th:nth-child(4), .dash-table td:nth-child(4) { width: 10%; }
.dash-table th:nth-child(5), .dash-table td:nth-child(5) { width: 10%; }
.dash-table th:nth-child(6), .dash-table td:nth-child(6) { width: 19%; }
.dash-table th:nth-child(7), .dash-table td:nth-child(7) { width: 12%; }
.dash-table th:nth-child(8), .dash-table td:nth-child(8) { width: 8%; }
.dash-table th:nth-child(9), .dash-table td:nth-child(9) { width: 8%; }

/* ---------------- 徽章 / 标签 ---------------- */
.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.expire-normal { background: rgba(52,199,89,.15);  color: #248A3D; }
.expire-warning{ background: rgba(255,149,0,.15);  color: #C93400; }
.expire-danger { background: rgba(255,59,48,.12);  color: var(--ios-red); }
.expire-none   { background: var(--ios-gray3);    color: var(--ios-gray); }

.price-tag {
  font-weight: 700;
  color: var(--ios-blue);
}

.node-name {
  font-weight: 700;
  font-size: 15px;
}

.node-sub {
  font-size: 11px;
  color: var(--ios-gray);
  margin-top: 3px;
}

.version-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--ios-gray);
  background: var(--ios-bg);
  padding: 5px 12px;
  border-radius: 100px;
  font-weight: 600;
}

/* ---------------- 进度条 ---------------- */
.progress {
  width: 100%;
  max-width: 130px;
  height: 8px;
  background: var(--ios-gray3);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 6px;
}

.bar {
  height: 100%;
  border-radius: 100px;
  transition: width .5s ease;
}

.value-display {
  font-size: 15px;
  font-weight: 700;
}

/* ---------------- 磁盘分区 ---------------- */
.disk-grid { display: flex; flex-direction: column; gap: 8px; }

.disk-part {
  text-align: left;
  padding: 8px 12px;
  background: var(--ios-bg);
  border-radius: 12px;
  transition: transform .15s;
}

.disk-part:hover { transform: translateX(3px); }

.disk-label { font-weight: 600; font-size: 12px; margin-bottom: 2px; }
.disk-info  { font-size: 11px; color: var(--ios-gray); margin-bottom: 5px; }
.disk-part .progress { max-width: 100%; height: 6px; margin-top: 2px; }

/* ---------------- 网络流量 ---------------- */
.net-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.net-row { display: flex; align-items: center; gap: 8px; }

.net-icon { width: 18px; font-size: 13px; }

.net-value {
  font-family: "SF Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
  font-weight: 700;
  font-size: 13px;
}

.net-up   { color: var(--ios-red); }
.net-down { color: var(--ios-green); }

/* ---------------- 主控多选 ---------------- */
.check-group { display: flex; flex-wrap: wrap; gap: 10px; }

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ios-bg);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border .15s;
}

.check-item:hover { background: var(--ios-gray3); }
.check-item:has(input:checked) { background: rgba(0,122,255,.12); border-color: var(--ios-blue); }
.check-item input { accent-color: var(--ios-blue); width: 16px; height: 16px; margin: 0; }

/* 操作列按钮组 */
.ops { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ops .btn { width: 100%; }

/* ---------------- 状态文本 ---------------- */
.loading { color: var(--ios-gray); font-style: italic; }
.error   { color: var(--ios-red); font-weight: 600; }

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ios-gray);
}

.empty .empty-icon { font-size: 44px; display: block; margin-bottom: 12px; }

/* ---------------- 提示条 ---------------- */
.alert {
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 18px;
}

.alert-success { background: rgba(52,199,89,.14);  color: #1E7D34; }
.alert-danger  { background: rgba(255,59,48,.12); color: var(--ios-red); }

/* ---------------- 登录页 ---------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(10,132,255,.22), transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(94,92,230,.20), transparent 55%),
    var(--ios-bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,.8);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
  padding: 38px 34px;
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  box-shadow: 0 10px 26px rgba(10,132,255,.4);
}

.login-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.login-sub   { font-size: 13px; color: var(--ios-gray); margin: 0 0 26px; }

.login-card .form-row { text-align: left; }

/* ---------------- 统计卡片 ---------------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--ios-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--ios-gray); margin-top: 2px; }

.stat-blue  { background: rgba(0,122,255,.12); }
.stat-green { background: rgba(52,199,89,.12); }
.stat-orange{ background: rgba(255,149,0,.14); }
.stat-red   { background: rgba(255,59,48,.12); }

/* ---------------- 工具栏：分段筛选 + 搜索 ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.seg {
  display: inline-flex;
  background: var(--ios-gray3);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.seg button {
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ios-label);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, box-shadow .15s;
}

.seg button.active {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.14);
}

.toolbar .input { max-width: 260px; }

/* ---------------- 节点状态点 ---------------- */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ios-gray2);
  margin-right: 6px;
  vertical-align: middle;
}

.status-dot.online {
  background: var(--ios-green);
  box-shadow: 0 0 0 3px rgba(52,199,89,.18);
}

.status-dot.offline {
  background: var(--ios-red);
  box-shadow: 0 0 0 3px rgba(255,59,48,.15);
}

/* ---------------- 密码框切换 ---------------- */
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 48px; }

.pass-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--ios-gray);
  padding: 0;
}

/* 操作列表单按钮全宽 */
.ops form { width: 100%; margin: 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    gap: 6px;
    padding: 12px;
  }
  .brand { padding: 0 8px 0 0; }
  .brand-sub, .nav-label, .sidebar-footer .user { display: none; }
  .sidebar-footer { margin-top: 0; border-top: none; padding: 0; }
  .nav-item { padding: 9px 13px; white-space: nowrap; }
  .main { padding: 18px 16px 40px; }
  .page-title { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .table-wrap { overflow-x: auto; }
  .ios-table { min-width: 760px; }
}
