/* 由 social.html 内联样式抽出（内容不变，便于缓存） */

/* ====== Social Insurance — Alipay City Service style ====== */
.page-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 16px;
}

/* Header area */
.page-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.page-header .header-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f5f5f5;
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: all 0.2s;
}
.search-bar:focus-within {
  background: #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.search-bar .search-icon {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
  color: var(--text);
  font-family: inherit;
}
.search-bar input::placeholder { color: var(--text-placeholder); }
.search-bar .clear-btn {
  display: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border: none;
  background: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}
.search-bar .clear-btn.show {
  display: flex;
}
.search-bar .clear-btn:active {
  background: #e8e8e8;
}

/* Section labels */
.section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-label .label-icon {
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

/* City chips with animation */
.city-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.city-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.city-chip:active {
  transform: scale(0.94);
}
.city-chip.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.city-chip.selected:active {
  background: var(--primary-dark);
}
.city-chip.custom-chip {
  background: #fffbf0;
  border-color: #f59e0b;
  color: #92400e;
}
.city-chip.custom-chip.selected {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}
.city-chip .hot-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--danger-light);
  color: var(--danger);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 2px;
}
/* 选中热门城市时保留「热」徽标（避免 chip 宽度变化导致换行重排），并适配选中底色 */
.city-chip.selected .hot-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Salary input - prominent */
.salary-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.salary-card .salary-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.salary-card .salary-input-wrap {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.salary-card .salary-input-wrap .currency {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.salary-card .salary-input-wrap .salary-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-family: inherit;
  line-height: 1.1;
  letter-spacing: -1px;
  min-width: 0;
  -moz-appearance: textfield;
}
.salary-card .salary-input-wrap .salary-number::-webkit-outer-spin-button,
.salary-card .salary-input-wrap .salary-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.salary-card .salary-unit {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
}
.salary-card .base-info {
  margin-top: 10px;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.salary-card .base-info .base-value {
  color: var(--text);
  font-weight: 600;
}
.salary-card .base-info .alert-text {
  color: var(--warning);
  font-weight: 500;
}

/* Result hero area */
.result-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  text-align: center;
  position: relative;
  overflow-y: auto;
}
.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}
.result-card .result-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.result-card .result-takehome {
  margin-bottom: 4px;
}
.result-card .result-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Breakdown grid inside result card */
.result-breakdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.result-breakdown .rb-item {
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.result-breakdown .rb-item .rb-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.result-breakdown .rb-item .rb-value {
  font-size: 17px;
  font-weight: 700;
}
.result-breakdown .rb-item .rb-value.negative {
  color: var(--danger);
}
.result-breakdown .rb-item .rb-value.positive {
  color: var(--primary);
}
.result-breakdown .rb-item .rb-value.company {
  color: var(--blue);
}

/* Insurance toggle card */
.toggle-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.toggle-card .toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.toggle-card .toggle-header .toggle-title {
  font-size: 14px;
  font-weight: 600;
}
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toggle-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  padding: 8px 0;
  min-height: 44px;
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
}
.toggle-item:last-child {
  border-bottom: none;
}
.toggle-item .toggle-label {
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}
.toggle-item .toggle-label .toggle-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.toggle-item .toggle-label .rate-info {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 费率可编辑输入（城市默认值可改；固定列宽，不与开关重叠） */
.toggle-item .rate-edits { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.toggle-item .rate-edits .re { display: inline-flex; align-items: center; gap: 1px; }
.toggle-item .rate-edits .re.off { font-size: 11px; color: var(--text-muted); min-width: 38px; }
.toggle-item .rate-edits .rate-inp { width: 44px; padding: 4px 2px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; text-align: center; min-height: 32px; box-sizing: border-box; font-family: inherit; background: #fff; }
.toggle-item .rate-edits em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.toggle-card .toggle-header .rate-reset { font-size: 12px; color: var(--blue); cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; }

/* iOS-style switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  min-height: 44px;
  flex-shrink: 0;
  margin-left: auto;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 50%;
  right: 0;
  bottom: auto;
  left: 0;
  height: 31px;
  margin-top: -15.5px;
  background: #e9e9ea;
  border-radius: 31px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.switch .slider::before {
  content: '';
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.switch input:checked + .slider {
  background: var(--primary);
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* Housing fund rate card */
.rate-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.rate-card .rate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.rate-card .rate-header .rate-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rate-card .rate-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.rate-card .rate-row:last-child {
  margin-bottom: 0;
}
.rate-card .rate-row .rate-label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 54px;
}
.rate-card .rate-row select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fafafa;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.rate-card .rate-row select:focus {
  border-color: var(--primary);
  background: #fff;
}
.rate-card .rate-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  padding: 6px 10px;
  background: #f9fafb;
  border-radius: 6px;
  line-height: 1.4;
}
/* 未缴纳公积金时：基数和比例置灰不可编辑（开关保留可再勾选） */
#housingFields.off { opacity: 0.4; pointer-events: none; }

/* Detail table */
.detail-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.detail-card .detail-card-title {
  font-size: 14px;
  font-weight: 600;
  padding: 0 20px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-card .detail-card-title .detail-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: auto;
}
/* 折叠说明区：默认折叠，点击标题展开 */
.detail-card.col-section .detail-card-title{cursor:pointer;-webkit-tap-highlight-color:transparent;justify-content:space-between;min-height:44px;padding-bottom:0;}
.detail-card.col-section .detail-card-title>span{color:var(--text-muted);transition:transform 0.25s;display:inline-block;}
.detail-card.col-section .col-body{display:none;padding-top:12px;}
.detail-card.col-section.open .col-body{display:block;}
.detail-card.col-section.open .detail-card-title>span{transform:rotate(90deg);}

/* Custom city panel */
.custom-panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  display: none;
  animation: fadeInUp 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.custom-panel.show {
  display: block;
}
.custom-panel .custom-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #92400e;
}
.custom-panel .custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.custom-panel .custom-grid .input-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 0;
}
.custom-panel .custom-grid .input-row label {
  font-size: 11px;
  color: var(--text-muted);
  min-width: auto;
}
.custom-panel .custom-grid .input-row input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fafafa;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}
.custom-panel .custom-grid .input-row input:focus {
  border-color: var(--primary);
  background: #fff;
}
.custom-panel .input-row .unit {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-fade-up {
  animation: fadeInUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Empty search state */
.search-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
  display: none;
}
.search-empty.show {
  display: block;
}

/* Responsive */
@media (max-width: 420px) {
  .page-wrap { padding: 12px; }
  .salary-card .salary-input-wrap .salary-number { font-size: 30px; }
}
