/**
 * app.css — 全局公共样式
 * （主题变量在 theme-dark.css / theme-light.css 中定义）
 */

/* ══ 布局基础 ══ */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  width: 100%;
}

/* ══ 导航栏 ══ */
.site-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .88rem;
  transition: all .15s;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface2);
}

/* ══ 用户菜单 ══ */
.user-menu     { position: relative; }
.user-avatar-wrap {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 5px 8px;
  border-radius: var(--radius-xs);
  transition: background .15s;
}
.user-avatar-wrap:hover { background: var(--surface2); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
}
.user-avatar-placeholder {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700;
}
.user-name-text { font-size: .85rem; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-arrow { font-size: .7rem; color: var(--text-muted); }
.user-dropdown {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px;
  min-width: 160px; z-index: 200;
  box-shadow: var(--card-shadow);
}
.user-dropdown.open { display: block; }
.user-dropdown a {
  display: block; padding: 8px 12px; border-radius: var(--radius-xs);
  color: var(--text); text-decoration: none; font-size: .88rem;
  transition: background .15s;
}
.user-dropdown a:hover { background: var(--surface2); }
.user-dropdown hr {
  border: none; border-top: 1px solid var(--border); margin: 6px 0;
}

/* ══ Toast 消息 ══ */
.app-toast {
  position: fixed; top: 24px; left: 50%;
  transform: translateX(-50%) translateY(-12px);
  padding: 10px 22px; border-radius: 999px;
  font-size: .88rem; font-weight: 500;
  opacity: 0; transition: all .3s;
  z-index: 9999; pointer-events: none;
  white-space: nowrap;
}
.app-toast.success { background: var(--green); color: #fff; }
.app-toast.error   { background: var(--red);   color: #fff; }
.app-toast.info    { background: var(--accent); color: #fff; }

/* ══ 面包屑 ══ */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .82rem; color: var(--text-muted); margin-bottom: 20px;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--border); }

/* ══ 空态 ══ */
.empty-state {
  text-align: center; padding: 80px 24px;
  color: var(--text-muted);
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.empty-state p  { font-size: .88rem; line-height: 1.7; }

/* ══ 数据表格 ══ */
.data-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.data-table th, .data-table td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--surface2); font-weight: 600;
  color: var(--text-muted); font-size: .8rem; letter-spacing: .4px;
}
.data-table tr:hover td { background: var(--surface2); }
.data-table .actions { display: flex; gap: 6px; }

/* ══ 状态徽章 ══ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
}
.badge.green  { background: rgba(16,185,129,.15); color: var(--green); }
.badge.red    { background: rgba(239,68,68,.15);  color: var(--red);   }
.badge.yellow { background: rgba(245,158,11,.15); color: var(--yellow);}
.badge.blue   { background: rgba(99,102,241,.15); color: var(--accent);}

/* ══ 响应式 ══ */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .user-name-text { display: none; }
  .page-main { padding: 16px 16px 40px; }
}
