/* pages/finance.css - 财务页面 Premium */

/* ==================== 破产警告框 ==================== */
.bankruptcy-warning {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 40%, #ef9a9a 100%);
  border: 2px solid #e53935;
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: var(--sp-4);
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(229, 62, 53, 0.15), 0 4px 20px rgba(229, 62, 53, 0.2);
  animation: warning-pulse 2.5s ease-in-out infinite;
}

@keyframes warning-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(229, 62, 53, 0.15), 0 4px 20px rgba(229, 62, 53, 0.2); }
  50% { box-shadow: 0 0 0 5px rgba(229, 62, 53, 0.25), 0 4px 24px rgba(229, 62, 53, 0.35); }
}

.bw-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px var(--sp-3) 8px;
  background: linear-gradient(135deg, #c62828, #e53935);
  color: white;
}
.bw-icon { font-size: 22px; }
.bw-title { font-size: 16px; font-weight: 800; letter-spacing: 0.5px; }

.bw-desc {
  padding: 10px var(--sp-3) 12px;
  font-size: 14px;
  font-weight: 700;
  color: #b71c1c;
  line-height: 1.5;
}

.bw-stats {
  display: flex;
  gap: var(--sp-2);
  padding: 0 var(--sp-3) var(--sp-3);
}
.bw-stat {
  flex: 1;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  backdrop-filter: blur(4px);
}
.bw-stat-num {
  display: block;
  font-size: 20px;
  font-weight: 900;
  color: #c62828;
}
.bw-stat-label {
  display: block;
  font-size: 11px;
  color: var(--gray-600);
  font-weight: 600;
  margin-top: 2px;
}

.bw-consequences,
.bw-tips {
  padding: var(--sp-3);
  border-top: 1px solid rgba(198, 40, 40, 0.15);
}
.bw-consequences {
  background: rgba(198, 40, 40, 0.05);
}
.bw-tips {
  background: rgba(255, 255, 255, 0.5);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}
.bw-consequences h4,
.bw-tips h4 {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--gray-700);
}
.bw-consequences h4 { color: #c62828; }

.bw-consequences ul,
.bw-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bw-consequences li,
.bw-tips li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.5;
}

.bw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.bw-dot.red { background: #e53935; box-shadow: 0 0 4px rgba(229,62,53,0.4); }
.bw-dot.orange { background: #ff6f00; box-shadow: 0 0 4px rgba(255,111,0,0.3); }
.bw-dot.dark { background: #424242; box-shadow: 0 0 4px rgba(66,66,66,0.3); }

/* 破产倒计时 */
.bw-weeks {
  margin-left: auto;
  font-size: 12px;
  background: rgba(255,255,255,0.25);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
}
.bw-countdown { padding: var(--sp-2) var(--sp-3); }
.bw-countdown-bar {
  height: 8px;
  background: rgba(255,255,255,0.4);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.bw-countdown-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.bw-countdown-text { font-size: 12px; color: #c62828; font-weight: 600; }
.bw-urgent {
  padding: 8px var(--sp-3);
  background: #c62828;
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  animation: warning-pulse 1.5s ease-in-out infinite;
}
.finance-balance.bankrupt { background: linear-gradient(135deg, #ffcdd2, #ef9a9a); }
.health-badge.bankrupt { background: #e53935; color: white; }

/* ==================== 负值资金 ==================== */
.balance-amount.negative {
  color: #c62828 !important;
}

/* ==================== 负债信息栏 ==================== */
.bw-debt-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px var(--sp-3);
  background: rgba(198, 40, 40, 0.12);
  border-top: 1px solid rgba(198, 40, 40, 0.15);
}
.bw-debt-label {
  font-size: 13px;
  font-weight: 700;
  color: #b71c1c;
}
.bw-debt-amount {
  font-size: 20px;
  font-weight: 900;
  color: #c62828;
}

/* ==================== 惩罚时间线 ==================== */
.penalty-timeline {
  padding: var(--sp-2) 0;
}

.penalty-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  position: relative;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}
.penalty-timeline-item.active,
.penalty-timeline-item.current {
  opacity: 1;
}
.penalty-timeline-item.current {
  background: rgba(229, 62, 53, 0.06);
  border-radius: var(--radius-md);
  padding: 8px;
  margin: 0 -8px;
}

.ptl-marker {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  background: var(--gray-200);
  color: var(--gray-500);
  position: relative;
}

.penalty-timeline-item.active .ptl-marker {
  background: #e53935;
  color: white;
  box-shadow: 0 0 0 3px rgba(229, 62, 53, 0.2);
}
.penalty-timeline-item.current .ptl-marker {
  background: #ff6f00;
  color: white;
  animation: ptl-pulse 1.5s ease-in-out infinite;
}

@keyframes ptl-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(255, 111, 0, 0.3); }
}

/* 连接线 */
.penalty-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 36px;
  width: 2px;
  height: calc(100% - 8px);
  background: var(--gray-200);
}
.penalty-timeline-item.active:not(:last-child)::after {
  background: #e53935;
}

.ptl-week { font-size: 12px; font-weight: 900; }

.ptl-content {
  flex: 1;
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.5;
  padding-top: 4px;
}
.penalty-timeline-item.active .ptl-content {
  color: #c62828;
  font-weight: 600;
}
.penalty-timeline-item.current .ptl-content {
  color: #e65100;
  font-weight: 700;
}

.ptl-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}
.ptl-badge.passed {
  background: #ffcdd2;
  color: #c62828;
}
.ptl-badge.upcoming {
  background: #fff3e0;
  color: #e65100;
  animation: ptl-badge-flash 1.5s ease-in-out infinite;
}
@keyframes ptl-badge-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==================== 强制出售球员预览 ==================== */
.penalty-victim {
  margin: var(--sp-2) 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  border: 1px dashed #ef9a9a;
}

.pv-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--sp-2);
}
.pv-icon { font-size: 16px; }
.pv-label {
  font-size: 12px;
  font-weight: 700;
  color: #c62828;
}

.pv-player {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-2);
}
.pv-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--gray-800);
}
.pv-pos {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--primary-light, #e3f2fd);
  color: var(--primary, #1565c0);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.pv-rating {
  font-size: 10px;
  padding: 1px 6px;
  background: #fff3e0;
  color: #e65100;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.pv-prices {
  display: flex;
  gap: var(--sp-2);
}
.pv-price-item {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-sm);
}
.pv-price-item.loss {
  background: rgba(229, 62, 53, 0.08);
}
.pv-price-label {
  display: block;
  font-size: 10px;
  color: var(--gray-500);
  font-weight: 600;
}
.pv-price-value {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-800);
}
.pv-price-item.loss .pv-price-value {
  color: #c62828;
}

/* ==================== 惩罚总览 ==================== */
.penalty-summary {
  margin-top: var(--sp-2);
}
.penalty-summary h4 {
  font-size: 13px;
  font-weight: 800;
  color: #c62828;
  margin-bottom: 6px;
}

/* ==================== 禁令状态 ==================== */
.penalty-bans {
  margin-top: var(--sp-2);
  background: rgba(229, 62, 53, 0.08);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  border: 1px solid #ef9a9a;
}

.ban-header {
  font-size: 13px;
  font-weight: 800;
  color: #c62828;
  margin-bottom: var(--sp-2);
}

.ban-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ban-item {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  padding: 4px 0;
}
.ban-item.active {
  color: #c62828;
}

.ban-note {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px dashed var(--gray-300);
}

/* ==================== 救助方案 ==================== */
.rescue-solutions { margin-bottom: var(--sp-4); }
.rescue-cards { display: flex; flex-direction: column; gap: var(--sp-2); }
.rescue-card {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  cursor: default;
}
.rescue-card-icon { font-size: 32px; flex-shrink: 0; }
.rescue-card-body { flex: 1; min-width: 0; }
.rescue-card-body h4 { font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.rescue-card-body p { font-size: 12px; color: var(--gray-600); margin: 0; line-height: 1.4; }
.rescue-card button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==================== 广告弹窗 ==================== */
.ad-modal { text-align: center; padding: var(--sp-4); }
.ad-simulate { padding: 20px; }
.ad-icon { font-size: 48px; margin-bottom: var(--sp-2); }
.ad-timer {
  font-size: 36px;
  font-weight: 900;
  color: #1565c0;
  margin: var(--sp-2) 0;
}

/* ==================== 活跃贷款 ==================== */
.finance-active-loans { margin-bottom: var(--sp-4); }
.loan-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.loan-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}
.loan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-2); }
.loan-bank { font-size: 14px; font-weight: 800; color: #534ab7; }
.loan-amount { font-size: 16px; font-weight: 800; color: var(--gray-800); }
.loan-progress { margin-bottom: var(--sp-2); }
.loan-progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.loan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7f77dd, #534ab7);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.loan-progress-text { font-size: 11px; color: var(--gray-500); font-weight: 600; }
.loan-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-600);
}
.btn-repay-early { font-size: 11px; padding: 3px 10px; }

/* ==================== NPC借贷市场 ==================== */
.loan-market { display: flex; flex-direction: column; gap: var(--sp-2); }
.loan-option {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  border: 1px solid #c5cae9;
  box-shadow: var(--shadow-xs);
}
.loan-option-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-2); }
.loan-option .loan-bank { font-size: 15px; font-weight: 800; }
.loan-option .loan-amount { font-size: 18px; font-weight: 900; color: #534ab7; }
.loan-option-details { margin-bottom: var(--sp-2); }
.loan-detail-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: var(--gray-700); }
.loan-detail-row.total { font-weight: 800; border-top: 1px solid var(--gray-200); padding-top: var(--sp-1); color: #c62828; }
.loan-option button { width: 100%; }

/* ==================== 轻量警告提示条 ==================== */
.finance-warning-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--sp-3);
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border: 1px solid #ffe082;
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
  font-size: 13px;
  font-weight: 600;
  color: #e65100;
  box-shadow: var(--shadow-xs);
}
.fwt-icon { font-size: 18px; flex-shrink: 0; }
.finance-warning-tip strong { color: #c62828; }

/* ==================== 原有样式 ==================== */
.finance-header {
  text-align: center; padding: var(--sp-4) var(--sp-3);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(0,0,0,0.04);
}
.finance-header h2 { font-size: 20px; font-weight: 800; }

.finance-balance {
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-3);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.finance-balance.healthy { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); }
.finance-balance.warning { background: linear-gradient(135deg, #fff8e1, #ffecb3); }
.finance-balance.danger { background: linear-gradient(135deg, #ffebee, #ffcdd2); }
.balance-label { display: block; font-size: 13px; color: var(--gray-500); font-weight: 600; }
.balance-amount { display: block; font-size: 30px; font-weight: 800; color: var(--gray-800); margin-top: var(--sp-1); }
.health-badge {
  font-size: 12px; padding: 3px 12px;
  border-radius: var(--radius-full);
  margin-top: var(--sp-2); display: inline-block;
  font-weight: 700;
}
.health-badge.healthy { background: #a5d6a7; color: #1b5e20; }
.health-badge.warning { background: #ffe082; color: #e65100; }
.health-badge.danger { background: #ef9a9a; color: #b71c1c; }

.finance-overview {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-2); margin-bottom: var(--sp-4);
}
.finance-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  text-align: center;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}
.finance-label { display: block; font-size: 11px; color: var(--gray-500); font-weight: 600; }
.finance-amount { display: block; font-size: 16px; font-weight: 800; margin-top: var(--sp-1); }
.finance-card.income .finance-amount { color: #2e7d32; }
.finance-card.expense .finance-amount { color: #c62828; }
.finance-card.positive .finance-amount { color: #2e7d32; }
.finance-card.negative .finance-amount { color: #c62828; }

.detail-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--sp-4);
}
.detail-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
}
.detail-row:last-child { border-bottom: none; }
.detail-row.total { font-weight: 800; border-top: 2px solid var(--gray-300); padding-top: var(--sp-2); }
.detail-row.total span { color: var(--gray-800); }

/* 球员工资展开/折叠 */
.detail-row.expandable {
  cursor: pointer;
  font-weight: 700;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--duration-fast);
}
.detail-row.expandable:active { background: var(--gray-50); }
.expand-arrow {
  font-size: 10px;
  color: var(--gray-400);
  margin: 0 6px;
  transition: transform 0.25s ease;
}
.expand-label { flex: 1; }

.detail-sub-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.detail-sub-list.open {
  max-height: 2000px;
}
.detail-row.sub {
  font-size: 12px;
  padding: 6px 0 6px 8px;
  color: var(--gray-700);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  border-radius: 0;
}
.detail-row.sub:last-child { border-bottom: none; }
.player-wage-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.player-wage-name span {
  flex-shrink: 0;
}
.pos-tag {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--primary-light, #e3f2fd);
  color: var(--primary, #1565c0);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.rating-tag {
  font-size: 10px;
  padding: 1px 6px;
  background: #fff3e0;
  color: #e65100;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.history-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}
.history-item {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--gray-100);
}
.history-item:last-child { border-bottom: none; }
.history-header { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.history-net { font-weight: 800; }
.history-net.positive { color: #2e7d32; }
.history-net.negative { color: #c62828; }
.history-details {
  font-size: 11px; color: var(--gray-500);
  margin-top: 3px; display: flex; gap: var(--sp-4);
}

/* ==================== 交易记录 ==================== */
.finance-transactions {
  margin-top: var(--sp-4);
}

.tx-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--sp-3);
  border-bottom: 1px solid var(--gray-50);
  transition: background var(--duration-fast);
}
.tx-item:last-child { border-bottom: none; }
.tx-item:active { background: var(--gray-50); }

.tx-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.tx-type-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--radius-md);
}

.tx-info {
  min-width: 0;
}

.tx-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-detail {
  display: block;
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-right {
  text-align: right;
  flex-shrink: 0;
  padding-left: var(--sp-2);
}

.tx-amount {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.tx-item.income .tx-amount { color: #2e7d32; }
.tx-item.expense .tx-amount { color: #c62828; }

.tx-time {
  display: block;
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 2px;
  font-weight: 500;
}

.tx-empty {
  text-align: center;
  padding: 24px var(--sp-3);
  color: var(--gray-400);
  font-size: 13px;
}
