/* ===== HIT Design System v2.1 —— 含导航栏主题按钮 ===== */
:root {
  --hit-blue: #005375;
  --hit-blue-light: #e6f0fa;
  --hit-gray: #4a5568;
  --hit-gray-light: #a0aec0;
  --hit-white: #ffffff;
  --hit-bg: #fffbfb;
  --hit-card: #ffffff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-serif: "Songti SC", "SimSun", serif;
  --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

[data-theme="dark"] {
  --hit-bg: #0f172a;
  --hit-card: #1e293b;
  --hit-blue: #38bdf8;
  --hit-blue-light: #0f172a;
  --hit-gray: #cbd5e1;
  --hit-gray-light: #64748b;
  --hit-white: #0f172a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--hit-bg);
  color: var(--hit-gray);
  font-family: var(--font-sans);
  line-height: 1.6;
  transition: var(--transition);
}

/* 卡片样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* 卡片过渡动画 */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* ===== 导航栏 ===== */
.main-nav {
  background: var(--hit-card);
  border-bottom: 1px solid var(--hit-blue-light);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.5rem;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.main-nav a {
  color: var(--hit-gray);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
  transition: var(--transition);
}

.main-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--hit-blue);
  transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--hit-blue);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

/* 主题切换按钮 */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: background 0.3s ease;
}

.theme-toggle:hover {
  background: var(--hit-blue-light);
  border-radius: 50%;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: var(--hit-gray);
  transition: opacity 0.3s ease;
}

[data-theme="light"] .sun-icon {
  opacity: 1;
}

[data-theme="light"] .moon-icon {
  opacity: 0;
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
}

/* 汉堡菜单（默认隐藏） */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  width: 28px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--hit-gray);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--hit-card);
  border-bottom: 1px solid var(--hit-blue-light);
  z-index: 90;
  padding: 0.75rem 0;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.06);
}

.mobile-menu a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: var(--hit-gray);
  text-decoration: none;
  font-size: 1rem;
  transition: var(--transition);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  background: var(--hit-blue-light);
  color: var(--hit-blue);
}

.mobile-menu.open {
  display: block;
}

/* ===== 标题区 ===== */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, var(--hit-blue) 0%, #002244 100%);
  color: white;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.highlight {
  color: #60a5fa;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 1rem 0 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}


/* ===== 通用区块 ===== */
.section {
  padding: 2rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--hit-blue);
  font-size: 1.75rem;
}

/* ===== 卡片系统 ===== */
.card {
  background: var(--hit-card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 6px 18px rgba(0, 51, 102, 0.06);
  transition: var(--transition);
  border: 1px solid var(--hit-blue-light);
  margin-bottom: 2rem;
}

.card h2,
.card h3 {
  color: var(--hit-blue);
  margin-top: 0;
}

.card ul {
  padding-left: 1.25rem;
}

.card li {
  margin-bottom: 0.75rem;
}

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

.heart {
  color: #e53e3e;
}

/* ===== 主页专属 ===== */
/* 个人简介 */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* 实践项目 */
.projects {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.project-card {
  background: var(--hit-card);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.05);
  border: 1px solid var(--hit-blue-light);
}

.project-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--hit-blue);
  text-decoration: none;
  font-weight: 500;
}

.project-link:hover {
  text-decoration: underline;
}

/* 英文摘录 */
/* 句子样式 */
.sentence {
  font-family: var(--font-serif);
  color: var(--hit-gray);
  margin: 0.5rem 0;
}

.excerpt-author {
  text-align: right;
  font-size: 0.8rem;
  color: var(--hit-gray-light);
  margin-top: 0.25rem;
}

/* ===== 页脚 ===== */
.footer {
  background: var(--hit-blue-light);
  border-top: 1px solid var(--hit-blue-light);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
}

.hit-links h3 {
  color: var(--hit-blue);
  margin-bottom: 1rem;
  font-size: 1.25rem;
  text-align: center;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.links-grid a {
  display: block;
  padding: 0.5rem;
  color: var(--hit-gray-light);
  text-decoration: none;
  border-radius: 4px;
  transition: var(--transition);
  text-align: center;
}

.links-grid a:hover {
  background: var(--hit-blue-light);
  color: var(--hit-blue);
}

.hitu-slogan {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--hit-blue);
  text-align: center;
  margin: 1.5rem 0;
  font-weight: 600;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.social-links a {
  font-size: 1.4rem;
  color: var(--hit-gray);
  text-decoration: none;
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--hit-blue);
  transform: scale(1.2);
}

.footer p:last-of-type {
  font-size: 0.875rem;
  opacity: 0.7;
  text-align: center;
  margin-top: 0
}

/* ===== 笔记列表：一行布局（标题 + 元信息） ===== */
.note-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.note-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 8px;
  text-decoration: none !important;
  color: inherit;
  background: var(--hit-card);
  transition: background-color 0.2s ease;
  border: 1px solid var(--hit-blue-light);
  /* 确保 a 标签能包裹块级元素 */
  width: 100%;
}

.note-item:hover {
  background-color: var(--hit-blue-light);
}

.note-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--hit-blue);
  flex: 1;
  min-width: 0;
  word-break: break-word;
  /* 关键：移除链接下划线 */
  text-decoration: none !important;
}

.note-meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.7rem;
  color: var(--hit-gray);
  white-space: nowrap;
  /* 关键：防止被继承下划线 */
  text-decoration: none !important;
}

/* 小屏优化：堆叠显示 */
@media (max-width: 600px) {
  .note-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .note-meta {
    align-self: stretch;
    justify-content: space-between;
    width: 100%;
  }
}


/* 笔记详情页 */
.time-label {
  font-size: 0.8rem;
  color: var(--hit-gray-light);
  margin-right: 1rem;
}

.article-label {
  font-size: 0.8rem;
  color: var(--hit-gray-light);
}

/* ===== 网址聚合页特有样式 ===== */

/* 搜索框样式 */
.search-section {
  background: var(--hit-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 6px 18px rgba(0, 51, 102, 0.06);
  border: 1px solid var(--hit-blue-light);
  margin: 2rem auto;
  max-width: 600px;
}

.search-input {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--hit-blue-light);
  border-radius: 8px;
  font-size: 16px;
  background: var(--hit-bg);
  color: var(--hit-gray);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--hit-blue);
  box-shadow: 0 0 0 3px rgba(0, 83, 117, 0.1);
}

/* 分类卡片样式 */
.category {
  margin-bottom: 2rem;
}

.category-title {
  color: var(--hit-blue);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--hit-blue-light);
}

/* 网址网格布局 */
.link-card {
  background: var(--hit-card);
  border: 1px solid var(--hit-blue-light);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--hit-gray);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 51, 102, 0.15);
  border-color: var(--hit-blue);
  color: var(--hit-blue);
}

.link-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--hit-blue);
}

.link-desc {
  font-size: 0.9rem;
  color: var(--hit-gray-light);
  flex-grow: 1;
}

/* 国内外标识样式 */
.country-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

.domestic {
  background-color: #e6f0fa;
  color: #005375;
}

.foreign {
  background-color: #fff0f0;
  color: #c53030;
}

/* 新增：让链接卡片占据更多空间 */
.links-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  width: 100%;
}

@media (max-width: 768px) {
  .links-container {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

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

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

@media (max-width: 480px) {
  .links-container {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 1rem;
  }

  .main-nav {
    padding: 0.6rem 1rem;
  }

  .nav-left,
  .nav-right {
    gap: 1rem;
  }

  .main-nav-links {
    gap: 1rem;
  }
}