
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px; line-height: 1.5; color: #2c3e50;
  background: #f0f2f5; min-height: 100vh;
}

/* ========== 导航栏 ========== */


/* ========== 顶部标题栏 ========== */
.top-bar {
  background: linear-gradient(135deg, #C00 0%, #8B0000 100%);
  color: #fff;
  padding: 12px 16px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(192,0,0,0.2);
  position: relative;
  overflow: hidden;
}
.top-bar h1 { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; position: relative; z-index: 1; }
.top-bar p { font-size: 11px; opacity: 0.85; position: relative; z-index: 1; margin-top: 2px; }

.main-wrap { max-width: 1400px; margin: 0 auto; padding: 12px 16px 40px; }

.input-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #eef0f3;
}

.input-divider {
  font-size: 11px;
  font-weight: 700;
  color: #C00;
  margin: 10px 0 8px;
  padding-left: 6px;
  border-left: 2px solid #C00;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.input-divider:first-of-type { margin-top: 0; }

.reset-btn {
  font-size: 10px;
  color: #fff;
  background: linear-gradient(135deg, #C00, #8B0000);
  border: none;
  padding: 3px 9px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(192,0,0,0.25);
  font-family: inherit;
  letter-spacing: 0.3px;
}
.reset-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(192,0,0,0.4); }
.reset-btn:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(192,0,0,0.3); }

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.input-grid.grid-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.form-group { margin-bottom: 0; }
.form-group > label {
  display: block;
  font-size: 11px;
  color: #666;
  margin-bottom: 3px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.form-group > label .req { color: #C00; margin-left: 1px; font-weight: 700; }
.form-group .hint { display: none; }

input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 6px 10px;
  border: 1.5px solid #e4e7ec;
  border-radius: 7px;
  font-size: 12px;
  color: #2c3e50;
  outline: none;
  background: #fafbfc;
  transition: all 0.2s;
  font-family: inherit;
}
input:focus, select:focus {
  border-color: #C00;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(192,0,0,0.08);
}

.num-wrap { position: relative; display: flex; width: 100%; }
.num-wrap > input[type="number"] {
  flex: 1; width: auto; min-width: 0;
  padding-right: 30px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.num-wrap > input[type="number"]::-webkit-outer-spin-button,
.num-wrap > input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.num-wrap .num-btns {
  position: absolute;
  right: 2px; top: 2px; bottom: 2px;
  width: 24px;
  display: flex; flex-direction: column;
  border-left: 1px solid #e4e7ec;
  border-radius: 0 6px 6px 0;
  overflow: hidden;
}
.num-wrap .num-btn {
  flex: 1;
  background: #f0f2f5;
  border: none;
  cursor: pointer;
  font-size: 8px;
  color: #666;
  display: flex; align-items: center; justify-content: center;
  padding: 0; margin: 0;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}
.num-wrap .num-btn:hover { background: #ffe8e8; color: #C00; }
.num-wrap .num-btn:active { background: #C00; color: #fff; }
.num-wrap .num-btn.up { border-bottom: 1px solid #e4e7ec; }
.num-wrap .num-btn svg { width: 7px; height: 5px; }

.result-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.overview-item {
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #eef0f3;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.overview-item.main {
  background: linear-gradient(135deg, #C00 0%, #8B0000 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(192,0,0,0.25);
}
.overview-item.main::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.overview-item .ov-label {
  font-size: 10px;
  color: #97a1b0;
  margin-bottom: 3px;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}
.overview-item.main .ov-label { color: rgba(255,255,255,0.85); }
.overview-item .ov-value {
  font-size: 22px;
  font-weight: 800;
  color: #C00;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}
.overview-item.main .ov-value {
  color: #fff;
  font-size: 28px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.overview-item .ov-value .unit { font-size: 11px; font-weight: 500; opacity: 0.7; margin-left: 2px; }
.overview-item .ov-note {
  font-size: 9px;
  color: #97a1b0;
  margin-top: 2px;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overview-item.main .ov-note { color: rgba(255,255,255,0.75); }
.overview-item .ov-value.green { color: #27ae60; }
.overview-item .ov-value.orange { color: #e67e22; }

.table-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #eef0f3;
}
.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.table-card-title { font-size: 13px; font-weight: 700; color: #2c3e50; display: flex; align-items: center; gap: 5px; }
.table-card-title .ico { font-size: 15px; }
.table-card-tip { font-size: 10px; color: #97a1b0; }

.year-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid #eef0f3;
}
.year-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  min-width: 920px;
  text-align: center;
}
.year-table thead tr { background: linear-gradient(135deg, #C00, #8B0000); color: #fff; }
.year-table th { padding: 6px 4px; font-weight: 600; border: 1px solid rgba(255,255,255,0.15); white-space: nowrap; font-size: 11px; }
.year-table tbody tr { border-bottom: 1px solid #f0f2f5; transition: background 0.2s; }
.year-table tbody tr:hover { background: #fafbfc; }
.year-table tbody tr:nth-child(even) { background: #fafbfc; }
.year-table tbody tr:nth-child(even):hover { background: #f5f6fa; }
.year-table td { padding: 5px 4px; border: 1px solid #f0f2f5; color: #555; white-space: nowrap; font-size: 11px; }
.year-table .val-red { color: #C00; font-weight: 700; }
.year-table .val-green { color: #27ae60; font-weight: 700; }
.year-table .val-total { color: #C00; font-weight: 800; font-size: 12px; background: #fff5f5; }
.year-table .val-gain { font-weight: 700; color: #27ae60; }
.year-table .val-gain.zero { color: #b8c0cc; }
.year-table .val-gain.negative { color: #e74c3c; }
.year-table .note { font-size: 10px; color: #97a1b0; text-align: left; white-space: normal; min-width: 130px; }
.year-table .row-base { background: #fff8e6 !important; }
.year-table .row-base td { font-weight: 600; }
.year-table .row-warning { background: #fff8e6 !important; }
.year-table .row-warning td { font-weight: 600; }
.year-table .row-danger { background: #fff0f0 !important; }
.year-table .row-danger td { color: #8B0000; }
.year-table .row-danger .val-total { color: #8B0000; background: #ffe0e0; }
.year-table .row-best { background: #e8f8ee !important; border-left: 3px solid #27ae60; }
.year-table .row-best td { font-weight: 600; }
.year-table .row-best .val-total { color: #1e8449; background: #d4f1de; }

.empty-tip {
  padding: 30px 16px;
  text-align: center;
  color: #97a1b0;
  font-size: 13px;
  line-height: 1.8;
}
.empty-tip strong { color: #C00; }

.table-tips {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px;
}
.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 7px 9px;
  background: #fafbfc;
  border-radius: 7px;
  border: 1px solid #eef0f3;
  font-size: 11px;
  line-height: 1.5;
  color: #555;
}
.tip-item .tip-icon { font-size: 12px; flex-shrink: 0; margin-top: 1px; }
.tip-item strong { color: #2c3e50; }
.tip-highlight {
  background: linear-gradient(135deg, #fff8e6, #fff3d6);
  border-color: #f0c040;
  grid-column: 1 / -1;
}
.tip-highlight strong { color: #b85c00; }
.tip-best {
  background: linear-gradient(135deg, #e8f8ee, #d4f1de);
  border-color: #27ae60;
  grid-column: 1 / -1;
}
.tip-best strong { color: #1e8449; }

.help-section {
  margin-top: 14px;
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #eef0f3;
}
.help-section summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  user-select: none;
}
.help-section summary::-webkit-details-marker { display: none; }
.help-section summary::before {
  content: '▶';
  font-size: 9px;
  color: #C00;
  transition: transform 0.2s;
}
.help-section[open] summary::before { transform: rotate(90deg); }
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.help-item {
  padding: 8px 10px;
  background: #fafbfc;
  border-radius: 7px;
  border-left: 2px solid #C00;
  font-size: 11px;
  line-height: 1.6;
  color: #555;
}
.help-item strong { color: #C00; }

.footer-note { text-align: center; font-size: 10px; color: #97a1b0; margin-top: 14px; line-height: 1.6; }

/* ========== 响应式 ========== */
@media (max-width: 1000px) {
  .nav-toggle { display: flex; }
  .nav-menu { position: absolute; top: 60px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); border-bottom: 1px solid #eef0f3; display: none; }
  .nav-menu.active { display: flex; }
  .nav-menu > li > a { padding: 12px 8px; border-radius: 0; border-bottom: 1px solid #f5f6fa; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 0 0 0 16px; min-width: auto; display: none; }
  .nav-menu > li:hover .dropdown { display: none; }
  .nav-menu > li.open .dropdown { display: block; }
}

@media (max-width: 720px) {
  .nav-inner { padding: 0 16px; height: 54px; }
  .nav-logo { font-size: 15px; }
  .nav-logo-icon { font-size: 19px; }
  .top-bar { padding: 10px 12px; }
  .top-bar h1 { font-size: 15px; }
  .top-bar p { font-size: 10px; }
  .main-wrap { padding: 10px 10px 30px; }
  .input-card { padding: 10px; border-radius: 8px; }
  .input-grid, .input-grid.grid-3 { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .input-divider { font-size: 10px; margin: 8px 0 6px; }
  .form-group > label { font-size: 10px; }
  input[type="number"], input[type="text"], select { padding: 5px 8px; font-size: 11px; border-radius: 6px; }
  .num-wrap > input[type="number"] { padding-right: 26px; }
  .num-wrap .num-btns { width: 22px; }
  .num-wrap .num-btn { font-size: 7px; }
  .result-overview { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .overview-item { padding: 8px 4px; border-radius: 8px; }
  .overview-item .ov-label { font-size: 9px; }
  .overview-item .ov-value { font-size: 18px; }
  .overview-item.main .ov-value { font-size: 22px; }
  .overview-item .ov-note { font-size: 8px; }
  .table-card { padding: 10px; border-radius: 8px; }
  .table-card-title { font-size: 12px; }
  .year-table { font-size: 10px; min-width: 860px; }
  .year-table th, .year-table td { padding: 4px 3px; font-size: 10px; }
  .year-table .note { min-width: 100px; font-size: 9px; }
  .year-table .val-total { font-size: 11px; }
  .table-tips { grid-template-columns: 1fr; gap: 5px; }
  .tip-item { font-size: 10px; padding: 6px 8px; }
  .help-section { padding: 10px; }
  .reset-btn { font-size: 9px; padding: 2px 8px; }
}

@media (max-width: 360px) {
  .input-grid, .input-grid.grid-3 { grid-template-columns: 1fr; }
  .result-overview { grid-template-columns: repeat(2, 1fr); }
}
/* ========== 表单区字段样式统一（覆盖上方推演区的全局 input 规则） ========== */
.form-right .form-field input,
.form-right .form-field select,
.form-right .form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d8d8d5;
  border-radius: 2px;
  font-size: 14px;
  font-family: inherit;
  color: #1c1c1c;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.form-right .form-field input:focus,
.form-right .form-field select:focus,
.form-right .form-field textarea:focus {
  border-color: #C00;
}

.form-right .form-field textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.form-right .form-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}