/* ========================================
   千售科技官网 - 全局公共样式
   ======================================== */

/* --- CSS 变量 --- */
:root {
  --color-primary: #4153ff;
  --color-primary-dark: #2f3fd9;
  --color-primary-light: rgba(65, 83, 255, 0.15);
  --color-accent: #ff6b35;
  --color-accent-hover: #e55a2b;
  --color-text: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.65);
  --color-text-light: rgba(255, 255, 255, 0.45);
  --color-bg: #0b1a38;
  --color-bg-white: #ffffff;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-success: #00d4aa;

  --font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --max-width: 1750px;
  --header-height: 72px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);

  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* --- 浅色模式变量覆盖 --- */
[data-theme="light"] {
  --color-primary: #4153ff;
  --color-primary-dark: #2f3fd9;
  --color-primary-light: rgba(65, 83, 255, 0.08);
  --color-accent: #ff6b35;
  --color-text: #1a1a2e;
  --color-text-secondary: rgba(26, 26, 46, 0.65);
  --color-text-light: rgba(26, 26, 46, 0.45);
  --color-bg: #f0f2f5;
  --color-bg-white: #ffffff;
  --color-border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* --- 重置 --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #060d1f;
}

/* ---- 全站星空背景 ---- */
#starfield-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- 内容包裹层，确保在星空之上 ---- */
#app {
  position: relative;
  z-index: 1;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  overflow-x: hidden;
  min-width: 1024px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

input, button, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

button {
  cursor: pointer;
}

/* --- 容器 --- */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- 栅格系统 --- */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.col-3 { width: 25%; padding: 0 15px; }
.col-4 { width: 33.333%; padding: 0 15px; }
.col-6 { width: 50%; padding: 0 15px; }
.col-8 { width: 66.666%; padding: 0 15px; }
.col-12 { width: 100%; padding: 0 15px; }

/* --- 板块通用 --- */
.section {
  padding: 120px 0;
}

.section-gray {
  background: var(--color-bg);
}

.section-title {
  text-align: center;
  margin-bottom: 64px;
}

.section-title h2 {
  font-size: 42px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.section-title .subtitle {
  font-size: 18px;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

.section-title .divider {
  width: 48px;
  height: 4px;
  background: var(--color-primary);
  margin: 20px auto 0;
  border-radius: 2px;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  transition: all var(--transition-fast);
  line-height: 1.4;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(65, 83, 255, 0.35);
}

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

.btn-accent:hover {
  background: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.35);
}

.btn-outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-outline-white:hover {
  background: #fff;
  color: var(--color-primary);
  border-color: #fff;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 18px;
}

/* --- 卡片 --- */
.card {
  background: rgba(13, 31, 68, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

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

/* --- 标签 --- */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* --- 页面头部（子页通用） --- */
.page-header {
  padding: 150px 0 80px;
  background: linear-gradient(135deg, #0a1628 0%, #132347 50%, #0d1f3c 100%);
  color: #fff;
  text-align: center;
}

.page-header h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.page-header p {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.65);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- 面包屑 --- */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
}

.breadcrumb a:hover {
  color: #fff;
}

/* --- 滚动动画 --- */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
}

/* --- 弹窗 --- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #0d1f44;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: background var(--transition-fast);
  z-index: 1;
  color: rgba(255, 255, 255, 0.6);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  display: flex;
}

.modal-body .modal-left {
  flex: 1;
  padding: 40px;
}

.modal-body .modal-left h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.modal-body .modal-left .subtitle {
  color: var(--color-text-secondary);
  font-size: 15px;
  margin-bottom: 30px;
}

.modal-body .modal-left .form-group {
  margin-bottom: 16px;
}

.modal-body .modal-left .form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transition: border-color var(--transition-fast);
}

.modal-body .modal-left .form-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.modal-body .modal-left .form-group input:focus {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.1);
}

.modal-body .modal-left .btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.modal-body .modal-left .phone-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.modal-body .modal-right {
  width: 400px;
  background-size: cover;
  background-position: center;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  position: relative;
}

/* --- Toast 提示 --- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: #0d1f3c;
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 14px;
  z-index: 99999;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background: var(--color-success);
}

.toast.error {
  background: var(--color-accent);
}

/* ========================================
   Light Theme (data-theme="light")
   All light-theme style overrides are now
   in light-theme.css — single source of truth.
   Only unique hover/animation additions
   not in light-theme.css are kept here.
   ======================================== */

[data-theme="light"] .card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
[data-theme="light"] .case-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
[data-theme="light"] .news-card + .news-divider { background: rgba(0,0,0,0.08) !important; }
