/* ===== AI财税智库 - 主样式 ===== */

:root {
  --primary: #1a56db;
  --primary-dark: #1340a5;
  --primary-light: #e8f0fe;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --success: #059669;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-gray: #f9fafb;
  --bg-dark: #111827;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

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

html { scroll-behavior: smooth; }

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

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-cta {
  padding: 8px 20px;
  background: var(--primary);
  color: #fff !important;
  border-radius: 20px;
  font-weight: 600;
}

.nav-cta:hover {
  background: var(--primary-dark) !important;
  color: #fff !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text);
}

/* ===== Hero Section ===== */
.hero {
  padding-top: 64px;
  min-height: 80vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #e0eaff 50%, #f5f0ff 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26,86,219,0.08) 0%, transparent 70%);
  top: -200px;
  right: -200px;
}

.hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.06) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  font-size: 18px;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 32px;
}

.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(26,86,219,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245,158,11,0.3);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}

.hero-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.hero-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.hero-card-name {
  font-weight: 600;
  font-size: 15px;
}

.hero-card-status {
  font-size: 13px;
  color: var(--success);
}

.hero-chat-msg {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.hero-chat-user {
  background: var(--primary-light);
  color: var(--text);
  border-bottom-right-radius: 4px;
  margin-left: 40px;
}

.hero-chat-ai {
  background: var(--bg-gray);
  color: var(--text);
  border-bottom-left-radius: 4px;
  margin-right: 40px;
}

.hero-chat-input {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.hero-chat-input input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.hero-chat-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.hero-chat-input button {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.hero-chat-input button:hover {
  background: var(--primary-dark);
}

/* ===== Sections ===== */
.section {
  padding: 80px 24px;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Features / Services ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}

.feature-icon.ai { background: #e8f0fe; color: var(--primary); }
.feature-icon.tax { background: #fef3c7; color: var(--accent); }
.feature-icon.news { background: #d1fae5; color: var(--success); }
.feature-icon.wechat { background: #f3e8ff; color: #7c3aed; }

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

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

/* ===== Articles ===== */
.bg-gray { background: var(--bg-gray); }

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

.article-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

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

.article-card-img {
  height: 200px;
  background: linear-gradient(135deg, #e0eaff, #f0f4ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--primary);
}

.article-card-body {
  padding: 20px;
}

.article-card-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-card-category {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.article-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.article-card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-light);
}

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

/* ===== Article Detail ===== */
.article-detail {
  padding-top: 100px;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 60px;
}

.article-detail-category {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
}

.article-detail h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-detail-meta {
  color: var(--text-light);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-detail-content {
  font-size: 16px;
  line-height: 1.9;
}

.article-detail-content p {
  margin-bottom: 20px;
}

.article-detail-content h2 { font-size: 24px; margin: 32px 0 16px; }
.article-detail-content h3 { font-size: 20px; margin: 24px 0 12px; }
.article-detail-content ul, .article-detail-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}
.article-detail-content li { margin-bottom: 8px; }
.article-detail-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-detail-content img { max-width: 100%; border-radius: var(--radius-sm); }

/* ===== Chat Widget ===== */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26,86,219,0.4);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle:hover {
  transform: scale(1.1);
}

.chat-box {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 360px;
  height: 500px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 60px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-box.open { display: flex; }

.chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h4 { font-size: 16px; font-weight: 600; }
.chat-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; opacity: 0.8; }
.chat-close:hover { opacity: 1; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  animation: fadeIn 0.3s ease;
}

.chat-msg.user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg.ai {
  background: var(--bg-gray);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--primary);
}

.chat-input-area button {
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

.chat-input-area button:hover {
  background: var(--primary-dark);
}

.chat-loading {
  align-self: flex-start;
  padding: 10px 14px;
  background: var(--bg-gray);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.chat-loading::after {
  content: '...';
  animation: loading 1.5s infinite;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loading {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-dark);
  color: #9ca3af;
  padding: 48px 24px 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}

.footer-brand h3 {
  color: #fff;
  font-size: 20px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
}

.footer-links h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 12px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li { margin-bottom: 8px; }

.footer-links a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
  max-width: 1200px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid #1f2937;
  text-align: center;
  font-size: 14px;
}

/* ===== Admin Panel ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: var(--bg-dark);
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}

.admin-sidebar-logo {
  padding: 0 20px;
  margin-bottom: 32px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.admin-nav { list-style: none; }

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 15px;
  transition: var(--transition);
}

.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.admin-main {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
  background: var(--bg-gray);
  min-height: 100vh;
}

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

.admin-header h1 {
  font-size: 28px;
  font-weight: 700;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  align-items: center;
}

.filters select, .filters input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
  outline: none;
}

.filters input:focus, .filters select:focus {
  border-color: var(--primary);
}

/* ===== Table ===== */
.data-table {
  width: 100%;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th {
  background: var(--bg-gray);
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.data-table tr:hover td {
  background: var(--bg-gray);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.badge-published { background: #d1fae5; color: var(--success); }
.badge-draft { background: #fef3c7; color: var(--accent); }

/* ===== Form ===== */
.form-group {
  margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-text h1 { font-size: 32px; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
  }

  .nav-toggle { display: block; }

  .section-title { font-size: 28px; }

  .articles-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 24px; }

  .chat-box {
    width: calc(100vw - 32px);
    right: -16px;
    bottom: 72px;
  }

  .article-detail h1 { font-size: 28px; }
}

/* ===== Loading Spinner ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Toast / Alert ===== */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success); color: #fff; }
.toast.error { background: #ef4444; color: #fff; }
.toast.info { background: var(--primary); color: #fff; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Contact Form ===== */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ===== Stats ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.stat-card h3 {
  font-size: 13px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-card .stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
}
