:root {
  --blue: #2e73d6;
  --blue-dark: #205db6;
  --blue-soft: #eef5ff;
  --green: #168a52;
  --text: #243247;
  --muted: #64748b;
  --line: #dce5f0;
  --surface: #ffffff;
  --page: #f5f7fa;
  --warning-bg: #fff8e8;
  --warning-border: #efd79b;
  --radius: 10px;
  --shadow: 0 6px 22px rgba(36, 50, 71, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

a {
  color: var(--blue-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  color: #fff;
  background: var(--blue-dark);
  border-radius: 0 0 6px 6px;
}

.skip-link:focus {
  top: 0;
}

.site-header {
  color: #fff;
  background: var(--blue);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.header-inner,
.page-shell,
.site-footer-inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand:hover {
  text-decoration: none;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.main-nav a {
  color: #fff;
  font-size: 15px;
}

.page-shell {
  padding: 22px 0 40px;
}

.breadcrumbs {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs span {
  margin: 0 7px;
  color: #9aa8b9;
}

.hero,
.panel,
.content-card,
.tool-card,
.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px 30px;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 8px;
  color: #17253a;
  font-size: clamp(27px, 4vw, 36px);
  line-height: 1.35;
}

.hero p {
  max-width: 800px;
  margin: 0;
  color: var(--muted);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 16px;
  color: #42627f;
  font-size: 14px;
}

.trust-row span::before {
  content: "✓";
  margin-right: 6px;
  color: var(--green);
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: start;
  gap: 18px;
}

.main-column,
.side-column {
  min-width: 0;
}

.panel,
.content-card,
.side-card {
  padding: 24px;
  margin-bottom: 18px;
}

.panel h2,
.content-card h2,
.side-card h2 {
  margin: 0 0 16px;
  color: #1d2d44;
  font-size: 21px;
  line-height: 1.45;
}

.content-card h3 {
  margin: 24px 0 8px;
  color: #253c5a;
  font-size: 18px;
}

.content-card p:last-child,
.side-card p:last-child {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: #34465f;
  font-weight: 700;
}

.date-input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid #aebed0;
  border-radius: 7px;
}

.date-input:focus {
  outline: 3px solid rgba(46, 115, 214, 0.16);
  border-color: var(--blue);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  font-weight: 700;
}

.button:hover {
  background: var(--blue-dark);
}

.button-secondary {
  color: var(--blue-dark);
  background: #fff;
}

.button-secondary:hover {
  background: var(--blue-soft);
}

.quick-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.quick-examples button {
  padding: 5px 10px;
  color: #46617e;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 13px;
}

.quick-examples button:hover {
  color: var(--blue-dark);
  border-color: #a8c5ec;
}

.results {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.result-box {
  padding: 15px 16px;
  background: #f8fbff;
  border: 1px solid #cfe0f5;
  border-left: 4px solid var(--blue);
  border-radius: 7px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 5px;
}

.result-label {
  color: #52677e;
  font-size: 14px;
  font-weight: 700;
}

.result-value {
  min-height: 33px;
  margin: 0;
  overflow-wrap: anywhere;
  color: #132844;
  font-size: clamp(19px, 3.2vw, 25px);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.copy-button {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: var(--blue-dark);
  background: #fff;
  border: 1px solid #a9c5e9;
  border-radius: 5px;
  font-size: 13px;
}

.status {
  min-height: 26px;
  margin: 10px 0 0;
  color: var(--green);
  font-size: 14px;
}

.notice {
  padding: 13px 15px;
  margin: 16px 0 0;
  color: #6f5621;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 7px;
  font-size: 14px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
  padding: 5px;
  background: #f2f6fb;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.mode-button {
  min-height: 43px;
  padding: 7px 10px;
  color: #415b77;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.mode-button:hover {
  color: var(--blue-dark);
  background: #fff;
}

.mode-button[aria-selected="true"] {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.calc-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-group {
  min-width: 0;
}

.number-field {
  position: relative;
}

.number-input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid #aebed0;
  border-radius: 7px;
}

.number-input:focus {
  outline: 3px solid rgba(46, 115, 214, 0.16);
  border-color: var(--blue);
}

.input-unit {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7f95;
  pointer-events: none;
}

.direction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 0 0;
}

.direction-row[hidden] {
  display: none;
}

.direction-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calc-actions {
  margin-top: 16px;
}

.calc-result {
  margin-top: 20px;
  padding: 18px;
  background: #f8fbff;
  border: 1px solid #cfe0f5;
  border-left: 4px solid var(--blue);
  border-radius: 7px;
}

.calc-result-title {
  margin: 0 0 5px;
  color: #52677e;
  font-size: 14px;
  font-weight: 700;
}

.calc-result-value {
  margin: 0;
  color: #132844;
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 700;
  line-height: 1.35;
}

.calc-result-sentence {
  margin: 5px 0 0;
  color: #4d6076;
}

.formula-box {
  margin: 13px 0 0;
  padding: 10px 13px;
  color: #40566e;
  background: #f7f9fc;
  border: 1px dashed #b8c7d8;
  border-radius: 6px;
  font-size: 14px;
}

.rule-list,
.side-list {
  margin: 0;
  padding-left: 22px;
}

.side-list {
  padding-left: 0;
  list-style: none;
}

.side-list li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.side-list li:last-child {
  border-bottom: 0;
}

.source-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
}

.example-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 15px;
}

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

.example-table th,
.example-table td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
}

.example-table th {
  color: #294765;
  background: #f1f6fc;
}

.faq-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.faq-item:first-of-type {
  border-top: 0;
}

.faq-item h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.faq-item p {
  margin: 0;
  color: #4d6076;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 20px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

a.tool-card:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(36, 50, 71, 0.12);
}

.tool-card h2,
.tool-card h3 {
  margin: 11px 0 7px;
  color: #1b3350;
  font-size: 19px;
  line-height: 1.45;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tool-tag {
  align-self: flex-start;
  padding: 2px 9px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-radius: 12px;
  font-size: 12px;
}

.tool-link-text {
  margin-top: auto;
  padding-top: 14px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 700;
}

.tool-card.is-planned {
  box-shadow: none;
  background: #fbfcfe;
}

.section-heading {
  margin: 28px 0 13px;
  color: #1d2d44;
  font-size: 24px;
}

.section-intro {
  margin: -7px 0 16px;
  color: var(--muted);
}

.site-footer {
  padding: 24px 0;
  color: #68788d;
  background: #fff;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .side-card {
    margin-bottom: 0;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
    gap: 10px;
  }

  .main-nav {
    gap: 14px;
  }

  .page-shell {
    padding-top: 15px;
  }

  .hero,
  .panel,
  .content-card,
  .side-card {
    padding: 19px;
  }

  .form-grid,
  .calc-fields,
  .tool-grid,
  .side-column {
    grid-template-columns: 1fr;
  }

  .mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-row .button {
    flex: 1 1 120px;
  }

  .example-table {
    font-size: 13px;
  }

  .example-table th,
  .example-table td {
    padding: 8px;
  }

  .site-footer-inner {
    flex-direction: column;
  }
}
