/* Flash Tank Calculators – shared style */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  line-height: 1.55;
}

/* ---- Header ---- */
.site-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 60%, #3a7ca5 100%);
  color: #fff;
  padding: 18px 0 0 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.header-brand h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.header-brand p {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 2px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
}
.btn-home { background: #f0ad4e; color: #1a1a2e; }
.btn-home:hover { background: #ec971f; }
.btn-email { background: #fff; color: #1e3a5f; }
.btn-email:hover { background: #e8e8e8; }
.btn-calc { background: #28a745; color: #fff; padding: 9px 22px; font-size: 0.95rem; border-radius: 5px; }
.btn-calc:hover { background: #218838; }
.btn-reset { background: #6c757d; color: #fff; padding: 9px 22px; font-size: 0.95rem; border-radius: 5px; }
.btn-reset:hover { background: #5a6268; }

.lang-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
}
.lang-select option { color: #1a1a2e; background: #fff; }

/* ---- Nav ---- */
.nav-bar {
  background: #16213e;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 14px;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.nav-inner a {
  color: #c8d6e5;
  text-decoration: none;
  padding: 11px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
}
.nav-inner a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-inner a.active { color: #f0ad4e; border-bottom-color: #f0ad4e; }

/* ---- Page content ---- */
.page-content {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 24px;
}

/* ---- Cards ---- */
.calc-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
  margin-bottom: 28px;
  overflow: hidden;
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid #eee;
}
.card-header h2 {
  font-size: 1.15rem;
  color: #1e3a5f;
}
.card-body {
  padding: 20px 22px;
}

/* ---- Form rows ---- */
.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.field-row label {
  min-width: 220px;
  font-weight: 500;
  color: #333;
  font-size: 0.92rem;
}
.field-row input, .field-row select {
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.92rem;
  width: 140px;
  transition: border-color 0.15s;
}
.field-row input:focus, .field-row select:focus {
  border-color: #3a7ca5;
  outline: none;
  box-shadow: 0 0 0 2px rgba(58,124,165,0.15);
}
.field-row .unit {
  color: #666;
  font-size: 0.85rem;
}
.field-row .formula {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  min-width: 200px;
}

/* ---- Input (yellow), Result (green) ---- */
.input-cell { background: #fff9e6; border-color: #e6c86e !important; }
.result-cell { background: #e6f9e6; border-color: #6ec86e !important; cursor: default; }
.input-cell:focus { border-color: #d4a800 !important; }
.result-cell:focus { border-color: #6ec86e !important; }

/* ---- Section titles ---- */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 18px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 2px solid #eee;
}
.desc-text {
  color: #666;
  font-size: 0.88rem;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ---- Action row ---- */
.action-row {
  display: flex;
  gap: 12px;
  margin: 16px 0 4px;
}

/* ---- Home grid ---- */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.home-card {
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
  text-decoration: none;
  color: #1a1a2e;
  display: block;
  border-left: 4px solid #3a7ca5;
  transition: transform 0.15s, box-shadow 0.15s;
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}
.home-card h3 {
  font-size: 1.05rem;
  color: #1e3a5f;
  margin-bottom: 6px;
}
.home-card p {
  font-size: 0.85rem;
  color: #666;
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 18px 24px;
  color: #888;
  font-size: 0.8rem;
  margin-top: 32px;
}

/* ---- Table ---- */
.steam-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 12px 0;
}
.steam-table th, .steam-table td {
  border: 1px solid #ddd;
  padding: 5px 8px;
  text-align: center;
}
.steam-table th { background: #eef3f8; color: #1e3a5f; font-weight: 600; }
.steam-table tr:nth-child(even) { background: #fafbfc; }

.ref-table {
  width: 100%;
  max-width: 540px;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 8px 0 4px;
}
.ref-table th, .ref-table td {
  border: 1px solid #d8e0ea;
  padding: 5px 10px;
  text-align: left;
}
.ref-table th { background: #1e3a5f; color: #fff; font-weight: 600; }
.ref-table td:last-child { font-family: "Courier New", monospace; color: #1e3a5f; font-size: 0.78rem; }
.ref-table tr:nth-child(even) { background: #f3f7fb; }

/* ---- Result highlight ---- */
.result-value {
  font-weight: 700;
  color: #1e5a3a;
}

/* ---- Export toolbar ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  flex-wrap: wrap;
}
.toolbar .btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #f8f9fa;
  color: #333;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.toolbar .btn-sm:hover { background: #e9ecef; border-color: #999; }
.toolbar .btn-print { background: #17a2b8; color: #fff; border-color: #17a2b8; }
.toolbar .btn-print:hover { background: #138496; }
.toolbar .btn-word { background: #2b579a; color: #fff; border-color: #2b579a; }
.toolbar .btn-word:hover { background: #1e3d6e; }
.toolbar .btn-book { background: #6f42c1; color: #fff; border-color: #6f42c1; }
.toolbar .btn-book:hover { background: #5a32a3; }
.toolbar .btn-compare { background: #fd7e14; color: #fff; border-color: #fd7e14; }
.toolbar .btn-compare:hover { background: #e56b0a; }
.toolbar .btn-history { background: #20c997; color: #fff; border-color: #20c997; }
.toolbar .btn-history:hover { background: #1ba87e; }
.toolbar .btn-saverec { background: #28a745; color: #fff; border-color: #28a745; }
.toolbar .btn-saverec:hover { background: #218838; }

/* ---- Field error ---- */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.field-error { animation: shake 0.3s; border-color: #e74c3c !important; background: #fff0f0 !important; }
.field-error-msg { color: #e74c3c; font-size: 0.75rem; margin-left: 8px; }

@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .field-row label { min-width: 100%; }
  .nav-inner a { padding: 9px 12px; font-size: 0.82rem; }
  .toolbar { gap: 4px; }
  .toolbar .btn-sm { padding: 5px 10px; font-size: 0.78rem; }
}
