:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2933;
  background: #eef3f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.shell {
  width: min(100% - 28px, 1120px);
  margin: 0 auto;
  padding: 28px 0 70px;
}

.hero {
  padding: 36px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0b3f4c, #197278);
  color: white;
  box-shadow: 0 18px 50px rgba(15, 76, 92, .2);
}

.hero h1 {
  margin: 5px 0 12px;
  font-size: clamp(32px, 7vw, 56px);
}

.hero p {
  max-width: 820px;
  line-height: 1.75;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: .16em;
  opacity: .82;
}

.card {
  margin-top: 20px;
  padding: 26px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(31, 41, 51, .07);
}

.card h2 {
  margin-top: 0;
}

.group-title {
  margin: 28px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid #dce7ea;
  color: #0f4c5c;
}

.dropzone {
  display: grid;
  gap: 7px;
  padding: 36px;
  text-align: center;
  border: 2px dashed #82adb2;
  border-radius: 18px;
  background: #f6fbfb;
  cursor: pointer;
}

.dropzone span,
small {
  color: #63757c;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 13px 20px;
  font-weight: 750;
  cursor: pointer;
  background: #0f4c5c;
  color: white;
}

button:disabled {
  opacity: .65;
  cursor: wait;
}

button.secondary {
  background: #e8f2f3;
  color: #0f4c5c;
}

button.compact {
  padding: 8px 12px;
}

.status {
  min-height: 24px;
  color: #0f4c5c;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 9px;
  border-bottom: 1px solid #e4ebee;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f6f9fa;
  color: #496068;
}

input,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #c6d4d9;
  border-radius: 10px;
  background: white;
  font-size: 16px;
}

label {
  display: grid;
  align-content: start;
  gap: 7px;
  font-weight: 680;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.rule-note {
  display: grid;
  gap: 5px;
  margin-top: 22px;
  padding: 16px;
  border-left: 5px solid #197278;
  border-radius: 12px;
  background: #eef7f7;
  line-height: 1.6;
}

.warnings,
.result-warnings {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: #9b2c2c;
  line-height: 1.55;
}

.metrics,
.control-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.control-grid {
  grid-template-columns: repeat(3, 1fr);
}

.metrics article,
.control-grid article {
  padding: 18px;
  border: 1px solid #dce9eb;
  border-radius: 16px;
  background: #f1f7f7;
}

.metrics span,
.control-grid span {
  display: block;
  color: #5b6f76;
  font-size: 14px;
}

.metrics strong,
.control-grid strong {
  display: block;
  margin-top: 7px;
  color: #0f4c5c;
  font-size: 29px;
}

.result-table strong {
  color: #0f4c5c;
}

.result-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px 18px;
  margin-top: 22px;
  padding: 18px;
  border-radius: 14px;
  background: #f7fafb;
  line-height: 1.65;
}

.success-message {
  color: #276749;
}

.notice {
  margin-bottom: 0;
  padding: 15px 17px;
  border-radius: 12px;
  background: #fff8e6;
  color: #76520d;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics,
  .control-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 16px, 1120px);
    padding-top: 8px;
  }

  .hero,
  .card {
    padding: 18px;
    border-radius: 16px;
  }

  .form-grid,
  .metrics,
  .control-grid,
  .result-details {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }

  .result-table {
    min-width: 720px;
  }
}

.industry-detection {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
  margin: 18px 0;
}

.industry-detection article {
  padding: 16px;
  border: 1px solid #dce9eb;
  border-radius: 14px;
  background: #f6fafb;
}

.industry-detection span {
  display: block;
  color: #60737a;
  font-size: 13px;
}

.industry-detection strong {
  display: block;
  margin-top: 7px;
  color: #0f4c5c;
  line-height: 1.45;
}

.industry-confirmation {
  max-width: 520px;
  margin-top: 18px;
}

.industry-notice {
  margin-top: 16px;
  padding: 15px 17px;
  border-left: 5px solid #b7791f;
  border-radius: 12px;
  background: #fff8e6;
  color: #76520d;
  line-height: 1.65;
}

.subsection-title {
  margin-top: 34px !important;
  padding-top: 25px;
  border-top: 2px solid #e4ecef;
}

.ratio-description {
  color: #5c6f76;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .industry-detection {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .industry-detection {
    grid-template-columns: 1fr;
  }
}


#manufacturingInputs[hidden],
#manufacturingResults[hidden],
#nonManufacturingNotice[hidden],
#constructionResultNotice[hidden] {
  display: none !important;
}


.confirmation-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #d3e0e4;
  border-radius: 12px;
  background: #f7fafb;
  line-height: 1.65;
  font-weight: 500;
}

.confirmation-box input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  flex: 0 0 auto;
}

.confirmation-box span {
  display: block;
}


/* 多產業專用欄位 */
#constructionGeneralInputs,
#constructionProjectInputs,
#constructionCommonInputs,
#industrySpecificResults {
  margin-top: 1.25rem;
}

.industry-metrics {
  margin-bottom: 1.25rem;
}

input[type="date"],
input[type="text"],
input[type="number"],
select {
  width: 100%;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}
