:root {
  --tax-navy: #091f43;
  --tax-blue: #1769ff;
  --tax-green: #0f9f79;
  --tax-ink: #172f50;
  --tax-muted: #6f8098;
  --tax-line: #dce6f3;
  --tax-soft: #f4f8fe;
}

body {
  background: #f7f9fc;
}
.tax-page {
  min-height: 100vh;
}
.tax-hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 154px;
  color: white;
  background:
    radial-gradient(circle at 85% 20%, rgba(74, 146, 255, 0.42), transparent 31%),
    linear-gradient(128deg, #071b3b, #0d3d86 70%, #1266d4);
}
.tax-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(90deg, transparent, black 65%, transparent);
}
.tax-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 70px;
}
.tax-hero-grid > * {
  min-width: 0;
}
.breadcrumb {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 23px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}
.breadcrumb a:hover {
  color: white;
}
.tax-kicker {
  display: block;
  margin-bottom: 15px;
  color: #9cc7ff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.18em;
}
.tax-hero h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 65px);
  line-height: 1.1;
  letter-spacing: -0.055em;
}
.tax-lead {
  max-width: 670px;
  margin: 23px 0 0;
  color: rgba(235, 244, 255, 0.82);
  font-size: 17px;
  line-height: 1.85;
}
.tax-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 30px;
}
.tax-hero-points span {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  backdrop-filter: blur(12px);
}
.tax-visual {
  position: relative;
  min-height: 340px;
  padding: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07));
  box-shadow: 0 38px 90px rgba(0, 11, 34, 0.35);
  backdrop-filter: blur(22px);
}
.tax-visual::after {
  content: '';
  position: absolute;
  width: 270px;
  height: 270px;
  right: -100px;
  bottom: -120px;
  border-radius: 50%;
  border: 42px solid rgba(255, 255, 255, 0.08);
}
.visual-top {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  letter-spacing: 0.09em;
}
.visual-amount {
  margin-top: 38px;
}
.visual-amount small {
  display: block;
  color: #a9c9f4;
}
.visual-amount strong {
  display: block;
  margin-top: 7px;
  font-size: 48px;
  letter-spacing: -0.05em;
}
.visual-bars {
  display: flex;
  align-items: end;
  gap: 12px;
  height: 100px;
  margin-top: 25px;
}
.visual-bars span {
  width: 19%;
  border-radius: 10px 10px 3px 3px;
  background: linear-gradient(#8fcbff, #2f7af1);
  box-shadow: 0 8px 25px rgba(20, 105, 240, 0.3);
}
.visual-bars span:nth-child(1) {
  height: 38%;
}
.visual-bars span:nth-child(2) {
  height: 64%;
}
.visual-bars span:nth-child(3) {
  height: 51%;
}
.visual-bars span:nth-child(4) {
  height: 84%;
}
.visual-bars span:nth-child(5) {
  height: 72%;
}
.visual-legend {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}
.visual-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #69b0ff;
}
.visual-legend span:last-child i {
  background: #5fe0b8;
}

.calculator-shell {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 40px), 1240px);
  margin: -86px auto 0;
}
.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  align-items: start;
  gap: 24px;
}
.tax-panel {
  border: 1px solid var(--tax-line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 75px rgba(27, 67, 123, 0.13);
}
.form-panel {
  padding: 34px;
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.panel-heading h2 {
  margin: 0;
  color: var(--tax-navy);
  font-size: 27px;
  letter-spacing: -0.035em;
}
.panel-heading p {
  margin: 8px 0 0;
  color: var(--tax-muted);
  font-size: 13px;
  line-height: 1.7;
}
.step-badge {
  flex: none;
  padding: 7px 10px;
  border-radius: 99px;
  color: #1b63d9;
  background: #eaf2ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.form-section-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 0 -2px;
  color: #355270;
  font-size: 12px;
  font-weight: 800;
}
.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e6edf6;
}
.tax-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px;
}
.field {
  display: grid;
  gap: 8px;
}
.field.full {
  grid-column: 1 / -1;
}
.field label,
.field > span {
  color: #3c526b;
  font-size: 12px;
  font-weight: 750;
}
.field input,
.field select {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #cfdbea;
  border-radius: 13px;
  outline: none;
  color: #17304f;
  background: white;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.field input:focus,
.field select:focus {
  border-color: #6ea4f8;
  box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.1);
}
.field small {
  min-height: 17px;
  color: #8795a8;
  font-size: 10px;
  line-height: 1.6;
}
.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.platform-hint,
.rule-source {
  grid-column: 1 / -1;
  padding: 13px 15px;
  border-radius: 12px;
  color: #5d7189;
  background: #f3f7fc;
  font-size: 11px;
  line-height: 1.7;
}
.rule-source a {
  color: #1769e9;
  font-weight: 700;
}
.form-error {
  grid-column: 1 / -1;
  padding: 13px 15px;
  border: 1px solid #f1c2b6;
  border-radius: 12px;
  color: #ad3c26;
  background: #fff2ee;
  font-size: 12px;
}
.calculate-button {
  grid-column: 1 / -1;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, #2379ff, #0b56d9);
  box-shadow: 0 15px 32px rgba(24, 104, 235, 0.24);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.calculate-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(24, 104, 235, 0.31);
}
.local-save-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  border: 1px solid #dce6f3;
  border-radius: 14px;
  color: #314d6b;
  background: #f7faff;
  cursor: pointer;
}
.local-save-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--tax-blue);
}
.local-save-option span {
  display: grid;
  gap: 4px;
}
.local-save-option strong {
  font-size: 12px;
}
.local-save-option small {
  color: #8190a4;
  font-size: 10px;
  line-height: 1.55;
}
.confirmation-option {
  border-color: #bfd6f4;
  background: #eef5ff;
}
.confirmation-option strong {
  color: #174f96;
}

.result-panel {
  position: sticky;
  top: 98px;
  overflow: hidden;
}
.result-empty {
  min-height: 470px;
  display: grid;
  place-items: center;
  padding: 45px;
  text-align: center;
}
.empty-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 28px;
  color: #2874ea;
  background: linear-gradient(145deg, #e7f1ff, #f5f9ff);
  font-size: 32px;
}
.result-empty h2 {
  margin: 0;
  font-size: 25px;
}
.result-empty p {
  max-width: 320px;
  margin: 13px auto 0;
  color: var(--tax-muted);
  font-size: 13px;
  line-height: 1.75;
}
.result-content {
  padding: 30px;
}
.result-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.result-head span {
  color: #66809b;
  font-size: 11px;
}
.result-head h2 {
  margin: 6px 0 0;
  font-size: 25px;
}
.result-head small {
  display: block;
  margin-top: 7px;
  color: #8b9aab;
  font-size: 9px;
  line-height: 1.55;
}
.result-rate {
  padding: 8px 11px;
  border-radius: 10px;
  color: #127457;
  background: #e4f7f0;
  font-size: 12px;
  font-weight: 800;
}
.primary-result {
  margin-top: 25px;
  padding: 24px;
  border-radius: 20px;
  color: white;
  background: linear-gradient(135deg, #0b244a, #164e91);
}
.primary-result small {
  color: #b9d0ef;
}
.primary-result strong {
  display: block;
  margin-top: 8px;
  font-size: 37px;
  letter-spacing: -0.04em;
}
.result-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 13px;
}
.result-metric {
  min-height: 94px;
  padding: 15px;
  border: 1px solid #e1e9f4;
  border-radius: 15px;
  background: #fbfdff;
}
.result-metric span {
  display: block;
  color: #7e8ea3;
  font-size: 10px;
}
.result-metric strong {
  display: block;
  margin-top: 9px;
  color: #1a3658;
  font-size: 16px;
}
.formula-box {
  margin-top: 15px;
  padding: 16px;
  border-radius: 14px;
  color: #61748c;
  background: #f3f7fc;
  font-size: 11px;
  line-height: 1.75;
}
.formula-box strong {
  color: #284662;
}
.scenario-note {
  margin-top: 15px;
  padding: 16px;
  border: 1px solid #cfe2fa;
  border-radius: 14px;
  color: #46627f;
  background: #f0f6ff;
}
.scenario-note strong {
  color: #1a4d88;
  font-size: 11px;
}
.scenario-note p {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.75;
}
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}
.result-actions button {
  min-height: 42px;
  border: 1px solid #bcd1ee;
  border-radius: 11px;
  color: #175fcf;
  background: white;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.result-actions button:hover {
  border-color: #78a8ed;
  background: #f5f9ff;
}
.copy-status {
  min-height: 15px;
  margin: 9px 0 0;
  color: #187858;
  font-size: 9px;
  line-height: 1.5;
}
.print-heading {
  display: none;
}
.wechat-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 15px;
  padding: 16px;
  border: 1px solid #a9e3cd;
  border-radius: 16px;
  color: #106b51;
  background: #e9faf3;
}
.wechat-action strong,
.wechat-action small {
  display: block;
}
.wechat-action small {
  margin-top: 3px;
  color: #57917e;
  font-size: 10px;
}
.wechat-action > span:last-child {
  font-size: 22px;
}
.result-disclaimer {
  margin: 15px 0 0;
  color: #8a98aa;
  font-size: 9px;
  line-height: 1.7;
}

.history-section {
  padding: 72px 0 8px;
}
.history-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}
.history-heading h2 {
  margin: 7px 0 0;
  color: var(--tax-navy);
  font-size: 31px;
  letter-spacing: -0.04em;
}
.history-heading p {
  margin: 9px 0 0;
  color: var(--tax-muted);
  font-size: 12px;
}
.history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--tax-line);
  border-radius: 17px;
  background: white;
  box-shadow: 0 14px 35px rgba(31, 75, 133, 0.07);
}
.history-card div {
  min-width: 0;
}
.history-card span,
.history-card small {
  display: block;
  color: #8291a4;
  font-size: 10px;
}
.history-card strong {
  display: block;
  margin: 7px 0;
  color: #183a61;
  font-size: 22px;
}
.history-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-card button {
  flex: none;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #c4d5ea;
  border-radius: 10px;
  color: #1763d8;
  background: white;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.import-section {
  padding: 84px 0;
}
.import-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.import-heading h2 {
  margin: 7px 0 0;
  color: var(--tax-navy);
  font-size: 35px;
  letter-spacing: -0.04em;
}
.import-heading p {
  margin: 11px 0 0;
  color: var(--tax-muted);
  line-height: 1.75;
}
.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #bcd1ee;
  border-radius: 11px;
  color: #1763d8;
  background: white;
  font-weight: 750;
  cursor: pointer;
}
.import-panel {
  padding: 28px;
}
.upload-zone {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 28px;
  border: 1px dashed #a8c4eb;
  border-radius: 20px;
  text-align: center;
  background: #f7faff;
  cursor: pointer;
}
.upload-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}
.upload-zone strong {
  display: block;
  color: #24496f;
  font-size: 17px;
}
.upload-zone span {
  display: block;
  margin-top: 9px;
  color: #7d8fa7;
  font-size: 11px;
}
.csv-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-top: 20px;
}
.csv-summary article {
  padding: 17px;
  border: 1px solid #dfe8f3;
  border-radius: 15px;
  background: white;
}
.csv-summary span,
.csv-summary small {
  display: block;
  color: #8190a2;
  font-size: 10px;
}
.csv-summary strong {
  display: block;
  margin: 8px 0;
  color: #173a61;
  font-size: 21px;
}
.csv-table-wrap {
  margin-top: 20px;
  overflow: auto;
  border: 1px solid #e1e8f1;
  border-radius: 16px;
}
.csv-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 11px;
}
.csv-table th,
.csv-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
}
.csv-table th {
  color: #718198;
  background: #f7f9fc;
}
.status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 800;
}
.status-success {
  color: #0b7958;
  background: #e4f7ef;
}
.status-warning {
  color: #a06414;
  background: #fff4dc;
}

.rules-section {
  padding: 78px 0;
  border-top: 1px solid #e5ecf4;
  background: white;
}
.rules-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 46px;
  align-items: start;
}
.rules-copy h2 {
  margin: 9px 0 16px;
  font-size: 36px;
  letter-spacing: -0.045em;
}
.rules-copy p {
  color: var(--tax-muted);
  line-height: 1.85;
}
.rules-list {
  display: grid;
  gap: 12px;
}
.rules-list article {
  padding: 20px;
  border: 1px solid var(--tax-line);
  border-radius: 17px;
}
.rules-list strong {
  color: #193b60;
}
.rules-list p {
  margin: 7px 0 0;
  color: #74859b;
  font-size: 12px;
  line-height: 1.7;
}
.tax-footer {
  padding: 28px 0;
  color: #8190a2;
  background: #071a36;
}
.tax-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.tax-footer a {
  color: white;
}

@media (max-width: 980px) {
  .tax-hero-grid,
  .calculator-grid,
  .rules-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .tax-hero-grid > *,
  .calculator-grid > *,
  .rules-grid > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .tax-visual {
    min-height: 290px;
  }
  .result-panel {
    position: static;
  }
  .csv-summary {
    grid-template-columns: 1fr 1fr;
  }
  .history-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .tax-hero {
    padding: 45px 0 125px;
  }
  .tax-hero-grid {
    gap: 36px;
  }
  .tax-hero h1 {
    font-size: 39px;
  }
  .tax-lead {
    font-size: 14px;
  }
  .tax-hero-points {
    width: 100%;
    max-width: 100%;
  }
  .tax-hero-points span {
    max-width: 100%;
    white-space: normal;
  }
  .tax-visual {
    min-height: 260px;
    padding: 24px;
  }
  .visual-amount strong {
    font-size: 36px;
  }
  .calculator-shell {
    width: min(calc(100% - 24px), 1240px);
  }
  .form-panel,
  .result-content,
  .import-panel {
    padding: 22px;
  }
  .tax-form-grid {
    grid-template-columns: 1fr;
  }
  .field.full,
  .form-section-title,
  .platform-hint,
  .rule-source,
  .form-error,
  .calculate-button {
    grid-column: auto;
  }
  .result-metrics {
    grid-template-columns: 1fr;
  }
  .result-actions {
    grid-template-columns: 1fr;
  }
  .history-section {
    padding-top: 55px;
  }
  .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .history-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .import-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .csv-summary {
    grid-template-columns: 1fr;
  }
  .tax-footer .container {
    flex-direction: column;
  }
  .menu-toggle {
    display: block !important;
    margin-left: auto;
  }
  .desktop-nav,
  .nav-actions {
    display: none !important;
  }
}

@media print {
  @page {
    size: A4;
    margin: 16mm;
  }
  body {
    background: white;
  }
  .site-header,
  .tax-hero,
  .form-panel,
  .history-section,
  .import-section,
  .rules-section,
  .tax-footer,
  .wechat-action,
  .result-actions,
  .copy-status {
    display: none !important;
  }
  .calculator-shell {
    width: 100%;
    margin: 0;
  }
  .calculator-grid {
    display: block;
  }
  .result-panel {
    position: static;
    border: 0;
    box-shadow: none;
  }
  .result-content {
    padding: 0;
  }
  .print-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 25px;
    padding-bottom: 14px;
    border-bottom: 1px solid #ccd8e5;
  }
  .print-heading strong {
    color: #091f43;
    font-size: 17px;
  }
  .print-heading span {
    max-width: 290px;
    color: #6f8098;
    font-size: 9px;
    line-height: 1.5;
    text-align: right;
  }
  .primary-result,
  .result-metric,
  .formula-box,
  .scenario-note {
    break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .primary-result {
    color: #091f43;
    background: #edf4fc;
  }
  .primary-result small {
    color: #5d7189;
  }
  .result-disclaimer {
    color: #5f6f83;
  }
}
