/* ===== 2026碳中和助手 - 公共样式 ===== */
/* 新能源网 xny22.com 品牌色系 */

:root {
  --brand-green: #16a34a;
  --brand-green-light: #22c55e;
  --brand-green-pale: #dcfce7;
  --brand-green-dark: #14532d;
  --brand-teal: #0d9488;
  --brand-sky: #0ea5e9;
  --brand-amber: #f59e0b;
  --brand-red: #ef4444;
  --brand-blue: #2563eb;
  
  --bg: #f0fdf4;
  --bg-card: #ffffff;
  --text-primary: #14532d;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --border: #d1fae5;
  --shadow: 0 4px 24px rgba(22,163,74,0.10);
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
}

/* ===== 导航 ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(240,253,244,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--brand-green);
  text-decoration: none;
}
.nav-logo .leaf { font-size: 1.5rem; }
.nav-logo .brand { font-size: 0.75rem; color: var(--text-muted); margin-left: 0.5rem; }
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--brand-green); border-bottom-color: var(--brand-green); }
.nav-cta {
  padding: 0.5rem 1rem;
  background: var(--brand-green);
  color: white !important;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.nav-cta:hover { background: #15803d; }

/* 移动端菜单 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-green);
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(22,163,74,0.3);
}
.btn-primary:hover { background: #15803d; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(22,163,74,0.4); }
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--brand-green);
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 2px solid var(--brand-green);
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover { background: var(--brand-green-pale); transform: translateY(-2px); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== 卡片 ===== */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(22,163,74,0.15); }
.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.card-icon {
  width: 44px; height: 44px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.card-title { font-size: 1.125rem; font-weight: 700; color: var(--brand-green-dark); }
.card-subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ===== 表单 ===== */
.form-group { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1rem; }
.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-group input,
.form-group select {
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: #fafafa;
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--brand-green);
  background: white;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}
.form-group .unit-hint { font-size: 0.75rem; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* 滑块 */
.slider-group { margin-bottom: 1rem; }
.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}
.slider-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.slider-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-green);
  background: var(--brand-green-pale);
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
}
input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--brand-green) var(--progress, 50%), #e5e7eb var(--progress, 50%));
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-green);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22,163,74,0.4);
  transition: transform 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ===== 标签 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-green { background: var(--brand-green-pale); color: var(--brand-green); }
.tag-blue { background: #dbeafe; color: var(--brand-blue); }
.tag-amber { background: #fef3c7; color: #d97706; }
.tag-red { background: #fee2e2; color: var(--brand-red); }
.tag-gray { background: #f3f4f6; color: var(--text-secondary); }

/* ===== 进度条 ===== */
.progress-track { height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.8s cubic-bezier(0.16,1,0.3,1); }
.bar-transport { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.bar-energy { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.bar-diet { background: linear-gradient(90deg, #10b981, #059669); }
.bar-shopping { background: linear-gradient(90deg, #ec4899, #db2777); }

/* ===== 网格布局 ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* ===== 页面容器 ===== */
.page-container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page-header { text-align: center; margin-bottom: 3rem; }
.page-header h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 0.75rem; }
.page-header p { color: var(--text-secondary); max-width: 60ch; margin: 0 auto; }

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-green); }
.breadcrumb .sep { color: var(--text-muted); }

/* ===== 侧边栏布局 ===== */
.layout-sidebar {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}
.sidebar { position: sticky; top: 88px; }
.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 0.25rem; }
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}
.sidebar-menu a:hover, .sidebar-menu a.active {
  background: var(--brand-green-pale);
  color: var(--brand-green);
}

/* ===== 表格 ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th,
.data-table td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th {
  background: var(--brand-green-pale);
  color: var(--brand-green-dark);
  font-weight: 600;
  font-size: 0.8125rem;
}
.data-table tr:hover { background: #fafafa; }
.data-table .highlight { color: var(--brand-green); font-weight: 700; }

/* ===== 统计条 ===== */
.stats-bar {
  background: var(--brand-green);
  color: white;
  padding: 1.25rem 1.5rem;
}
.stats-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stat-item .label { font-size: 0.8125rem; opacity: 0.8; margin-bottom: 0.25rem; }
.stat-item .value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-item .unit { font-size: 0.75rem; opacity: 0.7; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9375rem; }

/* ===== Footer ===== */
footer {
  background: var(--brand-green-dark);
  color: rgba(255,255,255,0.8);
  padding: 3rem 1.5rem 2rem;
  margin-top: 3rem;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}
.footer-logo { font-size: 1.25rem; font-weight: 800; color: white; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.footer-desc { font-size: 0.875rem; line-height: 1.7; opacity: 0.7; max-width: 28ch; }
.footer-col h4 { color: white; font-size: 0.875rem; font-weight: 700; margin-bottom: 1rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col li { font-size: 0.8125rem; opacity: 0.7; }
.footer-col a { color: rgba(255,255,255,0.7); text-decoration: none; transition: var(--transition); }
.footer-col a:hover { color: white; }
.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-brand-row .brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.footer-brand-row .brand-link:hover { background: rgba(255,255,255,0.2); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  opacity: 0.6;
}

/* ===== 动画 ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes rotateEarth { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rotateSlow { from { transform: translate(-50%,-50%) rotate(0deg); } to { transform: translate(-50%,-50%) rotate(360deg); } }

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
[data-reveal].revealed { opacity: 1; transform: translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .layout-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stats-bar-inner { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-bar-inner { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-green { color: var(--brand-green); }
.text-amber { color: var(--brand-amber); }
.text-red { color: var(--brand-red); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.bg-green-pale { background: var(--brand-green-pale); }
