/* ========================================
   赵永伟个人网站 - 统一样式表
   深蓝科技风 | 手机优先响应式
   ======================================== */

/* --- CSS 变量 --- */
:root {
  --primary-dark: #0a2540;
  --primary-mid: #1a3a6b;
  --primary-light: #2c5282;
  --accent: #4299e1;
  --accent-hover: #3182ce;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-light: #718096;
  --bg-white: #ffffff;
  --bg-light: #f7fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --success: #38a169;
  --warning: #d69e2e;
  --gradient-header: linear-gradient(135deg, #0a2540 0%, #1a3a6b 50%, #2c5282 100%);
  --shadow-sm: 0 1px 3px rgba(10, 37, 64, 0.12);
  --shadow-md: 0 4px 14px rgba(10, 37, 64, 0.15);
  --shadow-lg: 0 10px 30px rgba(10, 37, 64, 0.20);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  --nav-height: 60px;
  --footer-height: 80px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: clip;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text-primary);
  background: var(--bg-light);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}


/* --- Focus Visible (新增) --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.navbar-menu a:focus-visible,
.hamburger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- 容器 --- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: var(--transition);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.navbar-brand svg {
  width: 28px;
  height: 28px;
  fill: var(--accent);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar-menu a {
  color: rgba(255,255,255,0.80);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.navbar-menu a:hover,
.navbar-menu a.active {
  color: #fff;
  background: rgba(66, 153, 225, 0.20);
}

/* 汉堡按钮 */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.hamburger:hover {
  background: rgba(255,255,255,0.10);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger span:nth-child(1) { margin-bottom: 5px; }
.hamburger span:nth-child(3) { margin-top: 5px; }

/* 汉堡激活状态 */
.hamburger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}
.hamburger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   主体内容区
   ======================================== */
main {
  flex: 1;
  margin-top: var(--nav-height);
}

/* ========================================
   头部 Hero (首页用)
   ======================================== */
.hero {
  background: var(--primary-dark);
  color: #fff;
  padding: 60px 0 50px;
}

.hero .container {
  display: flex;
  align-items: center;
  gap: 40px;
  text-align: left;
}

.hero-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.30);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-avatar svg {
  width: 52px;
  height: 52px;
  fill: rgba(255,255,255,0.85);
}

.hero-content {
  flex: 1;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-align: left;
}

.hero .tagline {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.80);
  margin-bottom: 24px;
  line-height: 1.6;
  text-align: left;
}

.hero .btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
}


/* ========================================
   按钮
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.50);
}

.btn-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.10);
  color: #fff;
}

.btn-dark {
  background: var(--primary-mid);
  color: #fff;
}

.btn-dark:hover {
  background: var(--primary-light);
  color: #fff;
  transform: translateY(-1px);
}

/* ========================================
   章节通用
   ======================================== */
.section {
  padding: 48px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 32px;
}

/* ========================================
   卡片
   ======================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.card-icon svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   能力卡片网格 (首页)
   ======================================== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ========================================
   数据条 (首页)
   ======================================== */
.stats-bar {
  background: var(--primary-dark);
  padding: 36px 0;
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: center;
}

.stat-item {}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.70);
  margin-top: 4px;
}

/* ========================================
   时间线 (关于我)
   ======================================== */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--primary-mid));
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-light);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.timeline-item .period {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ========================================
   AI 能力页
   ======================================== */
.ai-hero {
  background: linear-gradient(135deg, #0a2540 0%, #1a3a6b 60%, #2b6cb0 100%);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}

.ai-hero h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.ai-hero p {
  color: rgba(255,255,255,0.80);
  font-size: 1rem;
}

.ai-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.ai-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 24px;
  transition: var(--transition);
}

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

.ai-card .card-label {
  display: inline-block;
  background: var(--primary-mid);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.ai-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ai-card ul {
  margin-top: 12px;
  padding-left: 0;
}

.ai-card ul li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 4px 0;
  padding-left: 18px;
  position: relative;
}

.ai-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* ========================================
   项目卡片网格 (项目案例)
   ======================================== */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.project-card-header {
  background: var(--primary-mid);
  padding: 20px 24px;
  color: #fff;
}

.project-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.project-card-header .tag {
  font-size: 0.75rem;
  background: rgba(255,255,255,0.20);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  display: inline-block;
}

.project-card-body {
  padding: 20px 24px;
}

.project-card-body p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.project-card-footer {
  padding: 0 24px 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-card-footer .tag {
  font-size: 0.78rem;
  background: var(--bg-light);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ========================================
   博客卡片
   ======================================== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 24px;
  transition: var(--transition);
}

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

.blog-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.blog-card h2 a {
  color: var(--primary-dark);
}

.blog-card h2 a:hover {
  color: var(--accent);
}

.blog-card .meta {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.blog-card .meta .category {
  background: var(--primary-mid);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.blog-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   文章详情页
   ======================================== */
.article-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 28px 24px;
}

.article-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-content .meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.article-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 28px 0 12px;
}

.article-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-mid);
  margin: 20px 0 8px;
}

.article-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 14px;
}

.article-content ul, .article-content ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.article-content li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 6px;
}

.article-content code {
  background: var(--bg-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: "SF Mono", "Fira Code", monospace;
  color: var(--accent-hover);
}

.article-content pre {
  background: var(--primary-dark);
  color: #e2e8f0;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 18px 0;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 0.85rem;
}

.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 18px 0;
  background: var(--bg-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.article-content blockquote p {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0;
}

.article-content img {
  border-radius: var(--radius);
  margin: 16px 0;
}

/* ========================================
   联系方式页
   ======================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.contact-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
}

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

.contact-card .icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-card .icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.contact-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.contact-card .hint {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ========================================
   页脚
   ======================================== */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.60);
  padding: 28px 0;
  text-align: center;
  font-size: 0.85rem;
  margin-top: auto;
}

.footer a {
  color: var(--accent);
}

.footer a:hover {
  color: #63b3ed;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255,255,255,0.70);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: #fff;
}

/* ========================================
   页面内头部 (通用)
   ======================================== */
.page-header {
  background: var(--gradient-header);
  color: #fff;
  padding: 40px 0 32px;
  text-align: center;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-header p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
}

/* ========================================
   返回按钮
   ======================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 20px;
}

.back-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.back-link:hover {
  color: var(--accent-hover);
}

/* ========================================
   分隔线
   ======================================== */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ========================================
   标签/徽章
   ======================================== */
.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.tag-blue {
  background: rgba(66, 153, 225, 0.12);
  color: var(--accent-hover);
  border-color: rgba(66, 153, 225, 0.30);
}

/* ========================================
   响应式 - 平板 (≥640px)
   ======================================== */
@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }

  .hero {
    padding: 80px 0 60px;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ai-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .section {
    padding: 56px 0;
  }
}

/* ========================================
   响应式 - 桌面 (≥900px)
   ======================================== */
@media (min-width: 900px) {
  .navbar-menu {
    gap: 2px;
  }

  .navbar-menu a {
    padding: 8px 14px;
    font-size: 0.92rem;
  }

  .hamburger {
    display: none;
  }

  .hero {
    padding: 100px 0 72px;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .hero .tagline {
    font-size: 1.15rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .ai-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .section {
    padding: 64px 0;
  }

  .section-title {
    font-size: 1.65rem;
  }

  .page-header {
    padding: 52px 0 40px;
  }

  .page-header h1 {
    font-size: 2rem;
  }
}

/* ========================================
   响应式 - 手机菜单
   ======================================== */
@media (max-width: 899px) {
  .navbar-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
    box-shadow: var(--shadow-lg);
    transform: translateY(-110%);
    opacity: 0;
    transition: var(--transition);
    z-index: 999;
  }

  .navbar-menu.is-open {
    transform: translateY(0);
    opacity: 1;
  }

  .navbar-menu a {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-align: left;
  }

  .navbar-menu a:last-child {
    border-bottom: none;
  }

  .hamburger {
    display: flex;
  }
}

/* ========================================
   动画
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

/* ========================================
   工具类
   ======================================== */
.text-center { text-align: center; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ========================================
   减少动效偏好
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover, .ai-card:hover, .project-card:hover, .blog-card:hover, .contact-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
}

