@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --blue-header: #5ba3d9;
  --blue-nav: #4a90c9;
  --blue-light: #d6eaf8;
  --blue-bg: #e8f4fc;
  --blue-dark: #2d6da3;
  --red: #c81623;
  --red-hover: #a8121d;
  --orange: #f39800;
  --orange-hover: #e08800;
  --white: #ffffff;
  --text: #333333;
  --text-muted: #666666;
  --text-light: #999999;
  --border: #dddddd;
  --border-input: #cccccc;
  --success: #52a852;
  --warning: #f39800;
  --danger: #c81623;
  --footer-bg: #3d3d3d;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 2px;
}

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

body {
  font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  background: var(--blue-bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue-dark); text-decoration: none; }
a:hover { color: var(--red); }
a:focus-visible { outline: 2px solid var(--blue-nav); outline-offset: 2px; }

.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== Top Bar ===== */
.top-bar { background: var(--white); border-bottom: 1px solid #eee; font-size: 12px; color: var(--text-muted); }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; height: 32px; }
.top-bar a { color: var(--red); margin: 0 2px; }
.top-bar a:hover { text-decoration: underline; }
.top-bar-right a { color: var(--text-muted); }
.top-bar-right a:hover { color: var(--blue-dark); }

/* ===== Brand Header ===== */
.brand-header { background: var(--blue-header); padding: 16px 0; }
.brand-inner { display: flex; justify-content: center; align-items: center; }
.brand-logo { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand-logo:hover { color: var(--white); opacity: 0.95; }
.brand-logo-icon {
  width: 48px; height: 48px; background: var(--white); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-nav); font-weight: 700; font-size: 16px;
}
.brand-logo-text { display: flex; flex-direction: column; }
.brand-logo-text strong { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.brand-logo-text span { font-size: 12px; opacity: 0.9; }

/* ===== Main Nav ===== */
.main-nav { background: var(--blue-nav); }
.main-nav-inner { display: flex; align-items: center; height: 40px; gap: 0; }
.main-nav a {
  color: var(--white); font-size: 14px; padding: 0 20px; height: 40px;
  display: flex; align-items: center; transition: background 0.2s;
}
.main-nav a:hover, .main-nav a.active { background: rgba(0,0,0,0.15); color: var(--white); }
.main-nav .nav-cta { margin-left: auto; background: var(--orange); font-weight: 600; }
.main-nav .nav-cta:hover { background: var(--orange-hover); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 24px; font-size: 14px; font-weight: 500; border: none;
  cursor: pointer; transition: all 0.2s; border-radius: var(--radius); min-height: 36px;
}
.btn:focus-visible { outline: 2px solid var(--blue-nav); outline-offset: 2px; }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-hover); }
.btn-secondary { background: var(--blue-nav); color: var(--white); }
.btn-secondary:hover { background: var(--blue-dark); }
.btn-outline { background: var(--white); color: var(--blue-nav); border: 1px solid var(--blue-nav); }
.btn-outline:hover { background: var(--blue-light); }
.btn-sm { padding: 5px 14px; font-size: 13px; min-height: 30px; }
.btn-lg { padding: 12px 36px; font-size: 16px; min-height: 44px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== CNKI Tabs ===== */
.cnki-tabs { display: flex; background: var(--blue-nav); }
.cnki-tab {
  flex: 1; padding: 12px 16px; text-align: center; font-size: 14px;
  color: var(--white); background: var(--blue-nav); border: none; cursor: pointer;
  transition: all 0.2s; min-height: 44px;
}
.cnki-tab.active { background: var(--white); color: var(--red); font-weight: 600; }
.cnki-tab:hover:not(.active) { background: var(--blue-dark); }

/* ===== Card Box ===== */
.card-box {
  background: var(--white); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.card-box-title {
  font-size: 16px; font-weight: 600; color: var(--text);
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 2px solid var(--blue-nav);
}

/* ===== Main Content ===== */
.main-content { flex: 1; padding: 24px 0 40px; }

/* ===== Hero ===== */
.hero { padding: 32px 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.hero-card { background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 32px; }
.hero-tags { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tag {
  padding: 2px 12px; font-size: 12px; background: var(--blue-light);
  color: var(--blue-dark); border: 1px solid #b8d4ea;
}
.hero h1 { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 16px; line-height: 1.4; }
.hero h1 .highlight { color: var(--red); }
.hero-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.8; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.hero-stats { display: flex; gap: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.stat-num { font-size: 24px; font-weight: 700; color: var(--blue-nav); }
.stat-label { font-size: 12px; color: var(--text-muted); }

/* Report Preview */
.report-preview { background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow); }
.report-preview-header {
  background: var(--blue-nav); color: var(--white); padding: 10px 20px;
  font-size: 14px; font-weight: 600;
}
.report-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.metric-card { padding: 20px; border-bottom: 1px solid var(--border); }
.metric-card:nth-child(odd) { border-right: 1px solid var(--border); }
.metric-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.metric-value { font-size: 28px; font-weight: 700; }
.metric-value.low { color: var(--success); }
.metric-value.high { color: var(--danger); }
.metric-badge { display: inline-block; margin-top: 6px; padding: 2px 8px; font-size: 12px; border-radius: 2px; }
.badge-success { background: #e8f5e8; color: var(--success); }
.badge-warning { background: #fff8e8; color: var(--warning); }
.badge-danger { background: #fde8e8; color: var(--danger); }

/* ===== Sections ===== */
.section { padding: 32px 0; }
.section-title { text-align: center; margin-bottom: 32px; }
.section-title h2 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.section-title h2 .accent { color: var(--red); }
.section-title p { color: var(--text-muted); font-size: 14px; }

/* ===== Cards Grid ===== */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--white); border: 1px solid var(--border);
  padding: 24px; transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-icon {
  width: 44px; height: 44px; background: var(--blue-light);
  border: 1px solid #b8d4ea; display: flex; align-items: center;
  justify-content: center; color: var(--blue-nav); margin-bottom: 14px;
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.card p { color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.card-meta { margin-top: 14px; padding-top: 14px; border-top: 1px solid #eee; }
.card-meta dt { font-size: 12px; color: var(--text-light); }
.card-meta dd { font-size: 13px; font-weight: 500; margin-top: 2px; }

/* Compare */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare-box { padding: 24px; border: 1px solid var(--border); background: var(--white); }
.compare-box.before { border-top: 3px solid var(--danger); }
.compare-box.after { border-top: 3px solid var(--success); }
.compare-box h3 { margin-bottom: 14px; font-size: 15px; font-weight: 600; }
.compare-box ul { list-style: none; }
.compare-box li { padding: 6px 0 6px 20px; position: relative; font-size: 13px; color: var(--text-muted); }
.compare-box.before li::before { content: '×'; position: absolute; left: 0; color: var(--danger); font-weight: 700; }
.compare-box.after li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 700; }

/* Pricing */
.pricing-card { text-align: center; position: relative; }
.pricing-card.featured { border: 2px solid var(--blue-nav); }
.pricing-badge {
  position: absolute; top: -1px; right: 16px;
  background: var(--red); color: var(--white); padding: 2px 12px;
  font-size: 12px;
}
.pricing-price { font-size: 32px; font-weight: 700; color: var(--red); margin: 12px 0; }
.pricing-price small { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.pricing-features { list-style: none; text-align: left; margin: 16px 0; }
.pricing-features li { padding: 6px 0; font-size: 13px; color: var(--text-muted); padding-left: 18px; position: relative; }
.pricing-features li::before { content: '·'; position: absolute; left: 4px; color: var(--blue-nav); font-weight: 700; font-size: 18px; line-height: 1; }

/* Testimonials */
.testimonial-card { text-align: center; }
.testimonial-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--blue-light);
  border: 2px solid var(--blue-nav); display: flex; align-items: center;
  justify-content: center; font-weight: 700; color: var(--blue-nav);
  margin: 0 auto 12px; font-size: 16px;
}
.testimonial-text { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.7; }
.testimonial-name { font-weight: 600; font-size: 14px; }
.testimonial-role { font-size: 12px; color: var(--text-light); }

/* FAQ */
.faq-list { max-width: 700px; margin: 0 auto; background: var(--white); border: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%; text-align: left; padding: 14px 20px; background: none; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer; display: flex;
  justify-content: space-between; align-items: center; color: var(--text); min-height: 44px;
}
.faq-question:hover { background: var(--blue-bg); }
.faq-answer { padding: 0 20px 14px; color: var(--text-muted); font-size: 13px; display: none; line-height: 1.7; }
.faq-item.open .faq-answer { display: block; }
.faq-question::after { content: '+'; font-size: 18px; color: var(--blue-nav); }
.faq-item.open .faq-question::after { content: '−'; }

/* CTA Banner */
.cta-banner {
  background: var(--blue-nav); color: var(--white); text-align: center;
  padding: 40px 20px; margin-bottom: 0;
}
.cta-banner h2 { font-size: 20px; margin-bottom: 8px; }
.cta-banner p { font-size: 14px; opacity: 0.9; margin-bottom: 20px; }
.cta-banner .btn-primary { font-size: 16px; }

/* ===== Footer ===== */
.site-footer { background: var(--footer-bg); color: #aaa; padding: 24px 0; font-size: 12px; line-height: 1.8; margin-top: auto; }
.site-footer a { color: #aaa; }
.site-footer a:hover { color: var(--white); }
.footer-inner p { margin-bottom: 4px; }

/* ===== Page Layout ===== */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-header h1 .highlight { color: var(--red); }
.page-header p { color: var(--text-muted); font-size: 13px; }
.page-body { padding-bottom: 32px; }

/* ===== Detect Page ===== */
.detect-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.panel { background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 0; overflow: hidden; }
.panel-body { padding: 24px; }
.panel-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  padding: 12px 20px; background: var(--blue-light); border-bottom: 1px solid var(--border);
}

.upload-zone {
  border: 2px dashed var(--border-input); padding: 40px 20px;
  text-align: center; cursor: pointer; transition: all 0.2s; background: #fafafa;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue-nav); background: var(--blue-bg); }
.upload-zone svg { width: 40px; height: 40px; color: var(--blue-nav); margin-bottom: 10px; }
.upload-zone p { color: var(--text-muted); font-size: 13px; }
.upload-zone .hint { font-size: 12px; margin-top: 6px; color: var(--text-light); }

.tabs { display: flex; background: var(--blue-nav); }
.tab {
  flex: 1; padding: 10px; text-align: center; font-size: 13px;
  cursor: pointer; border: none; background: var(--blue-nav); color: var(--white);
  transition: all 0.2s; min-height: 40px;
}
.tab.active { background: var(--white); color: var(--red); font-weight: 600; }

.textarea {
  width: 100%; min-height: 180px; padding: 10px 12px; border: 1px solid var(--border-input);
  font-family: inherit; font-size: 14px; resize: vertical; color: var(--text);
}
.textarea:focus { outline: none; border-color: var(--blue-nav); }
.char-count { text-align: right; font-size: 12px; color: var(--text-light); margin-top: 4px; }

.option-group { margin-bottom: 16px; }
.option-group > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.option-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; font-size: 13px; border: 1px solid var(--border);
  background: var(--white); cursor: pointer; transition: all 0.2s; min-height: 32px;
}
.chip.active { border-color: var(--blue-nav); background: var(--blue-light); color: var(--blue-dark); font-weight: 500; }
.chip input { display: none; }

.payment-icons { display: flex; gap: 8px; margin-top: 12px; }
.payment-icon {
  flex: 1; padding: 10px; border: 1px solid var(--border); text-align: center;
  font-size: 13px; cursor: pointer; transition: all 0.2s; min-height: 40px;
  display: flex; align-items: center; justify-content: center; background: var(--white);
}
.payment-icon.active { border-color: var(--blue-nav); background: var(--blue-light); color: var(--blue-dark); font-weight: 500; }

/* ===== Form Inputs (CNKI style) ===== */
.input-group { display: flex; border: 1px solid var(--border-input); margin-bottom: 16px; background: var(--white); }
.input-group-icon {
  width: 40px; display: flex; align-items: center; justify-content: center;
  background: #f5f5f5; border-right: 1px solid var(--border-input); color: var(--text-light); flex-shrink: 0;
}
.input-group-icon svg { width: 18px; height: 18px; }
.input-group input {
  flex: 1; border: none; padding: 10px 12px; font-size: 14px; outline: none; min-height: 40px;
}
.input-row { display: flex; gap: 8px; margin-bottom: 16px; }
.input-row .input-group { flex: 1; margin-bottom: 0; }
.input-row .btn { flex-shrink: 0; white-space: nowrap; }

/* ===== Report ===== */
.report-header { background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px; }
.report-header-bar { background: var(--blue-nav); color: var(--white); padding: 8px 20px; font-size: 14px; font-weight: 600; margin: -24px -24px 20px; }
.report-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; }
.report-meta dt { font-size: 12px; color: var(--text-light); }
.report-meta dd { font-weight: 600; font-size: 14px; }
.report-score-ring {
  width: 100px; height: 100px; border: 4px solid var(--success); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.report-score-ring .num { font-size: 18px; font-weight: 700; color: var(--success); }
.report-score-ring .label { font-size: 11px; color: var(--text-muted); }
.report-section { margin-bottom: 16px; }
.report-section h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 12px; padding: 8px 12px;
  background: var(--blue-light); border-left: 3px solid var(--blue-nav); color: var(--text);
}
.highlight-red { background: #fde8e8; padding: 1px 3px; color: var(--danger); }
.highlight-yellow { background: #fff8e8; padding: 1px 3px; color: #b8860b; }

/* ===== Tables ===== */
.source-table, .data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.source-table th, .source-table td, .data-table th, .data-table td {
  padding: 10px 14px; text-align: left; border: 1px solid var(--border);
}
.source-table th, .data-table th {
  background: var(--blue-light); font-weight: 600; font-size: 13px; color: var(--text);
}
.data-table tr:nth-child(even) td { background: #fafafa; }
.data-table tr:hover td { background: var(--blue-bg); }

.status { display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 2px; }
.status-done { background: #e8f5e8; color: var(--success); }
.status-pending { background: #fff8e8; color: var(--warning); }
.status-fail { background: #fde8e8; color: var(--danger); }
.risk-high { color: var(--danger); font-weight: 600; }
.risk-medium { color: var(--warning); font-weight: 600; }
.risk-low { color: var(--success); font-weight: 600; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-input, .filter-select {
  padding: 7px 12px; border: 1px solid var(--border-input); font-size: 13px;
  background: var(--white); min-height: 34px; color: var(--text);
}
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--blue-nav); }

/* Messages */
.message-list { display: flex; flex-direction: column; gap: 12px; }
.message-item { padding: 16px; border: 1px solid var(--border); background: var(--white); }
.message-item .author { font-weight: 600; font-size: 13px; }
.message-item .time { font-size: 12px; color: var(--text-light); margin-left: 8px; }
.message-item .content { margin-top: 6px; font-size: 13px; color: var(--text-muted); }

/* WeChat float */
.wechat-float {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  width: 48px; height: 48px; border-radius: 4px;
  background: #07c160; color: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: transform 0.2s;
}
.wechat-float:hover { transform: scale(1.05); }
.wechat-float svg { width: 24px; height: 24px; }

/* Responsive */
@media (max-width: 768px) {
  .hero-grid, .compare-grid, .detect-layout, .cards-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 22px; }
  .main-nav-inner { overflow-x: auto; }
  .hero-stats { gap: 20px; }
}
