/* 继承自通用样式的部分 */
.page-header .subtitle { color: var(--muted-color, #666); margin-top: 6px; font-size: 14px; }
.page-header .header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-header .header-row h1 { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--primary-color, #2563eb); background: rgba(37, 99, 235, 0.06); border: 1px solid rgba(37, 99, 235, 0.25); padding: 8px 12px; border-radius: 8px; line-height: 1; transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.back-link i { font-size: 16px; }
.back-link span { font-weight: 600; font-size: 14px; }
.back-link:hover { background: rgba(37, 99, 235, 0.12); border-color: rgba(37, 99, 235, 0.35); transform: translateY(-1px); }

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px 28px;
}
.full-width {
  grid-column: 1 / -1;
}
.form-field { 
  display: flex; 
  flex-direction: column;
  position: relative; /* For expand button positioning */
}
.form-field label { font-weight: 600; margin-bottom: 8px; font-size: 15px; }
.form-field input, .form-field select {
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box; /* 确保padding不会影响总宽度 */
}
.form-actions { display: flex; justify-content: center; }

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  text-align: center;
}
.stat-item {
  background-color: #f9fafb;
  padding: 20px 15px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e5e7eb);
}
.stat-item .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color, #1d4ed8);
}
.stat-item .value.secondary {
  color: #16a34a; /* 绿色，用于税后收入 */
}
.stat-item .label {
  font-size: 14px;
  color: #6b7280;
  margin-top: 8px;
}
.muted {
  color: var(--muted-color, #666);
  font-size: 13px;
}

/* 税率表样式 */
.table-responsive {
  overflow-x: auto; /* 在小屏幕上允许水平滚动 */
  margin-top: 10px;
}
.tax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tax-table th, .tax-table td {
  border: 1px solid var(--border-color, #e5e7eb);
  padding: 10px 12px;
  text-align: left;
}
.tax-table thead th {
  background-color: #f9fafb;
  font-weight: 600;
  text-align: center;
}
.tax-table tbody tr:nth-child(odd) {
  background-color: #f9fafb;
}
.tax-table td:first-child, .tax-table td:nth-child(3), .tax-table td:nth-child(4) {
  text-align: center;
}

/* 新增：金额/比例联动输入框样式 */
.input-group-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-with-unit {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  padding-right: 32px; /* 为单位腾出空间 */
}

.input-with-unit .unit {
  position: absolute;
  right: 12px;
  color: #888;
  pointer-events: none; /* 确保单位文本不会干扰鼠标操作 */
}

/* 优化：输入框有值时的视觉区分 */
.form-field input:not(:placeholder-shown),
.form-field select:not(:placeholder-shown) {
  background-color: #f0f8ff; /* 浅蓝色背景 */
}

/* 新增：美化后的每月明细表样式 */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin-top: 10px;
}

.results-table thead th {
  text-align: left;
  font-weight: 600;
  color: #666;
  padding: 12px 15px;
  border-bottom: 2px solid #e5e7eb;
  background-color: transparent;
}

.results-table tbody td {
  text-align: left;
  padding: 15px;
  border-bottom: 1px solid #e5e7eb;
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

.results-table tbody tr:hover {
  background-color: #f9fafb;
}

/* 新增：逐月编辑功能样式 */
.expand-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 16px;
  font-weight: bold;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  color: #555;
  z-index: 10;
}
.expand-btn:hover {
  background: #e0e0e0;
  transform: scale(1.1);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.modal-header h4 {
  margin: 0;
  font-size: 18px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #888;
}
.modal-close-btn:hover {
  color: #000;
}

.monthly-editor-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.monthly-editor-item {
  display: flex;
  align-items: center;
  background: #f9fafb;
  padding: 8px;
  border-radius: 6px;
}

.monthly-editor-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.monthly-editor-item label {
  margin-left: 8px;
  font-size: 15px;
  font-weight: normal;
  margin-bottom: 0;
}