/* ============================================
   GradHub — Flask 版样式（明亮科技风）
   由原静态版 style.css 迁移，剔除 Vue 依赖
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;700&family=Share+Tech+Mono&display=swap');

:root {
  --bg-page:      #f0f4f8;
  --bg-white:     #ffffff;
  --primary:      #0ea5e9;
  --primary-dark: #0284c7;
  --primary-glow: rgba(14, 165, 233, 0.35);
  --accent:       #06b6d4;
  --accent-glow:  rgba(6, 182, 212, 0.3);
  --success:      #10b981;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --text-main:    #0f172a;
  --text-regular: #475569;
  --text-sub:     #94a3b8;
  --text-hint:    #cbd5e1;
  --border:       #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.1);
  --shadow-glow:  0 0 20px var(--primary-glow), 0 4px 20px rgba(0,0,0,0.08);
  --radius:       10px;
  --font:         'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-mono:    'Share Tech Mono', 'Courier New', monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-page);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- 背景装饰 --- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  animation: gridMove 30s linear infinite;
}
@keyframes gridMove {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(80px, 80px); }
}
.bg-glow {
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(14,165,233,0.08) 0%, transparent 70%);
  animation: glowDrift 15s ease-in-out infinite alternate;
}
@keyframes glowDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-100px, 80px) scale(1.2); }
}

/* --- App --- */
.app { position: relative; z-index: 1; min-height: 100vh; }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 32px;
  height: 56px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}
.logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--primary-glow), 0 0 16px rgba(14,165,233,0.15);
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 2px 8px var(--primary-glow), 0 0 16px rgba(14,165,233,0.15); }
  50%      { box-shadow: 0 2px 12px var(--primary-glow), 0 0 24px rgba(14,165,233,0.3); }
}
.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}
.header-stat {
  font-size: 13px;
  color: var(--text-sub);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.header-stat strong { color: var(--primary); font-weight: 600; }

/* --- Main --- */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 15px;
  color: var(--text-sub);
  max-width: 480px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.7;
}
.hero-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  margin: 24px auto 0;
  border-radius: 1px;
}

/* --- 搜索栏 --- */
.search-section { margin-bottom: 28px; }
.search-bar { max-width: 560px; margin: 0 auto; }
.search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  transition: all 0.25s;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}
.result-count {
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 10px;
  font-family: var(--font-mono);
}
.result-count strong { color: var(--primary); }

/* --- Flash 消息 --- */
.flash-area { margin-bottom: 20px; }
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  border: 1px solid;
}
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* --- 卡片网格 --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(14,165,233,0.3);
}
.project-card:hover::before { opacity: 1; }
.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.project-card:hover .card-cover img { transform: scale(1.04); }
.cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #dcdfe6;
}
.card-media-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: #fff;
  background: rgba(15,23,42,0.6);
  padding: 3px 10px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.card-body {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  font-size: 13px;
  color: var(--text-regular);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.tech-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(14,165,233,0.25);
  color: var(--primary-dark);
  background: rgba(14,165,233,0.05);
  padding: 2px 8px;
  border-radius: 4px;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- 分页 --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 36px 0 16px;
}
.page-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  color: var(--primary-dark);
  background: #fff;
  transition: all 0.25s;
  font-weight: 500;
}
.page-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.page-info { color: var(--text-sub); font-family: var(--font-mono); }

/* --- 空状态 --- */
.empty-state { text-align: center; padding: 80px 24px; color: #909399; }
.empty-icon { font-size: 48px; }
.empty-hint { font-size: 13px; color: #c0c4cc; margin-top: 8px; }

/* --- 详情页 --- */
.detail-page { max-width: 960px; margin: 0 auto; }
.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--text-sub);
  text-decoration: none;
}
.back-link:hover { color: var(--primary); }
.detail-header { margin-bottom: 24px; }
.detail-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}
.detail-section { margin-bottom: 28px; }
.detail-section:last-child { margin-bottom: 0; }
.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
  font-family: var(--font-mono);
}
.detail-desc {
  font-size: 14px;
  color: var(--text-regular);
  line-height: 1.9;
  text-align: justify;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.gallery-item {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.25s;
  background: #f0f4f8;
}
.gallery-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-item:hover img { transform: scale(1.05); }
.video-wrapper {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--border);
}
.video-wrapper video { width: 100%; height: 100%; object-fit: cover; }
.detail-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* --- 按钮 --- */
.btn-primary {
  display: inline-block;
  padding: 10px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.25s;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-glow); }
.btn-secondary {
  display: inline-block;
  padding: 10px 28px;
  background: #fff;
  color: var(--text-regular);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
  font-size: 14px;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* --- 表单 --- */
.apply-form { max-width: 560px; margin: 0 auto; }
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-regular);
}
.required { color: var(--danger); }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  transition: all 0.25s;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}
.form-textarea { resize: vertical; }
.form-error { display: block; color: var(--danger); font-size: 12px; margin-top: 4px; }
.form-actions { margin-top: 28px; display: flex; gap: 12px; }

/* --- 后台管理 --- */
.admin-page { max-width: 1100px; margin: 0 auto; }
.admin-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.admin-nav-title { font-weight: 700; font-family: var(--font-mono); margin-right: 8px; }
.admin-nav a { color: var(--text-regular); text-decoration: none; font-size: 14px; }
.admin-nav a:hover { color: var(--primary); }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-card.stat-warn { border-color: #fde68a; background: #fffbeb; }
.stat-num { font-size: 32px; font-weight: 800; color: var(--primary); font-family: var(--font-mono); }
.stat-warn .stat-num { color: var(--warning); }
.stat-label { font-size: 13px; color: var(--text-sub); margin-top: 4px; }
.admin-section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: top;
}
.admin-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-regular);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-actions { white-space: nowrap; }
.admin-actions a { color: var(--primary); text-decoration: none; margin-right: 10px; }
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  margin-right: 10px;
  padding: 0;
}
.link-danger { color: var(--danger); }
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.status-pending  { background: #fffbeb; color: #92400e; }
.status-approved { background: #ecfdf5; color: #065f46; }
.status-rejected { background: #fef2f2; color: #991b1b; }
.filter-tabs { display: flex; gap: 8px; }
.filter-tabs a {
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-regular);
  font-size: 13px;
}
.filter-tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.reason-cell { max-width: 260px; }
.review-form { display: flex; gap: 6px; align-items: center; }
.review-input { width: 140px; padding: 6px 10px; }
.btn-small {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  color: #fff;
}
.btn-ok { background: var(--success); }
.btn-danger { background: var(--danger); }

/* --- 图片管理 --- */
.img-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.img-manage-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f0f4f8;
}
.img-manage-item.is-cover {
  border: 2px solid var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}
.img-manage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-manage-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
}
.img-manage-bar .link-btn { color: #fff; margin-right: 0; font-size: 12px; }
.img-manage-bar .link-danger { color: #fca5a5; }
.img-cover-tag {
  font-size: 11px;
  color: #fff;
  background: var(--primary);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.img-upload-row { margin-top: 8px; }
.img-upload-row .form-input { padding: 8px; }
.img-manage-item img { cursor: zoom-in; }
.img-manage-item img:hover { opacity: 0.92; }

/* --- 灯箱 --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
}
.lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); transform: rotate(90deg); }

/* --- 视频/HTML 文件区 --- */
.file-current {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 10px;
}
.file-preview-video {
  width: 100%;
  max-height: 320px;
  border-radius: 8px;
  background: #000;
}
.file-current-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.file-current-name {
  flex: 1;
  font-size: 13px;
  color: #64748b;
  word-break: break-all;
  min-width: 120px;
}

/* --- 头部用户菜单 --- */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-right-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 20px;
  white-space: nowrap;
}
.user-menu { position: relative; }
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-main);
  transition: all 0.25s;
}
.user-menu-btn:hover { border-color: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }
.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-name { font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { font-size: 10px; color: var(--text-sub); }
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 200;
}
.user-dropdown.open { display: block; animation: dropIn 0.18s ease; }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--text-regular);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s;
}
.user-dropdown a:hover { background: #f1f5f9; color: var(--text-main); }
.user-dropdown .dropdown-danger { color: var(--danger); }
.user-dropdown .dropdown-danger:hover { background: #fef2f2; }
.dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 8px; }

/* --- 个人信息 --- */
.profile-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 0;
}
.profile-table th {
  width: 140px;
  background: #f8fafc;
  color: var(--text-regular);
  font-weight: 600;
}

/* --- 登录 --- */
.admin-login-wrap {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}
.admin-login-card {
  width: 360px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.admin-login-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; text-align: center; }

/* --- 页脚 --- */
.site-footer {
  text-align: center;
  padding: 40px 24px 32px;
  font-size: 13px;
  color: var(--text-hint);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .site-header { padding: 0 16px; height: 50px; }
  .main-content { padding: 16px; }
  .hero { padding: 28px 0 20px; }
  .project-grid { grid-template-columns: 1fr; gap: 14px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .admin-table { display: block; overflow-x: auto; }
}
