/* ─────────────────────────────────────────────────────────────
   马克系统 · 界面样式
   布局参考：爱学习 v3.8.1（Metronic：图标侧栏 + 顶部工具栏 + 卡片内容区）
   ───────────────────────────────────────────────────────────── */

:root {
  --app-primary: #2c9aff;
  --app-primary-dark: #006ae6;
  --app-primary-soft: #eaf3ff;
  --app-text: #071437;
  --app-text-sub: #5e6278;
  --app-muted: #99a1b7;
  --app-bg: #f5f8fa;
  --app-card: #ffffff;
  --app-border: #eef1f6;
  --app-radius: 10px;
  --app-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  --app-shadow-hover: 0 10px 30px rgba(15, 23, 42, 0.1);

  --el-color-primary: #2c9aff;
  --el-color-primary-light-3: #6bb6ff;
  --el-color-primary-light-5: #95c9ff;
  --el-color-primary-light-7: #bfdcff;
  --el-color-primary-light-8: #d4e7ff;
  --el-color-primary-light-9: #eaf3ff;
  --el-color-primary-dark-2: #2380d6;
  --el-border-radius-base: 8px;
  --el-border-radius-small: 6px;
  --el-font-size-base: 13px;
  --el-text-color-primary: #071437;
  --el-text-color-regular: #5e6278;
  --el-border-color: #eef1f6;
  --el-border-color-light: #f2f5f9;
  --el-fill-color-blank: #ffffff;
}

* { box-sizing: border-box; }

html, body, #app {
  height: 100%;
  margin: 0;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.layout { height: 100%; }

/* ── 图标侧栏（悬停展开） ─────────────────────────────────── */

.aside {
  width: 76px;
  background: var(--app-card);
  border-right: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  z-index: 20;
}

.aside:hover {
  width: 224px;
  box-shadow: 12px 0 32px rgba(15, 23, 42, 0.08);
}

.brand {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 21px;
  border-bottom: 1px solid var(--app-border);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--app-primary), #79bbff);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(44, 154, 255, 0.28);
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--app-text);
  opacity: 0;
  transition: opacity 0.15s ease 0.05s;
}

.aside:hover .brand-name { opacity: 1; }

.side-menu {
  border-right: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  background: transparent;
}

.side-menu .el-menu-item {
  height: 44px;
  line-height: 44px;
  margin: 2px 12px;
  border-radius: 9px;
  color: var(--app-text-sub);
  font-size: 14px;
  padding-left: 0 !important;
  padding-right: 0 !important;
  display: flex;
  align-items: center;
}

.side-menu .el-menu-item .el-icon {
  font-size: 18px;
  margin: 0 0 0 15px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.side-menu .menu-label {
  margin-left: 14px;
  opacity: 0;
  transition: opacity 0.15s ease 0.05s;
  white-space: nowrap;
}

.aside:hover .side-menu .menu-label { opacity: 1; }

.side-menu .el-menu-item:hover {
  background: #f4f8fd;
  color: var(--app-text);
}

.side-menu .el-menu-item.is-active {
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 600;
}

.side-foot {
  padding: 14px 0;
  border-top: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  white-space: nowrap;
}

.side-foot span { opacity: 0; transition: opacity 0.15s ease; }
.aside:hover .side-foot span { opacity: 1; }
.aside:hover .side-foot { padding: 14px 18px; align-items: flex-start; }

/* ── 顶栏 ───────────────────────────────────────────────── */

.header {
  height: 64px;
  background: var(--app-card);
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--app-muted);
}

.header-left .crumb-current {
  color: var(--app-text);
  font-weight: 600;
  font-size: 15px;
}

.collapse-btn {
  cursor: pointer;
  color: var(--app-muted);
  display: flex;
  align-items: center;
  font-size: 18px;
  margin-right: 4px;
}

.collapse-btn:hover { color: var(--app-primary); }

.header-user {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--app-text);
  font-size: 13px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 内容区 ─────────────────────────────────────────────── */

.main {
  padding: 24px 26px;
  overflow-y: auto;
  background: var(--app-bg);
}

.page-title {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--app-text);
  letter-spacing: -0.2px;
}

.page-desc {
  font-size: 13px;
  color: var(--app-muted);
  margin: 0 0 18px;
}

/* ── 统计卡 ─────────────────────────────────────────────── */

.stat-row { margin-bottom: 16px; }

.stat-card {
  background: var(--app-card);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  height: 100%;
  box-shadow: var(--app-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--app-shadow-hover);
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}

.stat-icon.blue { background: #eaf3ff; color: #2c9aff; }
.stat-icon.green { background: #e8fff3; color: #1bbf6b; }
.stat-icon.orange { background: #fff6e8; color: #f5a623; }
.stat-icon.purple { background: #f3ecff; color: #8e5cf7; }

.stat-body { min-width: 0; flex: 1; }

.stat-label {
  font-size: 13px;
  color: var(--app-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--app-text);
  font-variant-numeric: tabular-nums;
}

.stat-value .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--app-muted);
  margin-left: 4px;
}

.stat-hint {
  font-size: 12px;
  color: var(--app-muted);
  margin-top: 6px;
}

/* ── 面板 ───────────────────────────────────────────────── */

.el-card.panel,
.el-card.table-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.el-card.panel > .el-card__header,
.el-card.table-card > .el-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--app-border);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--app-text);
}

.panel-link {
  font-size: 13px;
  color: var(--app-primary);
  cursor: pointer;
}

.panel-link:hover { color: var(--app-primary-dark); }

.notice-body {
  white-space: pre-wrap;
  line-height: 1.85;
  color: var(--app-text-sub);
  font-size: 13.5px;
}

/* ── 快捷入口 ───────────────────────────────────────────── */

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  background: #fafcff;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  font: inherit;
  color: var(--app-text);
}

.quick-item:hover {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
}

.quick-item .el-icon {
  font-size: 18px;
  color: var(--app-primary);
}

.quick-item .q-label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

/* ── 表格页 ─────────────────────────────────────────────── */

.card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-toolbar .card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--app-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-toolbar .count {
  font-size: 12px;
  font-weight: 500;
  color: var(--app-primary);
  background: var(--app-primary-soft);
  border-radius: 999px;
  padding: 1px 8px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-card .el-table th.el-table__cell {
  background: #fafcff;
  color: var(--app-text-sub);
  font-weight: 600;
  font-size: 12.5px;
}

.table-card .el-table td.el-table__cell {
  padding: 10px 0;
}

.table-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--app-border);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
}

/* ── 弹窗 ───────────────────────────────────────────────── */

.el-dialog {
  border-radius: 12px;
}

.el-dialog__header {
  padding: 18px 22px 10px;
  margin-right: 0;
}

.el-dialog__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--app-text);
}

.el-dialog__body { padding: 10px 22px; }

.el-dialog__footer { padding: 12px 22px 18px; }

.key-text {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  word-break: break-all;
  background: #f7f9fc;
  border: 1px dashed #cdd6e3;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--app-text);
  letter-spacing: 0.3px;
}

/* ── 登录 / 注册 ────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 20% 0%, #e8f2ff 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 100%, #eafaf3 0%, transparent 55%),
    #f5f8fa;
  padding: 24px;
}

.login-card {
  width: 400px;
  max-width: 100%;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
  border: 1px solid var(--app-border);
}

.login-brand { text-align: center; margin-bottom: 22px; }

.login-brand .logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--app-primary), #79bbff);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(44, 154, 255, 0.35);
}

.login-brand h1 { font-size: 20px; margin: 0 0 6px; color: var(--app-text); }
.login-brand p { margin: 0; color: var(--app-muted); font-size: 13px; }

.login-tabs { display: flex; justify-content: center; margin-bottom: 18px; }

.login-foot {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.login-foot a { color: var(--app-primary); text-decoration: none; }

/* ── 响应式 ─────────────────────────────────────────────── */

@media (max-width: 992px) {
  .aside { width: 76px; }
  .aside:hover { width: 224px; }
  .main { padding: 16px; }
  .header { padding: 0 14px; }
  .quick-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .aside {
    position: fixed;
    z-index: 100;
    height: 100%;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
  }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .card-toolbar { align-items: flex-start; }
  .card-actions { width: 100%; }
}

/* 顶部通知铃铛 */
.header-right { display: flex; align-items: center; gap: 18px; }
.notif-bell { display: inline-flex; cursor: pointer; font-size: 19px; color: var(--app-text-sub); }
.notif-bell:hover { color: var(--app-primary); }
.notif-item { padding: 10px 0; border-bottom: 1px solid var(--app-border); }
.notif-item:last-child { border-bottom: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--app-text); }
.notif-time { font-size: 12px; color: var(--app-muted); }
.notif-msg { margin-top: 4px; font-size: 13px; color: var(--app-text-sub); line-height: 1.6; }

/* 数据趋势 */
.panel-sub { margin-left: 8px; font-size: 12px; color: var(--app-muted); font-weight: 400; }
.trend-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.trend-total { margin-left: auto; font-size: 13px; color: var(--app-muted); }
.trend-total b { color: var(--app-primary); font-size: 15px; }
.chart { min-height: 190px; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding: 16px 4px 0; overflow-x: auto; }
.bar-col { flex: 1 0 14px; height: 100%; display: flex; flex-direction: column; align-items: center; }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { position: relative; width: 70%; max-width: 26px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #6bbcff, #2c9aff); transition: height .25s ease; }
.bar.zero { background: #e9edf5; }
.bar-value { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--app-text-sub); }
.bar-label { margin-top: 6px; font-size: 11px; color: var(--app-muted); white-space: nowrap; }
.trend-meta { margin-top: 8px; font-size: 12px; color: var(--app-muted); }

/* 折线图 */
.line-chart-wrap { width: 100%; }
.line-chart { width: 100%; height: auto; display: block; }
.grid-line { stroke: #eef1f6; stroke-width: 1; }
.axis-label { fill: #8a94a6; font-size: 11px; }
.line-path { fill: none; stroke: #2c9aff; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-area { fill: rgba(44, 154, 255, 0.10); }
.line-dot { fill: #fff; stroke: #2c9aff; stroke-width: 2; }

/* 登录页按钮 */
.login-actions { display: flex; gap: 10px; margin-top: 12px; }


/* 表格操作按钮：等宽、描边突出 */
.el-table .cell > .el-dropdown { width: calc(50% - 4px); }
.el-table .cell > .el-dropdown .el-button {
  width: 100%;
  justify-content: center;
  border: 1px solid var(--app-primary);
  color: var(--app-primary);
  background: #fff;
  font-weight: 500;
}
.el-table .cell > .el-dropdown .el-button:hover {
  background: var(--app-primary);
  border-color: var(--app-primary);
  color: #fff;
}

/* 下拉操作菜单：等距 + 圆角 */
.action-menu .el-dropdown-menu { padding: 6px; min-width: 132px; }
.action-menu .el-dropdown-menu__item { padding: 9px 14px; margin: 2px 0; border-radius: 6px; font-size: 13px; line-height: 1.4; }
.action-menu .el-dropdown-menu__item:not(.is-disabled):hover { background: #eef6ff; color: var(--app-primary); }
