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

body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.7;
}

a { text-decoration: none; color: #4a6cf7; transition: color 0.3s; }
a:hover { color: #2541b2; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ========== Header ========== */
header {
  background: #1a1a2e;
  color: #fff;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo { font-size: 22px; font-weight: 700; letter-spacing: 1px; }

nav a {
  color: #aaa;
  margin-left: 24px;
  font-size: 15px;
  transition: color 0.3s;
  position: relative;
}

nav a:hover, nav a.active { color: #fff; }
nav a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #4a6cf7;
  border-radius: 1px;
}

/* ========== Page Transition ========== */
main {
  min-height: 60vh;
  position: relative;
}

.page-enter {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
}

.page-exit {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.page-exit { opacity: 0; transform: translateY(-20px); }

/* ========== Hero ========== */
.hero {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 70px 40px;
  border-radius: 12px;
  text-align: center;
  margin: 30px 0;
  box-shadow: 0 8px 30px rgba(102,126,234,0.3);
}

.hero h2 { font-size: 30px; margin-bottom: 15px; }

.hero p {
  font-size: 17px;
  opacity: 0.92;
  margin-bottom: 28px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  background: #fff;
  color: #764ba2;
  padding: 12px 32px;
  border-radius: 30px;
  font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn:hover { transform: translateY(-3px); box-shadow: 0 5px 20px rgba(0,0,0,0.2); }

/* ========== Section ========== */
.section { margin: 40px 0; }

.section h3 {
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e0e0;
}

.page-header { margin: 30px 0 25px; }

.page-header h2 { font-size: 26px; }

.subtitle { color: #888; margin-top: 5px; }

/* ========== Cards ========== */
.card-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: #fff;
  padding: 22px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-cover {
  font-size: 36px;
  margin-bottom: 12px;
}

.card h4 a { color: #333; font-size: 16px; }
.card p { font-size: 14px; color: #666; margin: 8px 0; }

.card-meta, .note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ========== Note Grid ========== */
.note-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 10px;
}

.note-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.note-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.note-cover {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 42px;
  text-align: center;
  padding: 25px 0;
}

.note-card-body { padding: 18px 22px; }

.note-card-body h3 a { color: #222; font-size: 17px; }
.note-card-body p { font-size: 14px; color: #666; margin: 8px 0; }

.tag {
  display: inline-block;
  background: #eef2ff;
  color: #4a6cf7;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
}

/* ========== Note List ========== */
.note-list { margin-top: 10px; }

.note-item {
  background: #fff;
  padding: 22px 25px;
  margin-bottom: 14px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.note-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.1);
}

.note-item h3 a { color: #222; font-size: 18px; }
.note-item > p { color: #666; margin: 6px 0; }

.date { color: #999; font-size: 13px; }

/* ========== Note Detail ========== */
.back {
  display: inline-block;
  margin-bottom: 15px;
  font-size: 14px;
}

.note-content {
  background: #fff;
  padding: 35px 40px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.note-header h2 { font-size: 26px; margin-bottom: 10px; }

.note-header hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 20px 0;
}

/* ========== Markdown 样式 ========== */
.markdown-body h2 { font-size: 22px; margin: 25px 0 12px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.markdown-body h3 { font-size: 18px; margin: 20px 0 10px; }
.markdown-body h4 { font-size: 16px; margin: 15px 0 8px; }
.markdown-body p { margin: 12px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; margin: 12px 0; }
.markdown-body li { margin: 6px 0; }
.markdown-body code {
  background: #f4f4f4;
  color: #e83e8c;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "Fira Code", Consolas, Monaco, monospace;
}
.markdown-body pre {
  background: #282c34;
  border-radius: 8px;
  padding: 18px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.5;
}
.markdown-body pre code {
  background: none;
  color: #abb2bf;
  padding: 0;
  font-size: 14px;
}
.markdown-body blockquote {
  border-left: 4px solid #4a6cf7;
  background: #f0f4ff;
  padding: 10px 16px;
  margin: 16px 0;
  border-radius: 0 6px 6px 0;
  color: #555;
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.markdown-body th, .markdown-body td {
  border: 1px solid #e0e0e0;
  padding: 8px 12px;
  text-align: left;
}
.markdown-body th { background: #f8f9fa; font-weight: 600; }
.markdown-body hr { border: none; border-top: 1px solid #eee; margin: 24px 0; }
.markdown-body strong { color: #222; }

/* ========== Tutorials ========== */
.tutorial-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 15px;
}

.tutorial-card {
  background: #fff;
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tutorial-card h4 { font-size: 15px; margin-bottom: 10px; }
.tutorial-card ul { list-style: none; padding: 0; }
.tutorial-card li { padding: 4px 0; font-size: 14px; }

.tutorial-category { margin: 30px 0; }
.tutorial-category > h3 {
  font-size: 18px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tutorial-item {
  background: #fff;
  padding: 18px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tutorial-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.tutorial-item h4 a { color: #222; font-size: 16px; }
.tutorial-item p { font-size: 13px; color: #666; margin: 6px 0; }

/* ========== About ========== */
.about-list { padding-left: 24px; margin: 12px 0; }
.about-list li { margin: 6px 0; }

.about-notes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.about-note-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.about-note-item:hover {
  transform: translateX(3px);
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.about-note-cover { font-size: 24px; flex-shrink: 0; }
.about-note-item a { font-size: 14px; }
.about-note-item p { font-size: 13px; color: #888; margin: 2px 0; }

/* ========== Footer ========== */
footer {
  background: #1a1a2e;
  color: #ccc;
  text-align: center;
  padding: 25px 0;
  margin-top: 60px;
}

footer .container p { font-size: 14px; margin: 4px 0; }

footer .icp a {
  color: #999;
  font-size: 13px;
  transition: color 0.3s;
}

footer .icp a:hover { color: #fff; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .card-list, .tutorial-preview, .note-grid, .about-notes { grid-template-columns: 1fr; }
  .tutorial-grid { grid-template-columns: 1fr; }
  nav a { margin-left: 12px; font-size: 14px; }
  .logo { font-size: 18px; }
  .hero { padding: 40px 20px; }
  .hero h2 { font-size: 22px; }
  .note-content { padding: 20px; }
}
