:root {
  --gold: #C9A55F;
  --gold-hi: #EBD9AE;
  --gold-dim: #8A7346;
  --ink: #17171F;
  --panel: #1F1F2A;
  --card: #232330;
  --line: rgba(255, 255, 255, .09);
  --txt: #F8F5EE;
  --mut: #C4C1CD;
  --mut2: #96939F;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: #f0f2f5;
  color: #303133;
}

/* ===== 登录页 ===== */
.login-wrap {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 80% at 20% 0%, rgba(201,165,95,.22), transparent 55%),
              radial-gradient(100% 70% at 100% 100%, rgba(150,160,195,.18), transparent 60%),
              linear-gradient(135deg, #2B2B37 0%, #24242F 40%, #181820 100%);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(235,217,174,.6), transparent),
    radial-gradient(2px 2px at 70% 60%, rgba(201,165,95,.5), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.4), transparent),
    radial-gradient(2px 2px at 85% 20%, rgba(235,217,174,.5), transparent);
  background-size: 100% 100%;
  opacity: .5;
}
.login-card {
  width: 400px;
  padding: 40px 36px;
  background: rgba(35, 35, 48, .72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(201, 165, 95, .35);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  position: relative;
  z-index: 2;
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .brand {
  font-family: "Songti SC", "SimSun", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--gold-hi);
  text-indent: 8px;
}
.login-logo .sub { font-size: 13px; color: var(--mut); letter-spacing: 3px; margin-top: 8px; }
.login-card .el-input__inner {
  background: rgba(255, 255, 255, .05) !important;
  border: 1px solid var(--line) !important;
  color: var(--txt) !important;
  height: 44px;
  border-radius: 10px;
}
.login-card .el-form-item__label { color: var(--mut); }
.login-btn {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold)) !important;
  border: none !important;
  color: #17171F !important;
  font-weight: 600;
  letter-spacing: 2px;
  border-radius: 10px;
}
.login-btn:hover { opacity: .92; }
.login-tip { text-align: center; font-size: 12px; color: var(--mut2); margin-top: 16px; line-height: 1.8; }
.login-tip b { color: var(--gold); }

/* ===== 主布局 ===== */
.layout { display: flex; height: 100vh; }
.aside {
  width: 220px;
  background: linear-gradient(180deg, #1F1F2A, #17171F);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.aside .logo {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--gold-hi);
  font-family: "Songti SC", serif;
  font-size: 19px;
  letter-spacing: 4px;
  font-weight: 700;
}
.aside .logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.aside .el-menu { border-right: none !important; background: transparent !important; flex: 1; overflow-y: auto; }
.aside .el-menu-item, .aside .el-submenu__title {
  color: var(--mut) !important;
  height: 46px;
  line-height: 46px;
}
.aside .el-menu-item:hover, .aside .el-submenu__title:hover {
  background: rgba(201, 165, 95, .1) !important;
  color: var(--gold-hi) !important;
}
.aside .el-menu-item.is-active {
  background: linear-gradient(90deg, rgba(201,165,95,.25), transparent) !important;
  color: var(--gold-hi) !important;
  border-right: 3px solid var(--gold);
}
.aside .el-submenu .el-menu-item { background: rgba(0,0,0,.2) !important; padding-left: 50px !important; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f0f2f5; }
.header {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #ebeef5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .04);
}
.header .crumb { font-size: 15px; color: #606266; }
.header .crumb b { color: #303133; }
.header .user { display: flex; align-items: center; gap: 12px; }
.header .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  color: #17171F; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
}
.body { flex: 1; padding: 18px; overflow-y: auto; }

/* ===== 卡片 / 表格 ===== */
.page-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .05);
  margin-bottom: 16px;
}
.page-title { font-size: 16px; font-weight: 600; color: #303133; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.page-title::before { content: ""; display: inline-block; width: 3px; height: 15px; background: var(--gold); border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.filter-bar { margin-bottom: 14px; }
.filter-bar .el-form-item { margin-bottom: 10px; margin-right: 10px; }
.el-table--mini th { background: #fafafa !important; color: #606266; font-weight: 600; }
.el-table .op-col { background: #fafafa; }
.tag-gold { background: rgba(201,165,95,.12); color: #a8842f; border: 1px solid rgba(201,165,95,.4); }

/* 看板统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 18px; position: relative; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,21,41,.05);
}
.stat-card .label { font-size: 13px; color: #909399; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #303133; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-card .icon { position: absolute; right: 14px; top: 14px; font-size: 34px; opacity: .12; }
.stat-card.gold .value { color: var(--gold); }
.chart-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.chart-box { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 4px rgba(0,21,41,.05); }
.chart-box .title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: #303133; }
.chart { height: 300px; }
@media (max-width: 1100px) { .chart-row { grid-template-columns: 1fr; } }

/* ===== 全局按钮文字居中（覆盖 Element UI 默认行内排布） ===== */
.el-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}
.el-button .el-icon,
.el-button [class^="el-icon-"],
.el-button [class*=" el-icon-"] {
  vertical-align: middle;
  line-height: 1;
}
.el-button > span { line-height: 1; }

/* ===== 全屏图片预览 ===== */
.img-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.img-viewer img {
  max-width: 90vw;
  max-height: 82vh;
  transition: transform .15s ease;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.img-viewer-bar {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, .15);
}
.img-viewer-bar i {
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background .2s, color .2s;
}
.img-viewer-bar i:hover { background: rgba(255, 255, 255, .2); color: var(--gold-hi); }
.img-viewer-count {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  background: rgba(255, 255, 255, .12);
  padding: 5px 14px;
  border-radius: 12px;
}
.img-viewer-tip {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .45);
  font-size: 11px;
}
.iv-count {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  background: rgba(255, 255, 255, .12);
  padding: 5px 14px;
  border-radius: 12px;
}

/* 行预览字段网格 */
.view-desc {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid #EBEEF5;
  border-radius: 6px;
  overflow: hidden;
}
.view-desc .vd-item {
  display: flex;
  border-bottom: 1px solid #EBEEF5;
  border-right: 1px solid #EBEEF5;
  min-height: 40px;
}
.view-desc .vd-item:nth-child(2n) { border-right: none; }
.view-desc .vd-item.span2 { grid-column: 1 / -1; border-right: none; }
.view-desc .vd-label {
  width: 120px;
  flex-shrink: 0;
  padding: 10px 12px;
  background: #fafafa;
  color: #606266;
  font-size: 13px;
  line-height: 20px;
}
.view-desc .vd-value {
  flex: 1;
  padding: 10px 12px;
  color: #303133;
  font-size: 13px;
  line-height: 20px;
  word-break: break-all;
}
.view-desc .vd-empty { color: #c0c4cc; }
.view-desc .vd-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.view-desc .vd-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #EBEEF5;
  cursor: pointer;
}
