:root {
  --primary: #1f6fd8;
  --text: #1f2d3d;
  --muted: #6b7280;
  --bg: #f7f8fb;
  --card: #ffffff;
  --border: #e3e5eb;
  --row-blue: #f2f6ff;
  --row-pink: #f7f0f8;
}
* {
  box-sizing: border-box;
}
html {
  height: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  height: 100%;
  display: flex;
  flex-direction: column;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}
.app-shell {
  width: 100%;
  max-width: 980px;
  margin: 20px auto 0;
  padding: 0 16px 12px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
.page-shell {
  width: 100%;
  max-width: 880px;
  margin: 20px auto 60px;
  padding: 0 16px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
.topbar {
  width: 100%;
  background: #03045e;
  color: #fff;
  height: 57px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 16px;
  font-weight: 700;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand img {
  width: 36px;
  height: 36px;
  display: block;
}
.top-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 600;
}
.top-links a {
  color: #f5f7fb;
  text-decoration: none;
  padding: 6px 0;
}
.top-links a:hover {
  text-decoration: underline;
}
.hero {
  text-align: center;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #eef2fb;
  color: #2f4f9e;
  font-size: 12px;
  font-weight: 700;
}
.hero h1 {
  font-size: 22px;
  letter-spacing: 0.2px;
}
.hero .lede {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.long-desc {
  margin: 6px 0 0;
  padding: 0 4px;
  color: var(--text);
  line-height: 1.6;
  font-size: 13px;
}
.panel {
  background: var(--card);
  border-radius: 8px;
  padding: 12px 12px 14px;
  margin-top: 10px;
  border: 1px solid var(--border);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.1px;
  font-size: 15px;
}
.mt-16 {
  margin-top: 12px;
}
.subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.inline-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inline-option .label-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}
.inline-option .label-title {
  font-weight: 400;
}
.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.field {
  background: #fbfcfe;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 11px 10px;
  display: grid;
  gap: 6px;
}
.field-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
}
.field-sub {
  font-size: 9px;
  color: var(--muted);
}
.numberbox {
  width: 140px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #cfd3dc;
  font-size: 14px;
  text-align: right;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.numberbox::-webkit-outer-spin-button,
.numberbox::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.numberbox {
  -moz-appearance: textfield;
}
.numberbox:focus {
  border-color: #2f7bf6;
  box-shadow: none;
}
.input-with-suffix {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.input-suffix {
  color: #0d1a48;
  font-size: 12px;
  font-weight: 700;
}
.percent-text {
  color: #0d1a48;
  font-weight: 700;
}
#btnCalc {
  width: 100%;
  height: 44px;
  margin: 12px 0 0;
  display: block;
  border-radius: 10px;
  outline: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  color: #fff;
  background: #023e8a;
  transition: background-color 0.1s ease, transform 0.08s ease;
}
#btnCalc:hover {
  background: #03479b;
}
#btnCalc:active {
  transform: translateY(1px);
}
.table-wrapper {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 10px 10px;
  text-align: center;
}
th {
  background: #e3f2fd;
  color: #465063;
  font-size: 13px;
  letter-spacing: 0.05px;
  border-bottom: 1px solid var(--border);
}
td {
  font-size: 13px;
  border-top: 1px solid #edf0f5;
}
#table1 tr:nth-child(even) td {
  background: #fcfdff;
}
#table1 td:first-child,
#table1 th:first-child {
  text-align: left;
  padding-left: 16px;
}
#table2 th:first-child,
#table2 td:first-child {
  text-align: left;
  padding-left: 16px;
}
#ratio-summary td {
  font-weight: 700;
  background: #f1f5ff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.type-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.type-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}
.yanglao {
  background: #6287e8;
}
.yiliao {
  background: #e56775;
}
.shiye {
  background: #efaa46;
}
.gongshang {
  background: #ea9235;
}
.shengyu {
  background: #d46ab5;
}
.housing {
  background: #4aa163;
}
.row-soft {
  background: #f5f7fb;
  font-weight: 700;
}
.row-total-org {
  background: var(--row-blue);
  font-weight: 700;
  color: #1c3c8c;
}
.row-total-personal {
  background: var(--row-pink);
  font-weight: 700;
  color: #7b246a;
}
.result-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.meta-box {
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #1f2d3d;
  background: #f6f7fb;
  border: 1px solid var(--border);
}
.meta-box small {
  color: var(--muted);
  font-weight: 500;
}
.meta-blue {
  background: #f6f7fb;
}
.meta-pink {
  background: #f7f0f8;
}
.result-summary {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}
.summary-card {
  border-radius: 8px;
  padding: 11px 13px;
  font-weight: 700;
  border: 1px solid var(--border);
}
.summary-card .title {
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.summary-card .value {
  font-size: 20px;
  margin-bottom: 6px;
}
.summary-card .detail {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.sky {
  background: #f4f7ff;
  color: #1f3976;
}
.mauve {
  background: #f7f1f8;
  color: #732558;
}
.tiny-note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.hidden {
  display: none !important;
}
#result {
  display: block;
}
#finalSalary {
  display: none;
}
.ghost-btn {
  border: 1px solid #cfd3dc;
  background: #fff;
  color: #023e8a;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.ghost-btn:hover {
  background: #f4f7ff;
}
.footer {
  margin-top: 6px;
  padding: 10px 0 12px;
  color: #6b7280;
  font-size: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer a {
  color: #3662e3;
  text-decoration: none;
  margin: 0 6px;
}
.footer a:hover {
  text-decoration: underline;
}

/* Page card styles (FAQ / 社保) */
.page-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 18px 22px;
  box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.18);
  width: 100%;
}
.article-body {
  display: grid;
  gap: 14px;
  line-height: 1.7;
  color: var(--text);
}
.article-body h1 {
  margin: 0;
  font-size: 24px;
}
.article-body h2 {
  margin: 10px 0 6px;
  font-size: 18px;
}
.article-body p {
  margin: 0;
}
.article-body ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}
.article-body li {
  margin: 0;
}

.lede {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.placeholder {
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fcfdff;
  color: var(--muted);
  font-size: 13px;
}
.back-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}
.back-link:hover {
  text-decoration: underline;
}
.article-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.link-secondary {
  display: inline-block;
  padding: 0;
  color: var(--primary);
  font-weight: 400;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.12s ease;
}
.link-secondary:hover {
  text-decoration: underline;
}
.doc-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 10px 0 6px;
}
.doc-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f9fbff;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.1s ease;
}
.doc-card:hover {
  border-color: #d0dbf4;
  box-shadow: 0 6px 16px -12px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}
.doc-title {
  font-weight: 700;
  font-size: 15px;
}
.doc-meta {
  font-size: 12px;
  color: var(--muted);
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .app-shell {
    width: 100%;
    max-width: 980px;
    margin: 18px auto 0;
    padding: 0 12px 12px;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
  }
  .page-shell {
    width: 100%;
    max-width: 880px;
    margin: 16px auto 40px;
    padding: 0 12px;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
  }
  .topbar-inner {
    padding: 0 12px;
    font-size: 15px;
  }
  .brand {
    font-size: 16px;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  .top-links {
    gap: 10px;
    font-size: 13px;
  }
  .panel {
    padding: 10px 10px 12px;
  }
  .panel-head {
    font-size: 16px;
  }
  .input-grid {
    grid-template-columns: 1fr;
  }
  .numberbox {
    width: 100%;
    min-width: 0;
  }
  .field-inline {
    align-items: flex-start;
  }
  .field-inline > div:first-child {
    flex: 0 0 120px;
    min-width: 120px;
  }
  .field-inline .numberbox {
    min-width: 0;
    flex: 1 1 0;
  }
  .table-wrapper {
    overflow-x: auto;
  }
  table {
    min-width: 0;
    width: 100%;
  }
  th,
  td {
    padding: 8px 6px;
  }
  .type-cell {
    gap: 4px;
  }
  .type-badge {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .input-with-suffix {
    width: 100%;
  }
  .input-with-suffix input.numberbox {
    width: 100%;
  }
  .article-body {
    gap: 12px;
    line-height: 1.6;
  }
  .article-body h1 {
    font-size: 22px;
  }
  .article-body h2 {
    font-size: 17px;
  }
  .doc-list {
    grid-template-columns: 1fr;
  }
  .meta-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
