/* 土豆星球收藏馆 - 得物技术风格 */

/* ==================== 基础样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #FF4D4D;
  --primary-light: #FF6B6B;
  --primary-dark: #E63939;
  --bg-white: #FFFFFF;
  --bg-gray: #F5F5F5;
  --bg-light: #FAFAFA;
  --text-dark: #1A1A1A;
  --text-gray: #666666;
  --text-light: #999999;
  --border: #EEEEEE;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-gray);
  color: var(--text-dark);
  line-height: 1.6;
}

/* ==================== 头部导航 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-nav {
  display: flex;
  gap: 32px;
}

.nav-item {
  color: var(--text-gray);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
  position: relative;
  transition: color 0.2s;
}

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

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

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* ==================== Banner 区域 ==================== */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #FF8C42 100%);
  padding: 60px 24px;
  text-align: center;
  color: white;
}

.hero-content h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-content p {
  font-size: 16px;
  opacity: 0.9;
}

/* ==================== 主体内容 ==================== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
}

/* ==================== 区块标题 ==================== */
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

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

.article-card {
  background: var(--bg-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.article-card.expanded {
  transform: none;
}

.article-cover {
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.article-cover-bg {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-icon {
  font-size: 48px;
  opacity: 0.8;
}

.article-body {
  padding: 20px;
}

.article-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.4;
}

.article-desc {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.7;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-light);
}

.article-tag {
  background: #FFF5F5;
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.article-date {
  font-size: 12px;
}

/* 文章展开内容 */
.article-full {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.article-content-wrapper {
  max-height: 500px;
  overflow-y: auto;
  padding-top: 20px;
}

.article-content-wrapper::-webkit-scrollbar {
  width: 6px;
}

.article-content-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.dev-article h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin: 20px 0 10px 0;
}

.dev-article h4:first-child {
  margin-top: 0;
}

.dev-article p {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.8;
  margin-bottom: 12px;
}

.dev-article ul, .dev-article ol {
  margin: 10px 0 15px 20px;
  font-size: 14px;
  color: var(--text-gray);
}

.dev-article li {
  line-height: 1.8;
  margin-bottom: 4px;
}

.dev-article li strong {
  color: var(--text-dark);
}

/* ==================== 认证区域 ==================== */
.auth-section {
  position: sticky;
  top: 80px;
  align-self: start;
}

.auth-card, .welcome-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.auth-icon, .welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.auth-card h3, .welcome-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.auth-card p, .welcome-card p {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  background: var(--bg-gray);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.1);
}

.auth-form input.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.error-msg {
  color: var(--primary);
  font-size: 13px;
  display: none;
  margin-top: 8px;
}

/* 欢迎卡片 */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-gray);
}

.stats-row strong {
  color: var(--primary);
  font-size: 18px;
}

.btn-enter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, #FF8C42 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 77, 77, 0.35);
}

/* ==================== 分类模态框 ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.category-modal {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.btn-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-gray);
  color: var(--text-gray);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-close:hover {
  background: var(--border);
}

.category-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-gray);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.category-btn:hover {
  background: var(--bg-white);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(255, 77, 77, 0.1);
}

.category-btn .btn-icon {
  font-size: 32px;
}

.category-btn .btn-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  flex: 1;
}

.category-btn .btn-desc {
  font-size: 13px;
  color: var(--text-light);
}

/* ==================== 页脚 ==================== */
.site-footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  margin-top: 60px;
  text-align: center;
}

.footer-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 16px;
}

.footer-links {
  font-size: 13px;
}

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

/* ==================== 响应式 ==================== */
@media (max-width: 900px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .auth-section {
    position: static;
  }
}

@media (max-width: 600px) {
  .header-container {
    padding: 0 16px;
  }

  .main-nav {
    gap: 20px;
  }

  .nav-item {
    font-size: 13px;
  }

  .hero-banner {
    padding: 40px 16px;
  }

  .hero-content h1 {
    font-size: 24px;
  }

  .main-content {
    padding: 24px 16px;
  }

  .article-cover {
    height: 140px;
  }

  .article-body {
    padding: 16px;
  }

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

  .auth-card, .welcome-card {
    padding: 24px;
  }
}