/* ============================================================
   清华职校管理系统 - UI视觉增强样式包 v1.0
   包含: Lucide图标 / 骨架屏 / 空状态 / 登录页升级 / 细节优化
   用法: 在index.html的</head>前引入 <link rel="stylesheet" href="css/ui-enhance.css?v=1">
   ============================================================ */

/* ===== 1. Lucide 图标基础样式 ===== */
.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.lucide-sm { width: 14px; height: 14px; }
.lucide-lg { width: 22px; height: 22px; }
.lucide-xl { width: 28px; height: 28px; }

/* 侧边栏图标 */
.nav-item .lucide {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}
.nav-item.active .lucide { opacity: 1; }

/* 按钮图标 */
.btn .lucide { width: 16px; height: 16px; }
.btn-sm .lucide { width: 14px; height: 14px; }

/* 卡片标题图标 */
.card-title .lucide { color: var(--primary); }

/* ===== 2. 骨架屏加载动画 ===== */
.skeleton {
  background: linear-gradient(90deg, #eef0f4 25%, #f6f7f9 50%, #eef0f4 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 骨架屏容器 */
.skeleton-wrap { padding: 4px; }
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-circle { width: 36px; height: 36px; border-radius: 50%; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card { height: 90px; border-radius: 10px; margin-bottom: 12px; }
.skeleton-table-row { height: 44px; border-bottom: 1px solid var(--border); }

/* 数据看板骨架屏 */
.skeleton-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.skeleton-stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border-left: 4px solid #e8f0fe;
}
.skeleton-stat-label { width: 80px; height: 13px; margin-bottom: 10px; }
.skeleton-stat-value { width: 120px; height: 28px; margin-bottom: 8px; }
.skeleton-stat-sub { width: 100px; height: 12px; }

/* 表格骨架屏 */
.skeleton-table {
  width: 100%;
  border-collapse: collapse;
}
.skeleton-table th {
  height: 40px;
  background: var(--bg-tint);
  border-bottom: 1px solid var(--border);
}
.skeleton-table td {
  height: 48px;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
}

/* ===== 3. 空状态设计 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 50%;
}
.empty-state-icon .lucide {
  width: 40px;
  height: 40px;
  color: var(--text-3);
  opacity: 0.6;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 16px;
  line-height: 1.6;
}
.empty-state-action {
  display: inline-flex;
  gap: 10px;
}

/* 不同场景空状态配色 */
.empty-state.students .empty-state-icon { background: #e8f0fe; }
.empty-state.students .empty-state-icon .lucide { color: var(--primary); }
.empty-state.search .empty-state-icon { background: #fdf3e7; }
.empty-state.search .empty-state-icon .lucide { color: var(--warning); }
.empty-state.notify .empty-state-icon { background: #e7f6ee; }
.empty-state.notify .empty-state-icon .lucide { color: var(--success); }
.empty-state.owe .empty-state-icon { background: #fdebec; }
.empty-state.owe .empty-state-icon .lucide { color: var(--danger); }

/* ===== 4. 登录页视觉升级 ===== */
.login-page-v2 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
/* 背景装饰圆 */
.login-page-v2::before,
.login-page-v2::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.login-page-v2::before {
  width: 400px;
  height: 400px;
  top: -150px;
  right: -100px;
}
.login-page-v2::after {
  width: 300px;
  height: 300px;
  bottom: -100px;
  left: -80px;
}
/* 背景网格 */
.login-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.login-container-v2 {
  display: flex;
  width: 900px;
  max-width: 100%;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0,0,0,0.25);
  position: relative;
  z-index: 1;
}
.login-left-v2 {
  flex: 1;
  background: linear-gradient(160deg, #2f6fed 0%, #1a3f8f 100%);
  padding: 50px 40px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-left-v2::before {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  top: -80px;
  right: -60px;
}
.login-brand-v2 {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.login-brand-v2 img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.login-brand-v2 .brand-text-v2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.login-brand-v2 .brand-sub-v2 {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
}
.login-hero-v2 {
  position: relative;
  z-index: 1;
}
.login-hero-v2 h2 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 14px;
}
.login-hero-v2 p {
  font-size: 14px;
  opacity: 0.8;
  line-height: 1.8;
}
.login-features-v2 {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.login-feature-v2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  opacity: 0.85;
}
.login-feature-v2 .lucide {
  width: 16px;
  height: 16px;
  background: rgba(255,255,255,0.15);
  padding: 4px;
  border-radius: 6px;
}

.login-right-v2 {
  width: 420px;
  padding: 50px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-right-v2 .login-title-v2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.login-right-v2 .login-subtitle-v2 {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 32px;
}
.input-group-v2 {
  position: relative;
  margin-bottom: 18px;
}
.input-group-v2 label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 7px;
}
.input-wrap-v2 {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap-v2 .input-icon-v2 {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  display: flex;
}
.input-wrap-v2 input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 42px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: all 0.2s;
}
.input-wrap-v2 input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(47,111,237,0.1);
}
.input-wrap-v2 input::placeholder { color: var(--text-3); }
.toggle-pwd-v2 {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  transition: color 0.15s;
}
.toggle-pwd-v2:hover { color: var(--primary); }

.login-options-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.remember-me-v2 {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}
.remember-me-v2 input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.forgot-pwd-v2 {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}
.forgot-pwd-v2:hover { text-decoration: underline; }

.btn-login-v2 {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #2f6fed 0%, #2456c0 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(47,111,237,0.3);
}
.btn-login-v2:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(47,111,237,0.4);
}
.btn-login-v2:active { transform: translateY(0); }
.btn-login-v2:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.btn-login-v2 .loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-footer-v2 {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}
.login-footer-v2 a {
  color: var(--text-3);
  text-decoration: none;
}
.login-footer-v2 a:hover { color: var(--primary); }

/* 登录页移动端适配 */
@media (max-width: 1023px) {
  .login-container-v2 { flex-direction: column; width: 100%; max-width: 420px; }
  .login-left-v2 { padding: 32px 28px; }
  .login-left-v2 .login-hero-v2,
  .login-left-v2 .login-features-v2 { display: none; }
  .login-right-v2 { width: 100%; padding: 32px 28px; }
}

/* ===== 5. 其他视觉细节优化 ===== */
/* 卡片悬停效果增强 */
.card {
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(31,36,48,0.1);
}

/* 统计卡片渐变边框 */
.stat-card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(31,36,48,0.1);
}

/* 按钮涟漪效果（可选） */
.btn {
  position: relative;
  overflow: hidden;
}

/* 表格行悬停 */
table tbody tr {
  transition: background 0.15s;
}

/* 标签样式优化 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

/* 模态框动画 */
.modal-mask {
  animation: fadeIn 0.2s ease;
}
.modal {
  animation: slideUp 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 通知面板动画 */
.notify-panel {
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 侧边栏菜单项动画 */
.nav-item {
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #fff;
  border-radius: 0 3px 3px 0;
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #c8ccd4;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #a8adb8; }

/* 侧边栏滚动条 */
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* 顶部栏日期优化 */
.topbar-date {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 全局搜索框优化 */
.global-search input {
  background: var(--bg);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.global-search input:focus {
  background: #fff;
  border-color: var(--primary);
}

/* Toast 通知样式增强 */
.toast {
  border-radius: 10px !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
  padding: 12px 20px !important;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 6. 响应式适配补充 ===== */
@media (max-width: 1023px) {
  .skeleton-stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .skeleton-stat-card { padding: 14px; }
  .empty-state { padding: 40px 16px; }
  .empty-state-icon { width: 64px; height: 64px; }
  .empty-state-icon .lucide { width: 32px; height: 32px; }
}
