/* ==================== 暖橙二次元 · 个人博客 ==================== */
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  background: #FFF8F0;
  color: #3D2B1F;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ==================== 导航栏 ==================== */
.navbar {
  background: linear-gradient(135deg, #FF8C42 0%, #FFB074 100%);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(255,140,66,0.2);
}
.navbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.navbar .logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.navbar .logo span { color: rgba(255,255,255,0.7); font-weight: 400; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 6px 14px;
  border-radius: 20px;
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all .2s;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.2); color: #fff; }

/* ==================== 容器 ==================== */
.container { max-width: 1000px; margin: 0 auto; padding: 24px 20px; }

/* ==================== 首页 Hero ==================== */
.hero {
  text-align: center;
  padding: 50px 20px 40px;
  position: relative;
}
.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.hero p {
  color: rgba(61,43,31,0.5);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}
.hero .hero-sticker {
  font-size: 4rem;
  margin-bottom: 10px;
  display: block;
}

/* ==================== 分类入口 ==================== */
.cat-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.cat-card {
  flex: 1;
  min-width: 150px;
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  border: 2px solid transparent;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 25px rgba(255,140,66,0.15); }
.cat-card.active { border-color: #FF8C42; box-shadow: 0 4px 20px rgba(255,140,66,0.12); }
.cat-card .cc-icon { font-size: 2rem; margin-bottom: 6px; }
.cat-card .cc-name { font-size: 0.95rem; font-weight: 600; color: #3D2B1F; }
.cat-card .cc-count { font-size: 0.78rem; color: rgba(61,43,31,0.35); margin-top: 2px; }
.cat-game { background: #FFF0E6; }
.cat-software { background: #E8F4FD; }
.cat-problem { background: #F0E6FF; }

/* ==================== 文章卡片 ==================== */
.article-grid { display: flex; flex-direction: column; gap: 16px; }

.article-card {
  display: flex;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: all .25s;
  cursor: pointer;
  border: 1px solid rgba(255,140,66,0.06);
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(255,140,66,0.1); }
.article-card .ac-cover {
  width: 220px;
  min-height: 140px;
  flex-shrink: 0;
  object-fit: cover;
  background: #F5E6D8;
}
.article-card .ac-body { padding: 16px 20px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.article-card .ac-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.article-card .ac-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-game { background: #FFF0E6; color: #D46A20; }
.badge-software { background: #E8F4FD; color: #2B7AB3; }
.badge-problem { background: #F0E6FF; color: #7B52B3; }
.article-card .ac-date { font-size: 0.75rem; color: rgba(61,43,31,0.3); }
.article-card .ac-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #2A1A0E;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .ac-summary {
  font-size: 0.85rem;
  color: rgba(61,43,31,0.5);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .ac-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.article-card .ac-tag {
  font-size: 0.72rem;
  color: rgba(61,43,31,0.35);
  background: rgba(255,140,66,0.06);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ==================== 文章详情页 ==================== */
.article-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}
.article-page .ap-header { margin-bottom: 24px; }
.article-page .ap-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #2A1A0E;
  line-height: 1.3;
  margin-bottom: 8px;
}
.article-page .ap-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: rgba(61,43,31,0.4);
}
.article-page .ap-cover {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 24px;
  background: #F5E6D8;
}
.article-page .ap-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #3D2B1F;
}
.article-page .ap-content p { margin-bottom: 16px; }
.article-page .ap-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 16px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.article-page .ap-content h2, .article-page .ap-content h3 {
  color: #2A1A0E;
  margin-top: 28px;
  margin-bottom: 12px;
}
.article-page .ap-content h2 { font-size: 1.3rem; }
.article-page .ap-content h3 { font-size: 1.1rem; }
.article-page .ap-content pre {
  background: #2A1A0E;
  color: #FFD7B5;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 16px 0;
  line-height: 1.5;
}
.article-page .ap-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
}
.article-page .ap-content ul, .article-page .ap-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.article-page .ap-content li { margin-bottom: 6px; }
.article-page .ap-content blockquote {
  border-left: 4px solid #FF8C42;
  padding: 12px 16px;
  margin: 16px 0;
  background: rgba(255,140,66,0.04);
  border-radius: 0 8px 8px 0;
  color: rgba(61,43,31,0.6);
}
.article-page .ap-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,140,66,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.article-page .ap-back {
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(255,140,66,0.08);
  color: #FF8C42;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background .2s;
}
.article-page .ap-back:hover { background: rgba(255,140,66,0.15); }

/* ==================== 加载 & 空状态 ==================== */
.loading, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(61,43,31,0.25);
}
.loading .spinner {
  display: inline-block;
  width: 28px; height: 28px;
  border: 2px solid rgba(255,140,66,0.1);
  border-top-color: #FF8C42;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state .ei { font-size: 3rem; margin-bottom: 10px; }

/* ==================== Toast ==================== */
.toast-c {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  padding: 10px 24px; border-radius: 10px; font-size: 0.85rem;
  background: #FF8C42; color: #fff; box-shadow: 0 4px 20px rgba(255,140,66,0.3);
  animation: toastIn .25s ease-out;
}
.toast.err { background: #E05050; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
  .navbar-inner { height: 48px; }
  .navbar .logo { font-size: 1rem; }
  .nav-links a { padding: 4px 10px; font-size: 0.8rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero .hero-sticker { font-size: 3rem; }
  .cat-cards { flex-direction: column; }
  .cat-card { min-width: auto; padding: 14px; display: flex; align-items: center; gap: 12px; text-align: left; }
  .cat-card .cc-icon { font-size: 1.5rem; margin-bottom: 0; }
  .article-card { flex-direction: column; }
  .article-card .ac-cover { width: 100%; height: 180px; }
  .article-page .ap-title { font-size: 1.3rem; }
}
