/* ============================================
   Apple 风格简约博客 - 全局样式
   ============================================ */

/* --- CSS 变量 --- */
:root {
  --color-bg: #f5f5f7;
  --color-white: #ffffff;
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #86868b;
  --color-text-tertiary: #aeaeb2;
  --color-accent: #0071e3;
  --color-accent-hover: #0077ed;
  --color-border: #d2d2d7;
  --color-red: #de1e26;
  --color-gold: #ffd700;
  --font-primary: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, Monaco, "Courier New", monospace;
  --max-width: 980px;
  --nav-height: 48px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  padding-top: var(--nav-height);
}

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

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

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

/* --- 导航栏 --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 3000;
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.navbar-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.3px;
}

.navbar-logo:hover {
  color: var(--color-text-primary);
  opacity: 0.8;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.navbar-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  letter-spacing: 0.2px;
  transition: var(--transition);
  position: relative;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--color-text-primary);
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-text-primary);
}

.navbar-toggle svg {
  width: 20px;
  height: 20px;
}

/* --- 页面容器 --- */
.page {
  min-height: calc(100vh - var(--nav-height) - 200px);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Hero 区域 --- */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
}

.hero-content {
  max-width: 720px;
}

.hero-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  color: var(--color-text-primary);
}

.hero-desc {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: var(--font-primary);
}

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

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

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn-secondary:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

.btn-red {
  background: var(--color-red);
  color: var(--color-white);
}

.btn-red:hover {
  background: #b80000;
  color: var(--color-white);
}

/* --- Section 通用 --- */
.section {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.section-desc {
  font-size: 18px;
  color: var(--color-text-secondary);
  max-width: 580px;
  margin: 0 auto;
}

/* --- 卡片 --- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

/* --- 首页快速导航卡片 --- */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.nav-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

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

.nav-card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 24px;
}

.nav-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.nav-card p {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.nav-card a {
  color: inherit;
}

.nav-card a:hover {
  text-decoration: none;
}

/* --- 简历页面 --- */
.resume-section {
  margin-bottom: 48px;
}

.resume-section:last-child {
  margin-bottom: 0;
}

.resume-section h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.resume-info {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
}

.resume-info dt {
  font-weight: 500;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.resume-info dd {
  font-size: 15px;
  margin-bottom: 8px;
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}

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

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

.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-white);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-org {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--color-bg);
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

/* --- 作品集 --- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.portfolio-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.portfolio-card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #e8e8ed, #f5f5f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--color-text-tertiary);
}

.portfolio-card-body {
  padding: 24px;
}

.portfolio-card-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portfolio-tag {
  padding: 4px 12px;
  background: var(--color-bg);
  border-radius: 980px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* --- 博客 --- */
.blog-list {
  max-width: 720px;
  margin: 0 auto;
}

.blog-post {
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.blog-post:first-child {
  padding-top: 0;
}

.blog-post:last-child {
  border-bottom: none;
}

.blog-post:hover {
  padding-left: 8px;
}

.blog-post-date {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-bottom: 6px;
}

.blog-post-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-primary);
}

.blog-post-title a {
  color: inherit;
}

.blog-post-title a:hover {
  color: var(--color-accent);
}

.blog-post-excerpt {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* --- 博客文章页 --- */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 20px;
}

.article-header {
  margin-bottom: 48px;
  text-align: center;
}

.article-meta {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.article-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.15;
}

.article-content h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 40px 0 16px;
  letter-spacing: -0.2px;
}

.article-content h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 12px;
}

.article-content p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-text-primary);
  margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-content li {
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.article-content {
  font-family: var(--font-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 24px auto;
  display: block;
}
.article-content pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #1d1d1f;
  color: #f5f5f7;
  padding: 20px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  margin: 24px 0;
  max-width: 100%;
}
.article-content pre code {
  background: none;
  padding: 0;
  font-size: 14px;
  color: inherit;
  white-space: pre;
  font-family: var(--font-mono);
}
.article-content code {
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--font-mono);
}
.article-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(0,113,227,0.06);
  border-radius: 0 8px 8px 0;
  color: var(--color-text-secondary);
}
.article-content blockquote p {
  margin-bottom: 0;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  overflow-x: auto;
  display: block;
  font-size: 15px;
}
.article-content table th,
.article-content table td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  text-align: left;
}
.article-content table th {
  background: var(--color-bg);
  font-weight: 600;
}
.article-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

/* --- 党团建设页面 --- */
.party-hero {
  background: linear-gradient(135deg, #DE1E26 0%, #B80000 100%);
  color: var(--color-white);
  padding: 80px 0;
  text-align: center;
}

.party-hero .section-title {
  color: var(--color-white);
}

.party-hero .section-desc {
  color: rgba(255, 255, 255, 0.85);
}

.emblem-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  margin-bottom: 32px;
}

.emblem-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.emblem-item svg,
.emblem-item img {
  width: 80px;
  height: 80px;
}

.emblem-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* --- 密码模态框 --- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-box h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-box p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-primary);
  outline: none;
  transition: var(--transition);
  margin-bottom: 16px;
}

.modal-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

.modal-error {
  font-size: 13px;
  color: var(--color-red);
  margin-top: -8px;
  margin-bottom: 16px;
  display: none;
}

.modal-error.active {
  display: block;
}

/* --- 联系/底部 --- */
.footer {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding: 60px 0 40px;
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.footer-col p,
.footer-col a {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

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

.footer-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding: 20px 20px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* --- 文章图片占位 --- */
.article-image {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 24px 0;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--color-text-tertiary);
  font-size: 14px;
}

/* --- 页面头部横幅 --- */
.page-banner {
  background: var(--color-white);
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.page-banner h1 {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.page-banner p {
  font-size: 18px;
  color: var(--color-text-secondary);
}

/* --- 动画 --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .navbar-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(20px);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
  }

  .navbar-links.open {
    display: flex;
  }

  .navbar-links a {
    font-size: 15px;
    padding: 8px 0;
  }

  .navbar-toggle {
    display: block;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-desc {
    font-size: 18px;
  }

  .section-title {
    font-size: 30px;
  }

  .section {
    padding: 60px 0;
  }

  .resume-info {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .resume-info dt {
    margin-top: 8px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .emblem-row {
    gap: 24px;
  }

  .emblem-item svg,
  .emblem-item img {
    width: 60px;
    height: 60px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .article-title {
    font-size: 28px;
  }

  .article-content p {
    font-size: 16px;
  }
  .article-content h2 {
    font-size: 24px;
  }
  .article-content h3 {
    font-size: 19px;
  }
  .article-content pre {
    font-size: 13px;
    padding: 16px;
  }

  .page-banner h1 {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }

  .hero-desc {
    font-size: 16px;
  }

  .btn {
    padding: 10px 22px;
    font-size: 14px;
  }

  .section-title {
    font-size: 26px;
  }

  .quick-nav {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   获奖卡片 + 语言切换 + 响应式增强
   ============================================ */

.award-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 28px;
}

.award-card:last-child {
  margin-bottom: 0;
}

.award-image {
  width: 200px;
  height: 140px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #e8e8ed, #d2d2d7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--color-text-tertiary);
}

.award-body {
  flex: 1;
}

.award-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-primary);
}

.award-org {
  font-size: 14px;
  color: var(--color-accent);
  margin-bottom: 6px;
  font-weight: 500;
}

.award-date {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

/* 语言切换 */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.lang-item {
  color: var(--color-text-tertiary);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.lang-item.active {
  color: var(--color-text-primary);
  font-weight: 600;
}

.lang-item:hover {
  color: var(--color-text-primary);
}

.lang-sep {
  color: var(--color-border);
  font-size: 12px;
}

/* Flash 消息 */
.flash-container {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  max-width: 480px;
  width: 90%;
}

.flash {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: center;
  margin-bottom: 8px;
  box-shadow: var(--shadow-md);
  animation: flashIn 0.3s ease;
}

@keyframes flashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.flash-error {
  background: #fbe9e7;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* 党团 Tab 切换 */
.party-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

/* ============================================
   响应式增强 - 平板
   ============================================ */

@media (min-width: 481px) and (max-width: 768px) {
  .hero-title {
    font-size: 42px;
  }

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

  .award-card {
    grid-template-columns: 160px 1fr;
    gap: 20px;
  }

  .award-image {
    width: 160px;
    height: 120px;
  }

  .emblem-item svg,
  .emblem-item img {
    width: 70px;
    height: 70px;
  }
}

/* ============================================
   响应式增强 - 手机
   ============================================ */

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }

  .hero-desc {
    font-size: 16px;
  }

  .btn {
    padding: 10px 22px;
    font-size: 14px;
  }

  .section-title {
    font-size: 26px;
  }

  .quick-nav {
    grid-template-columns: 1fr;
  }

  .award-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .award-image {
    width: 100%;
    height: 180px;
  }

  .navbar-links a {
    font-size: 15px;
    padding: 10px 0;
  }

  .lang-switch {
    font-size: 12px;
  }
}

/* 触摸友好 */
@media (pointer: coarse) {
  .navbar-links a,
  .btn,
  .nav-card {
    min-height: 44px;
  }
}

/* ============================================
   暗色模式
   ============================================ */

[data-theme="dark"] {
  --color-bg: #1d1d1f;
  --color-white: #2d2d2f;
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #a1a1a6;
  --color-text-tertiary: #6e6e73;
  --color-border: #424245;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .navbar {
  background: rgba(29, 29, 31, 0.8);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .navbar-links a:hover,
[data-theme="dark"] .navbar-links a.active {
  color: var(--color-text-primary);
}

[data-theme="dark"] .card,
[data-theme="dark"] .nav-card,
[data-theme="dark"] .portfolio-card,
[data-theme="dark"] .award-card {
  background: var(--color-white);
}

[data-theme="dark"] .footer {
  background: var(--color-white);
  border-top-color: var(--color-border);
}

[data-theme="dark"] .page-banner {
  background: var(--color-white);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .modal-box {
  background: var(--color-white);
}

[data-theme="dark"] .modal-input {
  background: var(--color-bg);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

[data-theme="dark"] .flash-success {
  background: #1b3d1f;
  color: #a5d6a7;
  border-color: #2e7d32;
}

[data-theme="dark"] .flash-error {
  background: #3d1b1b;
  color: #ef9a9a;
  border-color: #c62828;
}

[data-theme="dark"] .dark-toggle .dark-icon {
  display: none;
}
[data-theme="dark"] .dark-toggle .light-icon {
  display: block !important;
}

/* ============================================
   暗色切换按钮
   ============================================ */

.dark-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  transition: var(--transition);
  border-radius: 50%;
}

.dark-toggle:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .dark-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   通知角标
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 980px;
  position: absolute;
  top: -6px;
  right: -10px;
  line-height: 1;
}

.navbar-links li {
  position: relative;
}

/* ============================================
   用户菜单
   ============================================ */

.user-menu {
  position: relative;
}

.user-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: var(--transition);
}

.user-menu-btn:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-menu-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 140px;
  padding: 4px 0;
  z-index: 1001;
  border: 1px solid var(--color-border);
}

.user-menu-dropdown.open {
  display: block;
}

.user-menu-dropdown a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.user-menu-dropdown a:hover {
  background: var(--color-bg);
  color: var(--color-accent);
}

/* ============================================
   认证链接
   ============================================ */

.auth-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   头像样式
   ============================================ */

.avatar-large {
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .stat-card {
  background: var(--color-white);
  color: var(--color-text-primary);
}

[data-theme="dark"] .stat-card .num {
  color: var(--color-accent);
}

/* 响应式 - 手机端导航用户菜单 */
@media (max-width: 768px) {
  .user-menu {
    width: 100%;
  }

  .user-menu-btn {
    width: 100%;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 15px;
  }

  .user-menu-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 16px;
  }

  .user-menu-dropdown a {
    padding: 10px 0;
  }

  .auth-links {
    width: 100%;
    padding: 8px 0;
  }

  .dark-toggle {
    display: none;
  }
}
