/* ============================================================
   油田水结垢趋势预测系统 - 样式（美化版）
   ============================================================ */
:root {
  --primary: #1d4ed8;
  --primary-dark: #12356e;
  --primary-light: #3b82f6;
  --accent: #0891b2;
  --bg: #eef2f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-sub: #5b6b85;
  --border: #e3eaf3;
  --severe: #dc2626;
  --scaling: #ea580c;
  --critical: #ca8a04;
  --none: #059669;
  --shadow-sm: 0 1px 2px rgba(15, 42, 86, 0.05);
  --shadow: 0 1px 3px rgba(15, 42, 86, 0.06), 0 8px 28px rgba(15, 42, 86, 0.07);
  --shadow-lg: 0 6px 14px rgba(15, 42, 86, 0.10), 0 16px 40px rgba(15, 42, 86, 0.12);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  /* 柔和渐变背景 + 装饰性光斑 */
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(59, 130, 246, 0.13), transparent 60%),
    radial-gradient(900px 480px at 92% 4%, rgba(8, 145, 178, 0.10), transparent 55%),
    radial-gradient(700px 500px at 50% 108%, rgba(29, 78, 216, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

::selection { background: rgba(59, 130, 246, 0.25); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c4d0e2; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a8b9d4; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶部导航 ---------- */
.site-header {
  background: linear-gradient(135deg, #0b2545 0%, #12356e 45%, #1d4ed8 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(11, 37, 69, 0.28);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.28), rgba(59, 130, 246, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #7dd3fc;
  box-shadow: 0 4px 12px rgba(2, 18, 43, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.25s ease;
}
.brand:hover .brand-icon { transform: rotate(-8deg) scale(1.06); }

.brand-text h1 { font-size: 18px; font-weight: 600; letter-spacing: 0.5px; }
.brand-text p { font-size: 12px; color: #bfdbfe; opacity: 0.85; }

.main-nav { display: flex; gap: 6px; }

.nav-link {
  color: #dbeafe;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 14px;
  position: relative;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.nav-link.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.12));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* ---------- 主体 ---------- */
.site-main { max-width: 1400px; margin: 0 auto; padding: 32px 24px 48px; }

.section { scroll-margin-top: 84px; margin-bottom: 40px; }

.section-title { margin-bottom: 18px; }
.section-title h2 {
  font-size: 22px;
  color: var(--primary-dark);
  position: relative;
  padding-left: 14px;
  letter-spacing: 0.3px;
}
.section-title h2::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary-light), var(--accent));
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.45);
}
.section-title p { color: var(--text-sub); margin-top: 6px; font-size: 13px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #cfdcee;
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 {
  font-size: 16px; color: var(--primary-dark); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card-head h3::before {
  content: "";
  width: 4px; height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary-light), var(--accent));
}

.card-subtitle { margin: 18px 0 10px; }
.card-subtitle h4 {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  display: flex; align-items: baseline; gap: 6px;
}
.unit { font-size: 12px; color: var(--text-sub); font-weight: 400; }

/* ---------- 单井预测布局 ---------- */
.predict-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 14px;
}

.form-grid.ions { grid-template-columns: repeat(4, 1fr); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12.5px; color: var(--text-sub); font-weight: 600; }

.field input, .field select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text);
  background: #fbfdff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  width: 100%;
}

.field input:hover, .field select:hover { border-color: #c3d2e8; }

.field input:focus, .field select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.16);
  background: #fff;
}

.field.opt label::after { content: ""; }

.field.opt { position: relative; }
.field.opt label::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 5px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(8, 145, 178, 0.55);
}

.hint { font-size: 12px; color: var(--text-sub); margin-top: 10px; }
.hint .dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 2px;
}

.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s, border-color 0.2s, filter 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 60%, #1e40af 100%);
  color: #fff;
  box-shadow: 0 5px 14px rgba(29, 78, 216, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 8px 22px rgba(29, 78, 216, 0.45);
  filter: brightness(1.06);
}

.btn-ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary-light);
}
.btn-ghost:hover {
  background: linear-gradient(135deg, #eff6ff, #e6f0ff);
  box-shadow: 0 3px 10px rgba(29, 78, 216, 0.12);
}

.btn-sm { height: 34px; padding: 0 15px; font-size: 13px; border-radius: 8px; }

/* 按钮内 SVG 图标尺寸 */
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-sm svg { width: 13.5px; height: 13.5px; }

/* ---------- 结果面板 ---------- */
.result-panel { min-width: 0; }

.well-tag {
  background: linear-gradient(135deg, #eef4ff, #e0ebff);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #d4e2ff;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.10);
}

.summary-box {
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.summary-box.placeholder { background: linear-gradient(135deg, #f8fafc, #f1f5f9); }

/* 结论角标光晕 */
.summary-box::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 130px; height: 130px;
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
}

.summary-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 27px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(2, 18, 43, 0.25), inset 0 -3px 8px rgba(0, 0, 0, 0.18);
  animation: ringPop 0.35s ease;
}

@keyframes ringPop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.summary-body .summary-label { font-size: 12.5px; color: var(--text-sub); }
.summary-body .summary-level { font-size: 24px; font-weight: 700; margin: 2px 0; letter-spacing: 0.5px; }
.summary-body .summary-desc { font-size: 13px; color: var(--text-sub); }

/* 结论配色 */
.summary-box.severe { background: linear-gradient(135deg, #fef2f2, #fff); border-color: #fecaca; }
.summary-box.severe::after { background: radial-gradient(circle, rgba(220, 38, 38, 0.16), transparent 70%); }
.summary-box.severe .summary-ring { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.summary-box.severe .summary-level { color: var(--severe); }

.summary-box.scaling { background: linear-gradient(135deg, #fff7ed, #fff); border-color: #fed7aa; }
.summary-box.scaling::after { background: radial-gradient(circle, rgba(234, 88, 12, 0.15), transparent 70%); }
.summary-box.scaling .summary-ring { background: linear-gradient(135deg, #f97316, #c2410c); }
.summary-box.scaling .summary-level { color: var(--scaling); }

.summary-box.critical { background: linear-gradient(135deg, #fefce8, #fff); border-color: #fde68a; }
.summary-box.critical::after { background: radial-gradient(circle, rgba(202, 138, 4, 0.14), transparent 70%); }
.summary-box.critical .summary-ring { background: linear-gradient(135deg, #eab308, #a16207); }
.summary-box.critical .summary-level { color: var(--critical); }

.summary-box.none { background: linear-gradient(135deg, #ecfdf5, #fff); border-color: #a7f3d0; }
.summary-box.none::after { background: radial-gradient(circle, rgba(5, 150, 105, 0.14), transparent 70%); }
.summary-box.none .summary-ring { background: linear-gradient(135deg, #10b981, #047857); }
.summary-box.none .summary-level { color: var(--none); }

/* ---------- 仪表盘 ---------- */
.gauge-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.gauge-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 10px;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gauge-box:hover { border-color: #c9d8ee; box-shadow: var(--shadow-sm); }

.gauge-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.gauge-sub { font-size: 11.5px; color: var(--text-sub); font-weight: 400; }

.gauge-chart { height: 170px; }

.gauge-trend {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding-bottom: 8px;
}

.gauge-trend.severe { color: var(--severe); }
.gauge-trend.scaling { color: var(--scaling); }
.gauge-trend.critical { color: var(--critical); }
.gauge-trend.none { color: var(--none); }

/* ---------- 明细表 ---------- */
.detail-wrap { margin-top: 4px; }
.detail-table-wrap { overflow-x: auto; }

.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th {
  text-align: left;
  padding: 9px 12px;
  background: linear-gradient(180deg, #eef3fb, #e6edf8);
  color: var(--text-sub);
  font-weight: 600;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.detail-table th:first-child { border-radius: 8px 0 0 8px; }
.detail-table th:last-child { border-radius: 0 8px 8px 0; }
.detail-table td { padding: 9px 12px; border-bottom: 1px solid #edf2f9; }
.detail-table tbody tr { transition: background 0.15s; }
.detail-table tbody tr:hover { background: #f7faff; }
.detail-table td:first-child { font-weight: 600; color: var(--primary-dark); }
.detail-table td:nth-child(2) { font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-table tr:last-child td { border-bottom: none; }

/* ---------- 批量预测 ---------- */
.batch-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.import-tip { color: var(--none); font-weight: 500; }

.batch-input {
  width: 100%;
  min-height: 150px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px 14px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12.5px;
  color: var(--text);
  background: #fbfdff;
  outline: none;
  resize: vertical;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.batch-input:hover { border-color: #c3d2e8; }

.batch-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.16);
  background: #fff;
}

.batch-result-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: linear-gradient(180deg, #eef3fb, #e6edf8);
  color: var(--text-sub);
  font-weight: 600;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
}

.data-table td { padding: 9px 12px; border-bottom: 1px solid #edf2f9; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:nth-child(even) { background: #f8fafd; }
.data-table tbody tr:hover { background: #eff5ff; }

.empty-tip { text-align: center; color: var(--text-sub); padding: 24px !important; }

.tag {
  display: inline-block;
  padding: 2px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.tag-severe { background: linear-gradient(135deg, #fee2e2, #fecaca); color: var(--severe); }
.tag-scaling { background: linear-gradient(135deg, #ffedd5, #fed7aa); color: var(--scaling); }
.tag-critical { background: linear-gradient(135deg, #fef9c3, #fde68a); color: var(--critical); }
.tag-none { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: var(--none); }
.tag-invalid { background: #f1f5f9; color: #64748b; }

/* ---------- 历史趋势 ---------- */
.well-select {
  min-width: 240px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.well-select:hover { border-color: #c3d2e8; }
.well-select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.16); }

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.chart-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chart-box:hover { border-color: #c9d8ee; box-shadow: var(--shadow-sm); }

.chart-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.chart-main { height: 320px; }

/* ---------- 方法说明 ---------- */
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.method-card h3 {
  font-size: 15px;
  color: var(--primary-dark);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.method-card h3::before {
  content: "";
  width: 4px; height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary-light), var(--accent));
}

.method-card p { font-size: 13.5px; color: var(--text); margin-bottom: 8px; }

.formula {
  background: linear-gradient(135deg, #0b2545, #12356e);
  color: #7dd3fc;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 9px;
  margin: 10px 0;
  text-align: center;
  letter-spacing: 0.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 12px rgba(11, 37, 69, 0.25);
}

.method-list { list-style: none; padding: 0; }
.method-list li {
  padding: 6px 0 6px 20px;
  position: relative;
  font-size: 13.5px;
  color: var(--text);
}
.method-list li::before {
  content: "";
  position: absolute;
  left: 4px; top: 13px;
  width: 8px; height: 8px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.method-list b { color: var(--primary-dark); }

.level-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* ---------- 页脚 ---------- */
.site-footer {
  text-align: center;
  padding: 22px;
  color: var(--text-sub);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
}

/* ---------- 工具类 ---------- */
.hidden { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .predict-layout { grid-template-columns: 1fr; }
  .form-grid.ions { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .chart-grid, .method-grid { grid-template-columns: 1fr; }
  .gauge-row { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px 16px; gap: 8px; }
  .main-nav { flex-wrap: wrap; justify-content: center; }
  .form-grid.ions { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
