/* ============================================================
   国际贸易实训平台 — 统一设计系统 (Unified Training Design System)
   版本: 1.0.0
   解决: 样式不统一、导航膨胀、交互单调、页面无框架感
   ============================================================ */

/* ===== 设计变量 ===== */
:root {
  --primary: #1B3A5C;
  --primary-light: #2a5078;
  --primary-dark: #112840;
  --accent: #2F88FF;
  --accent-hover: #1a6fe6;
  --accent-light: #eff6ff;
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --bg-sidebar: #1B3A5C;
  --bg-sidebar-hover: rgba(255,255,255,0.08);
  --bg-sidebar-active: rgba(47,136,255,0.15);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-sidebar: rgba(255,255,255,0.9);
  --text-sidebar-muted: rgba(255,255,255,0.5);
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 0px;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ===== Reset & Base ===== */
.ut-layout {
  display: flex;
  min-height: 100vh;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== 统一侧边栏 ===== */
.ut-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: left var(--transition-slow);
}

.ut-sidebar::-webkit-scrollbar {
  width: 4px;
}
.ut-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.ut-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

/* ===== 侧边栏头部 ===== */
.ut-sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.ut-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.ut-sidebar-brand-icon {
  width: 32px;
  height: 32px;
  background: rgba(47,136,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ut-sidebar-brand-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--accent);
}

.ut-sidebar-brand-text {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

.ut-sidebar-brand-sub {
  font-size: 10px;
  color: var(--text-sidebar-muted);
  display: block;
  margin-top: 1px;
}

/* ===== 侧边栏搜索框 ===== */
.ut-nav-search {
  padding: 12px 16px;
  flex-shrink: 0;
}

.ut-nav-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  font-size: 12px;
  outline: none;
  transition: all var(--transition);
  box-sizing: border-box;
}

.ut-nav-search input::placeholder {
  color: rgba(255,255,255,0.35);
}

.ut-nav-search input:focus {
  border-color: rgba(47,136,255,0.5);
  background: rgba(255,255,255,0.1);
}

.ut-nav-search-wrap {
  position: relative;
}

.ut-nav-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: rgba(255,255,255,0.35);
  pointer-events: none;
}

/* ===== 导航分组 ===== */
.ut-nav-body {
  flex: 1;
  padding: 8px 0 16px;
  overflow-y: auto;
}

.ut-nav-group {
  margin-bottom: 4px;
}

.ut-nav-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.ut-nav-group-title:hover {
  background: rgba(255,255,255,0.04);
}

.ut-nav-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-sidebar-muted);
}

.ut-nav-group-arrow {
  width: 14px;
  height: 14px;
  color: rgba(255,255,255,0.3);
  transition: transform var(--transition-slow);
  flex-shrink: 0;
}

.ut-nav-group.collapsed .ut-nav-group-arrow {
  transform: rotate(-90deg);
}

.ut-nav-group-items {
  overflow: hidden;
  max-height: 800px;
  transition: max-height var(--transition-slow) ease;
}

.ut-nav-group.collapsed .ut-nav-group-items {
  max-height: 0;
}

/* ===== 导航项 ===== */
.ut-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 20px;
  text-decoration: none;
  color: var(--text-sidebar);
  font-size: 13px;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.ut-nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #ffffff;
}

.ut-nav-item.active {
  background: var(--bg-sidebar-active);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.ut-nav-item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.ut-nav-item.active .ut-nav-item-icon {
  opacity: 1;
}

.ut-nav-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ut-nav-item-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.4;
}

/* 搜索过滤隐藏 */
.ut-nav-item.ut-nav-hidden {
  display: none;
}

.ut-nav-group.ut-nav-hidden {
  display: none;
}

/* ===== 侧边栏底部 ===== */
.ut-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.ut-sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--text-sidebar-muted);
  font-size: 12px;
  text-decoration: none;
  transition: color var(--transition);
}

.ut-sidebar-footer-link:hover {
  color: #ffffff;
}

/* ===== 主内容区 ===== */
.ut-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  background: var(--bg-page);
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

.ut-content > * {
  animation: ut-fadeIn 0.3s ease;
}

/* ===== 页面进入动画 ===== */
@keyframes ut-fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 页面头部 ===== */
.ut-page-header {
  margin-bottom: 24px;
}

.ut-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  line-height: 1.3;
}

.ut-page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.ut-page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.ut-page-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.ut-page-breadcrumb a:hover {
  color: var(--accent);
}

/* ===== 统一卡片 ===== */
.ut-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.ut-card:hover {
  box-shadow: var(--shadow-md);
}

.ut-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.ut-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ut-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.ut-card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0 0;
}

.ut-card-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ut-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* 卡片网格 */
.ut-card-grid {
  display: grid;
  gap: 16px;
}

.ut-card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ut-card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ut-card-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== 统一按钮 ===== */
.ut-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  font-family: var(--font-family);
}

.ut-btn:active {
  transform: scale(0.97);
}

.ut-btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.ut-btn-primary:hover {
  background: var(--accent-hover);
}

.ut-btn-secondary {
  background: var(--primary);
  color: #ffffff;
}

.ut-btn-secondary:hover {
  background: var(--primary-light);
}

.ut-btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.ut-btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ut-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.ut-btn-ghost:hover {
  background: var(--bg-page);
  color: var(--text-primary);
}

.ut-btn-danger {
  background: #dc2626;
  color: #ffffff;
}

.ut-btn-danger:hover {
  background: #b91c1c;
}

.ut-btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.ut-btn-lg {
  padding: 11px 24px;
  font-size: 14px;
}

.ut-btn-block {
  width: 100%;
}

.ut-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
}

.ut-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== 统一Tab ===== */
.ut-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.ut-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-family);
}

.ut-tab:hover {
  color: var(--accent);
}

.ut-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Tab 内容面板 */
.ut-tab-panel {
  display: none;
}

.ut-tab-panel.active {
  display: block;
  animation: ut-fadeIn 0.2s ease;
}

/* ===== 统一Tag/Badge ===== */
.ut-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

.ut-tag-blue {
  background: #eff6ff;
  color: #2F88FF;
  border: 1px solid #bfdbfe;
}

.ut-tag-green {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.ut-tag-red {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.ut-tag-orange {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.ut-tag-gray {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.ut-tag-purple {
  background: #faf5ff;
  color: #9333ea;
  border: 1px solid #e9d5ff;
}

/* ===== 进度条 ===== */
.ut-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.ut-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.ut-progress-green .ut-progress-fill {
  background: #16a34a;
}

.ut-progress-orange .ut-progress-fill {
  background: #d97706;
}

.ut-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}

.ut-progress-label-text {
  color: var(--text-primary);
  font-weight: 500;
}

.ut-progress-label-value {
  color: var(--text-secondary);
}

/* ===== 统一表格 ===== */
.ut-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.ut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ut-table th {
  background: #f8fafc;
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ut-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.ut-table tr:last-child td {
  border-bottom: none;
}

.ut-table tr:hover td {
  background: #f8fafc;
}

/* ===== 统一表单 ===== */
.ut-form-group {
  margin-bottom: 16px;
}

.ut-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.ut-form-input,
.ut-form-select,
.ut-form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition);
  outline: none;
  box-sizing: border-box;
  font-family: var(--font-family);
}

.ut-form-input:focus,
.ut-form-select:focus,
.ut-form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,136,255,0.1);
}

.ut-form-input::placeholder,
.ut-form-textarea::placeholder {
  color: var(--text-muted);
}

.ut-form-textarea {
  min-height: 80px;
  resize: vertical;
}

.ut-form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.ut-form-error {
  font-size: 11px;
  color: #dc2626;
  margin-top: 4px;
}

/* ===== 统一列表 ===== */
.ut-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ut-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.ut-list-item:last-child {
  border-bottom: none;
}

/* ===== 统一空状态 ===== */
.ut-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.ut-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--border);
}

.ut-empty-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.ut-empty-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 统一统计卡片 ===== */
.ut-stat {
  text-align: center;
  padding: 16px;
}

.ut-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.ut-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.ut-stat-change {
  font-size: 11px;
  font-weight: 500;
  margin-top: 4px;
}

.ut-stat-up { color: #16a34a; }
.ut-stat-down { color: #dc2626; }

/* ===== 统一分割线 ===== */
.ut-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.ut-divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin: 20px 0;
}

.ut-divider-text::before,
.ut-divider-text::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ===== 统一提示/Alert ===== */
.ut-alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.ut-alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.ut-alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.ut-alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.ut-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ===== 统一头像 ===== */
.ut-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.ut-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.ut-avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

/* ===== 工具类 ===== */
.ut-flex { display: flex; }
.ut-flex-col { flex-direction: column; }
.ut-flex-wrap { flex-wrap: wrap; }
.ut-flex-center { align-items: center; justify-content: center; }
.ut-flex-between { justify-content: space-between; }
.ut-flex-1 { flex: 1; }
.ut-gap-4 { gap: 4px; }
.ut-gap-8 { gap: 8px; }
.ut-gap-12 { gap: 12px; }
.ut-gap-16 { gap: 16px; }
.ut-gap-24 { gap: 24px; }
.ut-mt-8 { margin-top: 8px; }
.ut-mt-16 { margin-top: 16px; }
.ut-mt-24 { margin-top: 24px; }
.ut-mb-8 { margin-bottom: 8px; }
.ut-mb-16 { margin-bottom: 16px; }
.ut-mb-24 { margin-bottom: 24px; }
.ut-p-16 { padding: 16px; }
.ut-p-24 { padding: 24px; }
.ut-text-center { text-align: center; }
.ut-text-right { text-align: right; }
.ut-text-sm { font-size: 12px; }
.ut-text-base { font-size: 13px; }
.ut-text-lg { font-size: 15px; }
.ut-text-muted { color: var(--text-muted); }
.ut-text-secondary { color: var(--text-secondary); }
.ut-text-accent { color: var(--accent); }
.ut-text-success { color: #16a34a; }
.ut-text-danger { color: #dc2626; }
.ut-font-medium { font-weight: 500; }
.ut-font-semibold { font-weight: 600; }
.ut-font-bold { font-weight: 700; }
.ut-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ut-hidden { display: none !important; }
.ut-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== 移动端汉堡菜单按钮 ===== */
.ut-mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

/* ===== 遮罩层 ===== */
.ut-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

.ut-overlay.active {
  display: block;
}

/* ===== Tooltip ===== */
.ut-tooltip {
  position: relative;
}

.ut-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.ut-tooltip:hover::after {
  opacity: 1;
}

/* ===== 拖拽相关 ===== */
.ut-draggable {
  cursor: grab;
  user-select: none;
  transition: transform var(--transition), box-shadow var(--transition);
}

.ut-draggable:active {
  cursor: grabbing;
}

.ut-draggable.dragging {
  opacity: 0.7;
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.ut-drop-zone {
  min-height: 48px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.ut-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.ut-drop-zone.correct {
  border-color: #16a34a;
  background: #f0fdf4;
}

.ut-drop-zone.incorrect {
  border-color: #dc2626;
  background: #fef2f2;
}

/* ===== 翻卡片 ===== */
.ut-flashcard {
  width: 100%;
  max-width: 400px;
  height: 220px;
  perspective: 1000px;
  cursor: pointer;
  margin: 0 auto;
}

.ut-flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.ut-flashcard.flipped .ut-flashcard-inner {
  transform: rotateY(180deg);
}

.ut-flashcard-front,
.ut-flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.ut-flashcard-front {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.ut-flashcard-back {
  background: var(--primary);
  color: #ffffff;
  transform: rotateY(180deg);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== 时间轴 ===== */
.ut-timeline {
  position: relative;
  padding-left: 28px;
}

.ut-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.ut-timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.ut-timeline-item:last-child {
  padding-bottom: 0;
}

.ut-timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-page);
  box-shadow: 0 0 0 2px var(--accent);
}

.ut-timeline-dot.ut-dot-muted {
  background: var(--border);
  box-shadow: 0 0 0 2px var(--border);
}

.ut-timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.ut-timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ===== 通知提示 ===== */
.ut-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: ut-slideIn 0.3s ease;
  font-size: 13px;
  color: var(--text-primary);
}

.ut-notification.ut-notification-exit {
  animation: ut-slideOut 0.3s ease forwards;
}

@keyframes ut-slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes ut-slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

.ut-notification-success { border-left: 3px solid #16a34a; }
.ut-notification-error { border-left: 3px solid #dc2626; }
.ut-notification-warning { border-left: 3px solid #d97706; }
.ut-notification-info { border-left: 3px solid var(--accent); }

/* ===== 倒计时 ===== */
.ut-countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Courier New', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.ut-countdown-sep {
  color: var(--text-muted);
  animation: ut-blink 1s step-end infinite;
}

@keyframes ut-blink {
  50% { opacity: 0; }
}

.ut-countdown.ut-countdown-warning {
  color: #d97706;
}

.ut-countdown.ut-countdown-danger {
  color: #dc2626;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .ut-card-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .ut-card-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .ut-mobile-toggle {
    display: flex;
  }

  .ut-sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    z-index: 100;
    transition: left var(--transition-slow);
  }

  .ut-sidebar.open {
    left: 0;
  }

  .ut-content {
    margin-left: 0;
    padding: 16px;
    padding-top: 56px;
  }

  .ut-card-grid-2,
  .ut-card-grid-3,
  .ut-card-grid-4 {
    grid-template-columns: 1fr;
  }

  .ut-tabs {
    gap: 0;
  }

  .ut-tab {
    padding: 8px 14px;
    font-size: 12px;
  }

  .ut-page-title {
    font-size: 18px;
  }

  .ut-notification {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .ut-content {
    padding: 12px;
    padding-top: 56px;
  }

  .ut-card {
    padding: 14px;
  }

  .ut-btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}

/* ===== 打印 ===== */
@media print {
  .ut-sidebar,
  .ut-mobile-toggle,
  .ut-overlay {
    display: none !important;
  }

  .ut-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
}


/* ===== Override existing sidebar-nav to match unified design ===== */
nav.sidebar-nav,
.sidebar-nav {
  background: var(--bg-sidebar);
  padding: 0;
  min-height: 100vh;
}

.sidebar-nav .nav-section-title {
  padding: 20px 20px 6px;
  font-size: 10px;
  color: var(--text-sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color 0.2s;
}

.sidebar-nav .nav-section-title:hover {
  color: var(--text-sidebar);
}

.sidebar-nav .nav-section-title .collapse-icon {
  transition: transform 0.3s ease;
  font-size: 10px;
}

.sidebar-nav .nav-section-title.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  padding: 9px 20px;
  color: var(--text-sidebar);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  gap: 10px;
  user-select: none;
  border-left: 2px solid transparent;
  margin: 1px 0;
  text-decoration: none;
}

.sidebar-nav .nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.sidebar-nav .nav-item.active {
  background: var(--bg-sidebar-active);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-nav .nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-nav .nav-item.active .nav-icon {
  opacity: 1;
}

/* Nav search box in sidebar */
.ut-nav-search {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ut-nav-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 12px;
  outline: none;
  transition: all 0.2s;
}

.ut-nav-search input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.1);
}

.ut-nav-search input::placeholder {
  color: rgba(255,255,255,0.35);
}



/* Sidebar logo/brand area */
.sidebar-nav .sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-nav .sidebar-logo h1 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.sidebar-nav .sidebar-logo span {
  color: var(--text-sidebar-muted) !important;
  font-size: 10.5px;
}

/* Nav badge */
.sidebar-nav .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: rgba(47,136,255,0.15);
  color: var(--accent);
  padding: 1px 7px;
  border-radius: 8px;
}
