:root {
  --gg-primary: #009688;
  --gg-primary-dark: #00796B;
  --gg-primary-light: #B2DFDB;
  --gg-secondary: #3D5C8A;
  --gg-secondary-dark: #2E4466;
  --gg-accent: #FF5722;
  --gg-bg: #F5F7FA;
  --gg-surface: #FFFFFF;
  --gg-text: #2C3E50;
  --gg-text-light: #7F8C8D;
  --gg-border: #E8ECF0;
  --gg-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --gg-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --header-height: 64px;
}

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== Site Header ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gg-border);
  height: var(--header-height);
}

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

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gg-text);
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

.nav-link {
  text-decoration: none;
  color: var(--gg-text-light);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-link-primary {
  background: var(--gg-primary);
  color: #FFFFFF;
  padding: 8px 20px;
  border-radius: 20px;
}

.nav-link-primary:hover {
  background: var(--gg-primary-dark);
  color: #FFFFFF;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ==================== Hero Section ==================== */
.hero {
  padding: 40px 0 50px;
  text-align: center;
  background: linear-gradient(135deg, var(--gg-primary) 0%, var(--gg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 450px;
  height: 450px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.logo-wrapper {
  margin-bottom: 18px;
}

.logo-wrapper img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.logo-wrapper img:hover {
  transform: scale(1.05);
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.hero .tagline {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0;
  font-weight: 300;
}

.hero .subtitle {
  display: none;
}

/* ==================== CTA Section ==================== */
.cta-section {
  padding: -30px 0 40px;
  position: relative;
  z-index: 2;
}

.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.cta-card {
  background: var(--gg-surface);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--gg-shadow-lg);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--gg-border);
}

.cta-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.cta-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: transform 0.3s ease;
}

.cta-card:hover .cta-card-icon {
  transform: scale(1.08);
}

.cta-card-icon.chat {
  background: linear-gradient(135deg, var(--gg-primary) 0%, #00BCD4 100%);
}

.cta-card-icon.manual {
  background: linear-gradient(135deg, var(--gg-secondary) 0%, #607D8B 100%);
}

.cta-card-icon.sample {
  background: linear-gradient(135deg, #FF9800 0%, #F44336 100%);
}

.cta-card-icon svg {
  width: 30px;
  height: 30px;
  fill: #FFFFFF;
}

.cta-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gg-text);
}

.cta-card p {
  font-size: 14px;
  color: var(--gg-text-light);
  margin-bottom: 20px;
  line-height: 1.6;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.cta-btn-primary {
  background: linear-gradient(135deg, var(--gg-primary) 0%, var(--gg-primary-dark) 100%);
  color: #FFFFFF;
}

.cta-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 150, 136, 0.4);
}

.cta-btn-secondary {
  background: linear-gradient(135deg, var(--gg-secondary) 0%, var(--gg-secondary-dark) 100%);
  color: #FFFFFF;
}

.cta-btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(61, 92, 138, 0.4);
}

.cta-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ==================== Features Section ==================== */
.features {
  padding: 40px 0;
  background: var(--gg-surface);
}

.features h2 {
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
  color: var(--gg-text);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.feature-card {
  text-align: center;
  padding: 24px 16px;
  border-radius: 12px;
  background: var(--gg-bg);
  transition: all 0.3s ease;
}

.feature-card:hover {
  background: var(--gg-surface);
  box-shadow: var(--gg-shadow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.feature-icon.ai {
  background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
}

.feature-icon.interactive {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.feature-icon.export {
  background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  fill: #FFFFFF;
}

.feature-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gg-text);
}

.feature-card p {
  font-size: 13px;
  color: var(--gg-text-light);
  line-height: 1.5;
}

/* ==================== Hero Section ==================== */
.hero {
  padding: 80px 0 100px;
  text-align: center;
  background: linear-gradient(135deg, var(--gg-primary) 0%, var(--gg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 450px;
  height: 450px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  font-weight: 300;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ==================== Footer ==================== */
.site-footer {
  padding: 32px 0;
  background: var(--gg-text);
  color: rgba(255, 255, 255, 0.6);
}

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

.footer-left {
  font-size: 14px;
}

.footer-right {
  position: relative;
}

.language-selector {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lang-arrow {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  min-width: 120px;
  overflow: hidden;
}

.lang-option {
  display: block;
  padding: 10px 16px;
  color: var(--gg-text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.lang-option:hover {
  background: var(--gg-bg);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .hero {
    padding: 30px 0 40px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero .tagline {
    font-size: 15px;
    margin-bottom: 0;
  }

  .logo-wrapper img {
    width: 65px;
    height: 65px;
  }

  .cta-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 16px;
  }

  .cta-card {
    padding: 24px 20px;
  }

  .cta-card-icon {
    width: 52px;
    height: 52px;
  }

  .cta-card-icon svg {
    width: 26px;
    height: 26px;
  }

  .cta-card h3 {
    font-size: 18px;
  }

  .features h2 {
    font-size: 22px;
    margin-bottom: 24px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .feature-card {
    padding: 20px 16px;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==================== Auth Pages ==================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-container {
  background: var(--gg-surface);
  border-radius: 16px;
  box-shadow: var(--gg-shadow-lg);
  padding: 48px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--gg-border);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--gg-text);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 15px;
  color: var(--gg-text-light);
}

.auth-form-group {
  margin-bottom: 20px;
}

.auth-form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--gg-text-light);
  font-size: 14px;
}

.auth-form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gg-border);
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--gg-bg);
}

.auth-form-group input:focus {
  outline: none;
  border-color: var(--gg-primary);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-btn-primary {
  background: linear-gradient(135deg, var(--gg-primary) 0%, var(--gg-primary-dark) 100%);
  color: #FFFFFF;
}

.auth-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 150, 136, 0.35);
}

.auth-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-error-message {
  color: #e74c3c;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.auth-success-message {
  color: #27ae60;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.auth-link-text {
  text-align: center;
  margin-top: 20px;
  color: var(--gg-text-light);
  font-size: 14px;
}

.auth-link-text a {
  color: var(--gg-primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-link-text a:hover {
  text-decoration: underline;
}

.auth-loading-spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #FFFFFF;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: auth-spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
}

@keyframes auth-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }

  .hero {
    padding: 24px 0 30px;
  }

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

  .hero .tagline {
    font-size: 14px;
  }

  .logo-wrapper img {
    width: 55px;
    height: 55px;
  }

  .cta-card {
    padding: 20px 16px;
  }

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

/* ==================== Profile Page ==================== */
.profile-page {
  min-height: 100vh;
  padding: 40px 24px;
  max-width: 800px;
  margin: 0 auto;
}

.profile-header {
  text-align: center;
  padding: 40px 0;
}

.profile-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  border: 4px solid var(--gg-primary);
}

.profile-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--gg-text);
  margin-bottom: 8px;
}

.profile-bio {
  color: var(--gg-text-light);
  font-size: 16px;
  line-height: 1.6;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--gg-border);
  border-bottom: 1px solid var(--gg-border);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gg-primary);
}

.stat-label {
  font-size: 14px;
  color: var(--gg-text-light);
  margin-top: 4px;
}

.profile-content {
  margin-top: 32px;
}

.content-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--gg-text);
  margin-bottom: 16px;
}

/* ==================== Gallery Page ==================== */
.gallery-page {
  padding: 40px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-header {
  text-align: center;
  margin-bottom: 40px;
}

.gallery-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--gg-text);
}

.gallery-subtitle {
  color: var(--gg-text-light);
  margin-top: 8px;
}

/* 标签页厚化引导文案（seo_plan A1⑤） */
.tag-lead {
  max-width: 640px;
  margin: 16px auto 0;
  color: var(--gg-text-light);
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
}

.gallery-search {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 20px auto 0;
}

.gallery-search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--gg-border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--gg-bg);
  color: var(--gg-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gallery-search-input:focus {
  outline: none;
  border-color: var(--gg-primary);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

.gallery-search-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: var(--gg-primary);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.gallery-search-btn:hover {
  opacity: 0.9;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.gallery-card {
  background: var(--gg-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--gg-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--gg-shadow-lg);
}

.card-image {
  height: 200px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gg-primary);
  font-size: 48px;
}

.card-content {
  padding: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gg-text);
  margin-bottom: 8px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  color: var(--gg-text-light);
  font-size: 14px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.page-btn {
  padding: 8px 16px;
  border: 1px solid var(--gg-border);
  border-radius: 8px;
  background: var(--gg-surface);
  color: var(--gg-text);
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--gg-primary);
  color: var(--gg-primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-btn.active {
  background: var(--gg-primary);
  color: white;
  border-color: var(--gg-primary);
}

/* ==================== Gallery Item Page ==================== */
.item-page {
  padding: 32px 24px 48px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.item-card {
  background: var(--gg-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--gg-shadow-lg);
}

.item-image {
  height: 400px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gg-primary);
  font-size: 96px;
}

.item-content {
  padding: 24px;
}

.item-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--gg-text);
  margin-bottom: 12px;
}

.item-meta {
  display: flex;
  gap: 16px;
  color: var(--gg-text-light);
  font-size: 14px;
  margin-bottom: 16px;
}

.item-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gg-primary);
  object-fit: cover;
}

.author-link {
  color: var(--gg-text-light);
  text-decoration: none;
}

.author-link:hover {
  color: var(--gg-primary);
}

.item-description {
  color: var(--gg-text-light);
  line-height: 1.6;
  margin-bottom: 24px;
}

.item-actions {
  display: flex;
  gap: 12px;
}

.action-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.action-btn-secondary {
  background: var(--gg-surface);
  color: var(--gg-text);
  border: 1px solid var(--gg-border);
}

.action-btn-danger {
  background: #ffebee;
  color: #c0392b;
  border: 1px solid #ffcdd2;
}

.action-btn-danger:hover {
  background: #ffcdd2;
}

/* 作品缩略图（base64） */
.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 详情页交互式 GeoGebra 容器 */
.item-applet {
  height: 440px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.item-applet #ggb-applet {
  width: 100%;
  height: 100%;
}

/* 社区范例详情页的 GeoGebra 画板（含看图/显示命令/复制命令控制栏） */
/* 含 .ggb-container-wrapper 时，放宽 .item-applet 的固定高度，避免裁掉控制栏与画板 */
.item-applet:has(.ggb-container-wrapper) {
  height: auto;
  overflow: visible;
  background: none;
  padding: 0;
}

.ggb-container-wrapper {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin: 0;
}
.ggb-header {
  padding: 6px 8px;
  background: var(--gg-bg-alt, #F7F9FA);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #e0e0e0;
  position: relative;
  z-index: 10;
}
.ggb-controls { display: flex; gap: 2px; background: #fff; padding: 2px; border-radius: 4px; }
.ggb-control-btn {
  padding: 4px 12px;
  font-size: 14px;
  border: none;
  background: transparent;
  color: #555;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
}
.ggb-control-btn:hover { background: #f0f0f0; color: #333; }
.ggb-control-btn.active { background: var(--gg-primary, #009688); color: #fff; }
.ggb-copy-btn {
  padding: 4px 14px;
  font-size: 13px;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #555;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.ggb-copy-btn:hover { border-color: var(--gg-primary, #009688); color: var(--gg-primary, #009688); }
.ggb-content { position: relative; width: 100%; height: 580px; }
.ggb-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #fff; }
.ggb-container > div { width: 100% !important; height: 100% !important; }
.ggb-commands-display {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 5; display: none; overflow: auto; background: #fff;
  border: 1px solid #000; box-sizing: border-box;
}
.ggb-commands-list { padding: 10px 14px; height: 100%; overflow-y: auto; }
.ggb-command-item { display: block; padding: 0; font-size: 12px; line-height: 1.4; white-space: pre-wrap; word-break: break-all; }
.ggb-command-item code {
  display: block; background: transparent; color: var(--gg-text, #0F1419);
  word-break: break-all; white-space: pre-wrap; font-weight: 400;
  font-family: "Courier New", Courier, "Lucida Console", Monaco, monospace;
}
@media (max-width: 480px) { .ggb-content { height: 440px; } }

/* 标签 */
.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.item-tags .tag {
  background: var(--gg-bg-alt, #f1f5f9);
  color: var(--gg-text-light, #5b6b7b);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.item-tags .tag:hover {
  background: var(--gg-primary, #2f6df6);
  color: #fff;
}

/* 所属专题（material 详情页反向内链，见 _doc/case_book.md） */
.item-books {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.item-books-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gg-text-light, #5b6b7b);
}
.book-chip {
  display: inline-flex;
  align-items: center;
  background: var(--gg-bg-alt, #f1f5f9);
  color: var(--gg-text, #1f2d3d);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.book-chip:hover {
  background: var(--gg-primary, #2f6df6);
  color: #fff;
  border-color: var(--gg-primary, #2f6df6);
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gg-text-light, #5b6b7b);
  margin-bottom: 12px;
}
.breadcrumb a {
  color: var(--gg-text-light, #5b6b7b);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--gg-primary, #2f6df6);
}
.breadcrumb .sep {
  color: var(--gg-border, #d8dee6);
}
.breadcrumb .current {
  color: var(--gg-text, #1f2a37);
  font-weight: 600;
}

/* 详情页分类链接 */
.item-category {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  background: var(--gg-bg-alt, #f1f5f9);
  color: var(--gg-text-light, #5b6b7b);
  font-size: 12px;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.item-category:hover {
  background: var(--gg-primary, #2f6df6);
  color: #fff;
}

/* 相关推荐 */
.related-block {
  max-width: var(--gg-content-max, 960px);
  margin: 32px auto 0;
  padding: 0 16px;
}
.related-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--gg-text, #1f2a37);
}
.related-block .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.related-block .gallery-card {
  display: block;
  border: 1px solid var(--gg-border, #d8dee6);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--gg-surface, #fff);
  transition: box-shadow .15s ease, transform .15s ease;
}
.related-block .gallery-card:hover {
  box-shadow: 0 6px 18px rgba(31, 42, 55, .12);
  transform: translateY(-2px);
}
.related-block .card-thumb {
  height: 120px;
  background-size: cover;
  background-position: center;
  background-color: var(--gg-bg-alt, #f1f5f9);
}
.related-block .card-body {
  padding: 10px 12px;
}
.related-block .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gg-text, #1f2a37);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.related-block .card-author {
  font-size: 12px;
  color: var(--gg-text-light, #5b6b7b);
  margin-top: 4px;
}

/* 打赏累计 */
.item-tip-total {
  color: var(--gg-text-light, #5b6b7b);
  font-size: 14px;
  margin-bottom: 20px;
}

.item-tip-total b {
  color: #c0392b;
}

/* 操作反馈 */
.item-msg {
  margin-top: 14px;
  font-size: 14px;
  min-height: 18px;
}

.item-msg--ok { color: #1E8449; }
.item-msg--err { color: #c0392b; }

/* ===== 打赏弹窗 ===== */
.tip-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.tip-modal-content {
  background: var(--gg-surface, #fff);
  border-radius: 12px;
  width: 360px;
  max-width: 92vw;
  overflow: hidden;
  box-shadow: var(--gg-shadow-lg, 0 10px 30px rgba(0,0,0,0.2));
}

.tip-balance {
  margin-bottom: 14px;
  color: var(--gg-text, #222);
  font-size: 14px;
}

.tip-amounts {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tip-amt {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--gg-border, #ddd);
  border-radius: 8px;
  background: var(--gg-surface, #fff);
  color: var(--gg-text, #222);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.tip-amt:hover {
  border-color: var(--gg-primary, #2e7d32);
  color: var(--gg-primary, #2e7d32);
}

.tip-msg {
  color: #c0392b;
  font-size: 13px;
  min-height: 16px;
  margin-top: 8px;
}


/* ==================== Material Page ==================== */
.material-page {
  min-height: 100vh;
  padding: 40px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.material-header {
  text-align: center;
  margin-bottom: 40px;
}

.material-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--gg-text);
}

.material-subtitle {
  color: var(--gg-text-light);
  margin-top: 8px;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.material-card {
  background: var(--gg-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--gg-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.material-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--gg-shadow-lg);
}

.card-thumbnail {
  height: 160px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1976d2;
  font-size: 36px;
}

.card-info {
  padding: 16px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  padding: 2px 8px;
  background: var(--gg-bg);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gg-text-light);
}

/* ==================== Material Item Page ==================== */
.sample-page {
  min-height: 100vh;
  padding: 40px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.sample-card {
  background: var(--gg-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--gg-shadow-lg);
}

.sample-header {
  padding: 24px;
  border-bottom: 1px solid var(--gg-border);
}

.sample-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--gg-text);
  margin-bottom: 8px;
}

.sample-meta {
  color: var(--gg-text-light);
  font-size: 14px;
}

.sample-content {
  padding: 24px;
}

.sample-thumbnail {
  height: 300px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1976d2;
  font-size: 64px;
  margin-bottom: 24px;
}

.sample-description {
  color: var(--gg-text-light);
  line-height: 1.6;
  margin-bottom: 24px;
}

.sample-actions {
  display: flex;
  gap: 12px;
}

/* ==================== Common ==================== */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  color: var(--gg-text-light);
  background: var(--gg-surface);
  border-radius: 12px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--gg-primary);
  text-decoration: none;
  font-weight: 500;
}

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

/* ==================== Account Page ==================== */
.account-page {
  min-height: 100vh;
  padding: 40px 24px;
}

.account-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--gg-surface);
  border-radius: 16px;
  box-shadow: var(--gg-shadow-lg);
  padding: 32px;
}

.account-header {
  margin-bottom: 24px;
}

.account-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--gg-text);
  margin-top: 8px;
}

.account-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gg-border);
}

.account-section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gg-text-light);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-form .auth-form-group {
  margin-bottom: 16px;
}

.account-form .auth-form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--gg-text-light);
  font-size: 14px;
  font-weight: 500;
}

.account-form .auth-form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gg-border);
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--gg-bg);
}

.account-form .auth-form-group input:focus {
  outline: none;
  border-color: var(--gg-primary);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

.account-form .auth-form-group input[readonly] {
  background: #f0f0f0;
  color: var(--gg-text-light);
  cursor: not-allowed;
}

.account-form .auth-form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gg-border);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--gg-bg);
  resize: vertical;
}

.account-form .auth-form-group textarea:focus {
  outline: none;
  border-color: var(--gg-primary);
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

.account-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.account-actions .auth-btn {
  flex: 1;
}

/* ===== 收藏 / 关注 按钮（B3 / B4） ===== */
.action-btn-fav {
  background: var(--gg-surface, #fff);
  color: var(--gg-text, #1f2a37);
  border: 1px solid var(--gg-border, #d8dee6);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-btn-fav .fav-icon {
  font-size: 16px;
  line-height: 1;
  color: #e6b800;
}

.action-btn-fav .fav-count {
  font-size: 13px;
  color: var(--gg-text-light, #5b6b7b);
  margin-left: 2px;
}

.idol-btn {
  margin-left: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--gg-primary, #2f6df6);
  background: transparent;
  color: var(--gg-primary, #2f6df6);
  font-size: 12px;
  cursor: pointer;
}

.idol-btn:hover {
  background: var(--gg-primary, #2f6df6);
  color: #fff;
}

/* ====== 详情页：左栏 + 主栏 布局（B2 改造） ====== */
.item-layout {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.item-sidebar {
  flex: 0 0 320px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 84px;
}

.item-main {
  flex: 1 1 auto;
  min-width: 0;
}

/* 主栏顶部内容块（面包屑/标题/描述/标签/收藏，画板上方） */
.item-head {
  margin-bottom: 20px;
}
.item-head .item-title {
  font-size: 26px;
  line-height: 1.3;
  margin: 4px 0 10px;
}
.item-head .item-meta {
  margin-bottom: 12px;
}
.item-head .item-description {
  font-size: 15px;
  line-height: 1.65;
  color: var(--gg-text, #1f2a37);
  margin-bottom: 12px;
}
.item-head .item-tags,
.item-head .item-books {
  margin-bottom: 12px;
}
.item-head .item-actions {
  margin-top: 14px;
  flex-wrap: wrap;
}
.item-head .item-msg {
  margin-top: 8px;
}

/* 左栏小部件卡片 */
.side-widget {
  background: var(--gg-surface, #fff);
  border: 1px solid var(--gg-border, #d8dee6);
  border-radius: 14px;
  padding: 16px;
}

/* 作者块 */
.side-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.side-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gg-bg, #f2f4f8);
  flex: 0 0 auto;
}
.side-author-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.side-author-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--gg-text, #1f2a37);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-author-name:hover {
  color: var(--gg-primary, #2f6df6);
}
.side-author-fans {
  font-size: 12px;
  color: var(--gg-muted, #6b7280);
}
.side-idol-btn {
  margin-top: 6px;
  align-self: flex-start;
}

/* 左栏内面包屑（原 .breadcrumb 强制横排，这里收紧） */
.side-breadcrumb {
  margin-bottom: 10px;
  font-size: 12px;
}
.side-breadcrumb .current {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 左栏标题、元信息、描述（复用 .item-* 基础样式，这里仅微调间距） */
.item-sidebar .item-title {
  font-size: 20px;
  line-height: 1.35;
}
.item-sidebar .item-meta {
  margin-top: 8px;
}
.item-sidebar .item-description {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
}
.item-sidebar .item-tags,
.item-sidebar .item-books {
  margin-top: 12px;
}
.item-sidebar .item-actions {
  margin-top: 16px;
  flex-wrap: wrap;
}
.item-sidebar .item-msg {
  margin-top: 8px;
}

/* 侧栏区块标题 */
.side-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--gg-text, #1f2a37);
}

/* 侧栏紧凑列表（同作者热门 / 同标签相关） */
.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-list-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gg-text, #1f2a37);
  border-radius: 8px;
  padding: 4px;
  transition: background .12s ease;
}
.side-list-link:hover {
  background: var(--gg-bg, #f2f4f8);
}
.side-list-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 42px;
  border-radius: 6px;
  background-color: var(--gg-bg, #f2f4f8);
  background-size: cover;
  background-position: center;
}
.side-list-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.side-list-title {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-list-author {
  font-size: 12px;
  color: var(--gg-muted, #6b7280);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 窄屏：左栏堆叠到主栏下方 */
@media (max-width: 900px) {
  .item-layout {
    flex-direction: column;
    gap: 20px;
  }
  .item-sidebar {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
    position: static;
    order: 2;
  }
  .item-main {
    order: 1;
  }
}

/* ====== 作者热门 / 相关推荐 区块（保留兼容旧引用） ====== */
.author-block,
.related-block {
  max-width: var(--gg-content-max, 960px);
  margin: 32px auto 0;
  padding: 0 20px;
}

.author-title,
.related-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--gg-text, #1f2a37);
}

.author-block .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.author-block .gallery-card {
  display: block;
  border: 1px solid var(--gg-border, #d8dee6);
  border-radius: 12px;
  overflow: hidden;
  background: var(--gg-surface, #fff);
  transition: box-shadow .15s ease, transform .15s ease;
}

.author-block .gallery-card:hover {
  box-shadow: 0 6px 18px rgba(31, 42, 55, .12);
  transform: translateY(-2px);
}

.author-block .card-thumb {
  height: 120px;
  background-size: cover;
  background-position: center;
  background-color: var(--gg-bg-alt, #f1f5f9);
}

.author-block .card-body {
  padding: 10px 12px;
}

.author-block .card-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-block .card-author {
  font-size: 12px;
  color: var(--gg-text-light, #5b6b7b);
  margin-top: 2px;
}
