:root {
  --bg-main: #0b0c16;
  --bg-panel: #131524;
  --bg-panel-light: #1a1c2e;
  --bg-input: #0e101b;
  
  --border: #242940;
  --border-focus: #00e5ff;
  
  --ink: #e2e8f0;
  --ink-heading: #f8fafc;
  --muted: #8b99ab;
  
  --accent: #00e5ff;
  --accent-gradient: linear-gradient(135deg, #00e5ff 0%, #3b82f6 100%);
  --accent-soft: rgba(0, 229, 255, 0.1);
  --accent-glow: 0 0 15px rgba(0, 229, 255, 0.3);
  
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.1);
}

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

body {
  min-height: 100vh;
  font-family: 'Outfit', 'Inter', sans-serif;
  color: var(--ink);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.08) 0, transparent 40%),
    radial-gradient(circle at 85% 5%, rgba(0, 229, 255, 0.05) 0, transparent 40%);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(1140px, calc(100% - 2.25rem));
  margin: 2rem auto 3rem;
  position: relative;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: panel-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  backdrop-filter: blur(10px);
}

/* Typography styles */
.hero {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-color: rgba(36, 41, 64, 0.5);
  background: linear-gradient(180deg, rgba(19,21,36,0) 0%, var(--bg-panel) 100%);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 0.8rem;
  background: var(--ink-heading);
  -webkit-background-clip: text;
  background-clip: text;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 4px;
}

.lead {
  margin: 0 auto 1.5rem;
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 65ch;
}

/* Preset Buttons */
.preset-wrap {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.preset-btn {
  border: 1px solid var(--border);
  background: var(--bg-panel-light);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--ink);
}

.preset-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--accent-glow);
}

/* Form layout */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.calc-panel, .result-panel {
  padding: 1.5rem;
  animation-delay: 0.1s;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: var(--bg-input);
  color: var(--ink);
  transition: all 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--accent-glow);
  background: var(--bg-panel-light);
}

.field input::placeholder {
  color: #4a5568;
}

/* Actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}

.actions button {
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.actions button:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.25);
  flex: 1 1 100%;
}

.btn-primary:hover {
  box-shadow: var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-panel-light);
  color: var(--ink);
  border: 1px solid var(--border);
  flex: 1;
}

.btn-secondary:hover {
  border-color: var(--muted);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.small-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Results */
.empty-state {
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--muted);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.empty-state strong {
  color: var(--accent);
}

.result-content {
  display: grid;
  gap: 1rem;
}

.total-box {
  border-radius: 12px;
  padding: 1.2rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.total-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gradient);
}

.total-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.total-box strong {
  display: block;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  line-height: 1.1;
  color: var(--accent);
  margin: 0.2rem 0;
  text-shadow: var(--accent-glow);
}

.total-box span {
  color: var(--muted);
  font-size: 0.85rem;
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.meta-row article {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-panel-light);
  padding: 0.8rem 1rem;
}

.meta-row p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.meta-row strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.1rem;
  color: var(--ink);
}

.line-items {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-input);
}

.line-items li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.line-items li:last-child {
  border-bottom: 0;
}

.line-items span {
  color: var(--muted);
  font-size: 0.9rem;
}

.line-items strong {
  font-feature-settings: "tnum";
  color: var(--ink);
  font-weight: 600;
}

.split-chart {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: var(--bg-panel-light);
}

.split-chart h3 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.split-chart h3::before { display: none; }

.split-row {
  display: grid;
  grid-template-columns: 80px 1fr 45px;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.split-row:last-child { margin-bottom: 0; }

.split-row span,
.split-row strong {
  font-size: 0.85rem;
  color: var(--muted);
}

.split-row strong { color: var(--ink); text-align: right; }

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.5s ease;
}

#materialsBar { background: var(--accent); box-shadow: var(--accent-glow); }
#laborBar { background: #8b5cf6; }
#extrasBar { background: #64748b; }

/* Content sections & Cards */
.content-section {
  margin-top: 1.5rem;
  padding: 2rem;
  animation-delay: 0.2s;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  justify-content: center;
}

.section-title::before { display:none; }

.steps-grid, .testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.step-card, .testimonial-card {
  background: var(--bg-panel-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.step-card:hover {
  border-color: rgba(0, 229, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.step-number, .tool-icon {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1.2rem !important;
  border: 1px solid rgba(0, 229, 255, 0.2);
  box-shadow: none !important;
}

.step-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--ink) !important;
}

.step-card p {
  color: var(--muted) !important;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* Calculators Grid Overrides */
#all-calculators .step-card {
  display: flex !important;
  flex-direction: column;
  text-decoration: none;
}

.testimonial-card p {
  font-style: italic;
  color: var(--muted);
  margin: 0 0 1.2rem;
  font-size: 0.95rem;
}

.testimonial-card strong {
  color: var(--ink);
  font-size: 0.9rem;
}

/* FAQs - Dark theme style */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.faq-item {
  background: var(--bg-panel-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.faq-item summary {
  padding: 1.2rem 1.4rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-weight: 400;
  font-size: 1.5rem;
  line-height:建设1;
  transition: transform 0.3s ease;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 4px;
}

.faq-item[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.4rem 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-answer p { margin: 0 0 1rem; }
.faq-answer p:last-child { margin: 0; }
.faq-answer strong { color: var(--ink); }

/* Header & Footer */
.site-header {
  background: rgba(11, 12, 22, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.lang-switch {
  background: var(--bg-panel-light) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink) !important;
  border-radius: 6px !important;
  padding: 0.3rem 0.6rem !important;
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  background: var(--bg-main);
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) repeat(2, minmax(170px, 1fr));
  gap: 2rem;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.footer-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-heading {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
}

.footer-links {
  display: grid;
  gap: 0.6rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
  transform: translateX(3px);
}

.footer-bottom {
  max-width: 1140px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.5rem 0;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: #53647a;
  font-size: 0.85rem;
}

@keyframes panel-rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-main { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  .header-inner { flex-direction: column; gap: 1rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .meta-row { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .btn-primary, .btn-secondary, .btn-ghost { flex: 1 1 100%; }
}
