/* 系统示例 · 企业级 IDC 控制台设计系统
 * 参考：xiaoheiFS 用户端 / likeadmin·OpsHub 管理端
 * 主色：#1677ff  天翼 accent：#e60012  管理侧栏：浅色 #fff
 */
:root {
  --brand-primary: #1677ff;
  --brand-primary-hover: #4096ff;
  --brand-primary-bg: #e6f4ff;
  --brand-accent: #e60012;
  --brand-accent-soft: #fff1f0;
  --text-primary: #1d2129;
  --text-secondary: #4e5969;
  --text-muted: #86909c;
  --border: #e5e6eb;
  --bg-page: #f5f6f8;
  --bg-card: #ffffff;
  --sidebar-bg: #ffffff;
  --sidebar-active: #1677ff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --radius: 8px;
  --radius-lg: 12px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
  /* 页面边距：对齐天翼云控制台 ~16px，不做窄容器居中 */
  --page-gutter: 16px;
  --page-gutter-lg: 16px;
  --el-color-primary: #1677ff;
  --el-color-primary-light-3: #69b1ff;
  --el-color-primary-light-5: #91caff;
  --el-color-primary-light-7: #bae0ff;
  --el-color-primary-light-9: #e6f4ff;
  --el-color-primary-dark-2: #0958d9;
  --el-border-radius-base: 6px;
}

* { box-sizing: border-box; }
html { width: 100%; }
body { margin: 0; width: 100%; min-height: 100vh; font-family: var(--font); color: var(--text-primary); background: var(--bg-page); -webkit-font-smoothing: antialiased; }
#app { width: 100%; min-height: 100vh; }

/* ========== 登录页 ========== */
.auth-page { min-height: 100vh; display: flex; }
.auth-brand {
  flex: 1; min-width: 420px; background: linear-gradient(145deg, #001529 0%, #002140 40%, #003a70 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(22,119,255,.25) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(230,0,18,.12) 0%, transparent 45%);
  pointer-events: none;
}
.auth-brand-inner { position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.auth-logo-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #1677ff, #0958d9);
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
}
.auth-logo-text { font-size: 22px; font-weight: 600; letter-spacing: .5px; }
.auth-logo-sub { font-size: 12px; opacity: .65; margin-top: 2px; }
.auth-headline { font-size: 32px; font-weight: 600; line-height: 1.35; margin: 0 0 16px; max-width: 400px; }
.auth-desc { font-size: 15px; line-height: 1.7; opacity: .75; max-width: 380px; margin: 0; }
.auth-features { list-style: none; padding: 0; margin: 32px 0 0; }
.auth-features li { padding: 10px 0; font-size: 14px; opacity: .85; display: flex; align-items: center; gap: 10px; }
.auth-features li::before { content: "✓"; width: 20px; height: 20px; background: rgba(22,119,255,.35); border-radius: 50%; display: grid; place-items: center; font-size: 11px; }
.auth-copy { position: relative; z-index: 1; font-size: 12px; opacity: .45; }
.auth-form-panel {
  width: 480px; max-width: 100%; background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px;
}
.auth-form-box { width: 100%; max-width: 360px; }
.auth-form-title { font-size: 24px; font-weight: 600; margin: 0 0 8px; }
.auth-form-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 32px; }
.auth-form-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-muted); }
.auth-form-footer a { color: var(--brand-primary); cursor: pointer; text-decoration: none; }

/* ========== 用户控制台顶栏 ========== */
.user-shell { min-height: 100vh; width: 100%; display: flex; flex-direction: column; }
.user-topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 var(--page-gutter-lg); position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.user-topbar-logo { display: flex; align-items: center; gap: 10px; margin-right: 40px; cursor: pointer; }
.user-topbar-logo .icon { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg,#1677ff,#0958d9); color:#fff; display:grid; place-items:center; font-weight:700; font-size:14px; }
.user-topbar-logo .name { font-size: 16px; font-weight: 600; }
.user-nav { display: flex; gap: 4px; flex: 1; }
.user-nav-item {
  padding: 8px 16px; border-radius: 6px; font-size: 14px; color: var(--text-secondary);
  cursor: pointer; transition: .15s; border: none; background: none;
}
.user-nav-item:hover { color: var(--brand-primary); background: var(--brand-primary-bg); }
.user-nav-item.active { color: var(--brand-primary); background: var(--brand-primary-bg); font-weight: 500; }
.user-topbar-right { display: flex; align-items: center; gap: 16px; }
.balance-pill {
  background: linear-gradient(135deg, #fff7e6, #fff1f0); border: 1px solid #ffd591;
  padding: 6px 14px; border-radius: 20px; font-size: 13px; color: #d48806; font-weight: 500;
}
.user-avatar-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text-secondary); }
/* 内容区铺满，边距 16px（天翼云控制台风格） */
.user-main { flex: 1; width: 100%; max-width: none; min-width: 0; padding: 16px; box-sizing: border-box; }

/* ========== 页面标题区 ========== */
.page-header { margin-bottom: 16px; }
.page-header h1 { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.page-header p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ========== 统计卡片 ========== */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); display: flex; align-items: flex-start; gap: 16px;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-icon {
  width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
}
.stat-card-icon.blue { background: #e6f4ff; color: #1677ff; }
.stat-card-icon.green { background: #f6ffed; color: #52c41a; }
.stat-card-icon.orange { background: #fff7e6; color: #fa8c16; }
.stat-card-icon.red { background: #fff1f0; color: #e60012; }
.stat-card-body .label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card-body .value { font-size: 26px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.stat-card-body .extra { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ========== 云电脑卡片 ========== */
.desktop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.desktop-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  overflow: hidden; transition: .2s; box-shadow: var(--shadow-sm);
}
.desktop-card:hover { border-color: #91caff; box-shadow: var(--shadow-md); }
.desktop-card-head {
  padding: 16px 20px; border-bottom: 1px solid #f2f3f5;
  display: flex; justify-content: space-between; align-items: center;
}
.desktop-card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.desktop-card-body { padding: 16px 20px; }
.desktop-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13px; }
.desktop-meta dt { color: var(--text-muted); margin: 0; }
.desktop-meta dd { margin: 4px 0 0; font-weight: 500; color: var(--text-primary); }
.desktop-card-foot { padding: 12px 20px; background: #fafafa; display: flex; gap: 8px; flex-wrap: wrap; }

/* ========== 商品卡片 ========== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.product-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 24px; position: relative; transition: .2s;
}
.product-card.featured { border-color: #1677ff; box-shadow: 0 0 0 1px #1677ff inset; }
.product-card.featured::before {
  content: "推荐"; position: absolute; top: 12px; right: 12px;
  background: var(--brand-accent); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 4px;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.product-card h3 { margin: 0 0 8px; font-size: 17px; }
.product-card .desc { color: var(--text-muted); font-size: 13px; line-height: 1.6; min-height: 40px; margin-bottom: 16px; }
.product-specs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.product-spec-tag { background: #f2f3f5; padding: 4px 10px; border-radius: 4px; font-size: 12px; color: var(--text-secondary); }
.product-price { margin-bottom: 16px; }
.product-price .amount { font-size: 28px; font-weight: 700; color: var(--brand-accent); }
.product-price .unit { font-size: 14px; color: var(--text-muted); }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 60px 20px; background: #fff; border-radius: var(--radius-lg); border: 1px dashed var(--border); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: .35; }
.empty-state h3 { margin: 0 0 8px; font-size: 16px; }
.empty-state p { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; }

/* ========== 管理后台 ========== */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: var(--sidebar-bg); color: var(--text-primary);
  flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
}
.admin-sidebar-logo {
  height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.admin-sidebar-logo .icon { width: 36px; height: 36px; border-radius: 8px; background: #1677ff; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.admin-sidebar-logo .text { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.admin-sidebar-logo .sub { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }
.admin-menu { flex: 1; padding: 12px 0; overflow-y: auto; }
.admin-menu-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; margin: 2px 8px;
  border-radius: 6px; cursor: pointer; font-size: 14px; color: rgba(255,255,255,.65);
  transition: .15s; border: none; background: none; width: calc(100% - 16px); text-align: left;
}
.admin-menu-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.admin-menu-item.active { color: #fff; background: var(--sidebar-active); }
.admin-menu-item .mi { width: 18px; text-align: center; opacity: .9; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-page); }
.admin-topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--page-gutter-lg);
}
.admin-breadcrumb { font-size: 14px; color: var(--text-muted); }
.admin-breadcrumb strong { color: var(--text-primary); font-weight: 500; }
.admin-body { padding: 16px; flex: 1; min-width: 0; width: 100%; max-width: none; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1100px) { .admin-stat-grid { grid-template-columns: repeat(2, 1fr); } }
.admin-stat-card {
  background: #fff; border-radius: var(--radius-lg); padding: 20px 24px;
  box-shadow: var(--shadow-sm); border-left: 4px solid var(--brand-primary);
}
.admin-stat-card:nth-child(2) { border-left-color: #52c41a; }
.admin-stat-card:nth-child(3) { border-left-color: #fa8c16; }
.admin-stat-card:nth-child(4) { border-left-color: #e60012; }
.admin-stat-card .label { font-size: 13px; color: var(--text-muted); }
.admin-stat-card .num { font-size: 30px; font-weight: 600; margin-top: 8px; }
.admin-panel { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.admin-panel-head { padding: 16px 24px; border-bottom: 1px solid #f2f3f5; font-weight: 600; font-size: 15px; }
.admin-panel-body { padding: 24px; }

/* Element 覆盖 */
.el-button--primary { --el-button-bg-color: #1677ff; --el-button-border-color: #1677ff; }
.el-table { --el-table-header-bg-color: #fafafa; }
.el-card { border-radius: var(--radius-lg) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow-sm) !important; }

@media (max-width: 768px) {
  .user-main, .admin-body { padding: 12px; }
  .auth-brand { display: none; }
  .auth-form-panel { width: 100%; }
  .user-nav { display: none; }
  .stat-row { grid-template-columns: 1fr; }
}
