/* 公共样式 - 配合 Tailwind CSS 使用 */

:root {
  --color-primary: #1e40af;
  --color-primary-dark: #1e3a8a;
  --color-accent: #f59e0b;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --color-border: #e5e7eb;
}

* { box-sizing: border-box; }

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

a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary-dark); }

/* 导航 */
.nav-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 64px;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}
.nav-logo small {
  color: var(--color-muted);
  font-weight: 400;
  font-size: 0.75rem;
  display: block;
}
.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  color: var(--color-text);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}
.nav-menu a.active::after,
.nav-menu a:hover::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 3px;
  background: var(--color-primary);
}
.nav-tools {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.lang-switch {
  border: 1px solid var(--color-border);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: white;
  padding: 6rem 1.5rem;
  text-align: center;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 1rem;
  letter-spacing: -1px;
}
.hero p {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto 2rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-size: 1rem;
}
.btn-primary { background: var(--color-accent); color: #1f2937; }
.btn-primary:hover { background: #d97706; color: white; }
.btn-secondary { background: transparent; color: white; border: 2px solid white; }
.btn-secondary:hover { background: white; color: var(--color-primary); }

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}
.section-header p {
  color: var(--color-muted);
  font-size: 1.125rem;
  margin: 0;
}

/* 卡片网格 */
.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; }
@media (max-width: 768px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .nav-menu { display: none; }
}

/* 产品卡 */
.product-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}
.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.product-card-img {
  aspect-ratio: 4/3;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body {
  padding: 1.25rem;
}
.product-card-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}
.product-card-body p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.product-card .model {
  display: inline-block;
  background: var(--color-bg-alt);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
  font-family: monospace;
}

/* 分类卡 */
.cat-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.cat-card:hover {
  border-color: var(--color-primary);
  background: #eff6ff;
}
.cat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}
.cat-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

/* 新闻卡 */
.news-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}
.news-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.news-card-body {
  padding: 1.5rem;
}
.news-card .date {
  color: var(--color-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.news-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  line-height: 1.4;
}
.news-card p {
  color: var(--color-muted);
  margin: 0;
  font-size: 0.875rem;
}

/* Footer */
.site-footer {
  background: #1f2937;
  color: #d1d5db;
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-col h4 {
  color: white;
  margin: 0 0 1rem;
  font-size: 1rem;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: #d1d5db; font-size: 0.875rem; }
.footer-col a:hover { color: white; }
.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #374151;
  text-align: center;
  font-size: 0.875rem;
  color: #9ca3af;
}

/* 表单 */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-text);
}
.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}
textarea.form-control { min-height: 120px; resize: vertical; }

/* 面包屑 */
.breadcrumb {
  padding: 1rem 1.5rem;
  background: var(--color-bg-alt);
  font-size: 0.875rem;
}
.breadcrumb a { color: var(--color-muted); }
.breadcrumb span { color: var(--color-text); margin: 0 0.5rem; }

/* 提示 */
.alert-success {
  padding: 1rem;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.alert-error {
  padding: 1rem;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* 详情页 */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
@media (max-width: 768px) {
  .detail-layout { grid-template-columns: 1fr; }
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.feature-list li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
}
.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 700;
}

/* 后台布局 */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: #1f2937;
  color: #d1d5db;
  padding: 1.5rem 0;
}
.admin-sidebar h3 {
  color: white;
  padding: 0 1.5rem;
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
}
.admin-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.admin-sidebar a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #d1d5db;
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: #374151;
  color: white;
  border-left-color: var(--color-accent);
}
.admin-content {
  padding: 2rem;
  background: var(--color-bg-alt);
}
.admin-content h1 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.stat-card .num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}
.stat-card .label {
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* 表格 */
.data-table {
  width: 100%;
  background: white;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.data-table th {
  background: var(--color-bg-alt);
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.data-table tr:last-child td { border-bottom: none; }
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-sm:hover { background: var(--color-bg-alt); }
.btn-sm-danger { color: #dc2626; border-color: #fca5a5; }
.btn-sm-primary { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.btn-sm-primary:hover { background: var(--color-primary-dark); color: white; }

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}
.login-card {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}
.login-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  text-align: center;
}
.login-card .sub {
  text-align: center;
  color: var(--color-muted);
  margin-bottom: 2rem;
  font-size: 0.875rem;
}