/* ============================================================
   量子膜江苏运营中心 — 跨页面共享核心样式
   仅包含所有页面（首页 + 子页）都会用到的规则
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --brand-blue: #0a1f3f;
  --brand-dark: #060f1e;
  --brand-gold: #c8a45c;
  --brand-gold-light: #d4b66a;
  --accent-teal: #00838f;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #7a7a8a;
  --bg-white: #ffffff;
  --bg-light: #f5f6f8;
  --bg-light-alt: #eef1f5;
  --border-light: #e8e9ed;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 8px 32px rgba(0,0,0,.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 980px;
  --transition: .3s cubic-bezier(.4,0,.2,1);
  --max-width: 1280px;

  --grad-gold: linear-gradient(135deg, #c8a45c 0%, #d4b66a 100%);
  --grad-dark: linear-gradient(135deg, #0a1f3f 0%, #0d284f 100%);
  --grad-hero: linear-gradient(160deg, #060f1e 0%, #0a1f3f 40%, #0d284f 100%);
  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; font-size: 16px; }

body {
  font-family: var(--font-stack);
  color: var(--text-primary);
  background: var(--bg-white);
  line-height: 1.7;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 8px;
  font-size: .95rem; font-weight: 600;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: all .25s ease; letter-spacing: .01em;
}

.btn-primary {
  background: var(--grad-gold); color: var(--brand-dark);
  box-shadow: 0 2px 12px rgba(200,164,92,.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(200,164,92,.45); }

.btn-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25); }
.btn-outline:hover { border-color: var(--brand-gold); color: var(--brand-gold); }

.btn-white { background: #fff; color: var(--brand-blue); }
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-dark-outline { background: transparent; color: var(--brand-blue); border: 1.5px solid var(--brand-blue); }
.btn-dark-outline:hover { background: rgba(10,31,63,.05); }

.btn-teal { background: linear-gradient(135deg, #00838f 0%, #0097a7 100%); color: #fff; box-shadow: 0 2px 12px rgba(0,131,143,.3); }
.btn-teal:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,131,143,.45); }

.btn-sm { padding: 8px 20px; font-size: .82rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); z-index: 9999;
  background: var(--brand-blue); color: #fff; padding: 12px 28px; border-radius: 8px;
  font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
}
.toast.success { background: #137333; }
.toast.error { background: #d93025; }

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); grid-column: 1 / -1; }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: .95rem; }

/* ---------- Card Grid (JS渲染共用) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

.card {
  background: var(--bg-white); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); overflow: hidden;
  cursor: pointer; transition: var(--transition);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(200,164,92,.25); }

.card-image {
  position: relative; height: 200px;
  background: linear-gradient(135deg, #e8edf5, #dce3ed);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-image img { transform: scale(1.06); }
.card-image .icon-placeholder { font-size: 3rem; opacity: .35; }

.card-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--brand-blue); color: #fff;
  padding: 4px 12px; border-radius: 4px;
  font-size: 12px; font-weight: 600;
}
.card-badge-teal {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent-teal); color: #fff;
  padding: 4px 12px; border-radius: 4px;
  font-size: 12px; font-weight: 600;
}

.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.card-sub { font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; flex: 1; }
.card-meta {
  display: flex; gap: 16px; font-size: .78rem; color: var(--text-muted);
  margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-light);
}

/* Article card variant (首页 + 资讯页均使用) */
.article-card { display: block; }
.article-card .article-card-img { height: 180px; }
.article-card .article-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; display: block; }
.article-card:hover .article-card-img img { transform: scale(1.06); }
.article-card .article-card-cat {
  display: inline-block; padding: 3px 10px;
  background: rgba(200,164,92,.12); color: var(--brand-gold);
  border-radius: 4px; font-size: 11px; font-weight: 600;
  margin-bottom: 6px;
}

/* ---------- 返回按钮 (详情页共用) ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; background: var(--brand-blue); color: #fff;
  text-decoration: none; border-radius: 6px;
  font-size: 14px; font-weight: 600;
  margin-bottom: 16px; transition: .3s ease;
}
.back-link:hover { background: var(--brand-dark); transform: translateX(-2px); }
.back-link-icon { font-size: 18px; line-height: 1; }

/* ---------- 输入框通用修复 ---------- */
input, select, textarea { box-sizing: border-box; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; font-size: 14px;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  outline: none; transition: var(--transition);
  background: #fff; color: var(--text-primary);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--brand-gold); box-shadow: 0 0 0 3px rgba(200,164,92,.1);
}
.form-group textarea { min-height: 100px; resize: vertical; }

/* ---------- Shared Responsive ---------- */
@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
}
