/* Tea AI Admin — EleAdmin / Element Plus 风格 */
:root {
  --ea-primary: #2f54eb;
  --ea-primary-hover: #1d39c4;
  --ea-sidebar-bg: #001529;
  --ea-sidebar-dark: #000c17;
  --ea-sidebar-width: 220px;
  --ea-sidebar-collapsed: 64px;
  --ea-header-height: 56px;
  --ea-tags-height: 40px;
  --ea-bg: #f0f2f5;
  --ea-card: #ffffff;
  --ea-text: #303133;
  --ea-text-secondary: #909399;
  --ea-border: #e8e8e8;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--ea-bg);
  color: var(--ea-text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ea-primary); text-decoration: none; }

/* ===== 布局 ===== */
.ea-layout {
  display: flex;
  min-height: 100vh;
  background: var(--ea-bg);
}
.ea-sidebar {
  width: var(--ea-sidebar-width);
  background: var(--ea-sidebar-bg);
  color: rgba(255,255,255,.75);
  flex-shrink: 0;
  transition: width .2s;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.ea-layout.is-collapse .ea-sidebar { width: var(--ea-sidebar-collapsed); }
.ea-logo {
  height: var(--ea-header-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--ea-sidebar-dark);
  overflow: hidden;
  white-space: nowrap;
}
.ea-logo img { width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0; }
.ea-logo span {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .5px;
}
.ea-layout.is-collapse .ea-logo span { display: none; }

.ea-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 16px;
}
.ea-menu::-webkit-scrollbar { width: 0; }
.ea-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  cursor: pointer;
  color: rgba(255,255,255,.7);
  transition: all .2s;
  border-right: 3px solid transparent;
  white-space: nowrap;
  font-size: 14px;
}
.ea-menu-item:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}
.ea-menu-item.active {
  color: #fff;
  background: var(--ea-primary);
  border-right-color: transparent;
}
.ea-menu-item .el-icon { font-size: 18px; }
.ea-menu-group {
  padding: 16px 20px 6px;
  font-size: 12px;
  color: rgba(255,255,255,.35);
  letter-spacing: 1px;
  white-space: nowrap;
}
.ea-layout.is-collapse .ea-menu-group { display: none; }
.ea-layout.is-collapse .ea-menu-item {
  justify-content: center;
  padding: 0;
}
.ea-layout.is-collapse .ea-menu-item span { display: none; }

.ea-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.ea-header {
  height: var(--ea-header-height);
  background: #fff;
  border-bottom: 1px solid var(--ea-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}
.ea-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ea-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ea-fold-btn {
  font-size: 20px;
  cursor: pointer;
  color: #606266;
  display: flex;
  align-items: center;
}
.ea-fold-btn:hover { color: var(--ea-primary); }
.ea-breadcrumb { font-size: 14px; }

.ea-tags {
  height: var(--ea-tags-height);
  background: #fff;
  border-bottom: 1px solid var(--ea-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
}
.ea-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  background: #fff;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.ea-tag:hover { color: var(--ea-primary); border-color: var(--ea-primary); }
.ea-tag.active {
  color: var(--ea-primary);
  border-color: var(--ea-primary);
  background: rgba(47,84,235,.06);
}
.ea-tag .close {
  font-size: 12px;
  margin-left: 2px;
  border-radius: 50%;
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ea-tag .close:hover { background: var(--ea-primary); color: #fff; }

.ea-content {
  flex: 1;
  overflow: auto;
  padding: 16px;
}
.ea-footer {
  text-align: center;
  padding: 12px;
  color: var(--ea-text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

/* ===== 卡片 / 页面 ===== */
.ea-page-card {
  background: var(--ea-card);
  border-radius: 4px;
  padding: 16px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  margin-bottom: 16px;
}
.ea-page-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ea-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.ea-toolbar .spacer { flex: 1; }

/* 统计卡片 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.stat-icon {
  width: 56px; height: 56px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
}
.stat-icon.blue { background: linear-gradient(135deg, #2f54eb, #597ef7); }
.stat-icon.green { background: linear-gradient(135deg, #52c41a, #95de64); }
.stat-icon.orange { background: linear-gradient(135deg, #fa8c16, #ffc069); }
.stat-icon.cyan { background: linear-gradient(135deg, #13c2c2, #5cdbd3); }
.stat-icon.purple { background: linear-gradient(135deg, #722ed1, #b37feb); }
.stat-icon.red { background: linear-gradient(135deg, #f5222d, #ff7875); }
.stat-meta .label { color: var(--ea-text-secondary); font-size: 13px; }
.stat-meta .value { font-size: 26px; font-weight: 600; margin-top: 4px; line-height: 1.2; }

.chart-box {
  background: #fff;
  border-radius: 4px;
  padding: 16px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  margin-bottom: 16px;
}
.chart-box h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding-top: 10px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar-col .bar {
  width: 70%;
  max-width: 36px;
  background: linear-gradient(180deg, #597ef7, #2f54eb);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height .3s;
}
.bar-col .lbl {
  font-size: 11px;
  color: #909399;
  margin-top: 6px;
}
.bar-col .num {
  font-size: 11px;
  color: #606266;
  margin-bottom: 4px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.thumb-sm {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: #f5f5f5;
}
.thumb-md {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 4px;
  background: #f5f5f5;
}

/* 登录页 EleAdmin 风格 */
.admin-login {
  min-height: 100vh;
  display: flex;
  background: #f0f2f5 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect fill="%23f0f2f5" width="100" height="100"/><path d="M0 50h100M50 0v100" stroke="%23e6e6e6" stroke-width=".5"/></svg>');
  align-items: stretch;
}
.admin-login-left {
  flex: 1.2;
  background: linear-gradient(135deg, #1d39c4 0%, #2f54eb 45%, #597ef7 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.admin-login-left::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  right: -100px; bottom: -100px;
}
.admin-login-left h1 {
  font-size: 36px;
  margin: 0 0 12px;
  position: relative;
  z-index: 1;
}
.admin-login-left p {
  opacity: .85;
  font-size: 15px;
  max-width: 420px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}
.admin-login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #fff;
}
.admin-login-card {
  width: 100%;
  max-width: 380px;
}
.admin-login-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}
.admin-login-card .sub {
  color: #909399;
  margin-bottom: 28px;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .ea-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(0); }
  .ea-layout.is-collapse .ea-sidebar { transform: translateX(-100%); width: var(--ea-sidebar-width); }
  .admin-login-left { display: none; }
  .stat-row { grid-template-columns: 1fr; }
}
