:root {
  --bg: #1b1b1f;          /* 深灰底 */
  --card: #24262b;        /* 稍浅的卡片灰 */
  --accent: #d18b47;      /* 枫木/铜橙色主色调 */
  --muted: #9ca3af;       /* 次要文字灰 */
  --border: #2f3238;      /* 边框线灰 */
}

* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  margin: 0;
  color: #e5e7eb;
}
.container {
  max-width: 820px;
  margin: 36px auto;
  padding: 20px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
}
h1 { 
  margin: 0 0 6px 0; 
  text-align: center; 
  color: var(--accent);
}

/* 描述文本 */
.container > p.description { 
  margin: 0 0 18px 0; 
  text-align: center; 
  color: #cbd5e1; 
  font-size: 16px; 
  font-weight: 600; 
}

/* 四列布局 */
.row { 
  display: flex; 
  gap: 12px; 
  margin-bottom: 12px; 
  flex-wrap: wrap;
}
.col { flex: 1; min-width: 150px; } 
label { display: block; font-size: 13px; color: var(--muted); }
input, select { 
  width: 100%; 
  padding: 10px 12px; 
  font-size: 15px; 
  border-radius: 8px; 
  border: 1px solid var(--border); 
  margin-top: 6px; 
  background: #1e2024; 
  color: #f1f5f9; 
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(209, 139, 71, 0.3);
}

.block { margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--border); }
#incomesArea h3, #expensesArea h3 { margin: 6px 0; color: var(--accent); }

.income-row, .expense-row { display:flex; gap:8px; align-items:center; margin:6px 0; }
.income-row input[type="number"], .expense-row input[type="number"] { width:160px; }
.income-row label, .expense-row label { flex: 1; font-weight: 600; color: #f3f4f6; }

button { 
  padding: 10px 14px; 
  border-radius: 8px; 
  border: none; 
  background: var(--accent); 
  color: #fff; 
  font-weight: 600; 
  cursor: pointer; 
  transition: background 0.2s ease, transform 0.1s ease;
}
button:hover {
  background: #e39b55;
  transform: translateY(-1px);
}
button.muted { 
  background: #2f3238; 
  color: #d1d5db; 
  margin-left: 8px; 
}
button.muted:hover {
  background: #3a3e45;
}

.hint { color: var(--muted); display:block; margin-top:6px; }

.hidden { display: none; }

#resultList { padding-left: 0; list-style: none; margin: 8px 0; }
#resultList li { background:#2b2d31; padding:8px 10px; margin-bottom:6px; border-radius:6px; color: #e5e7eb; }

/* SUMMARY (盈余/赤字) */
.summary { 
  margin-top:10px; 
  padding:14px 10px;
  background: rgba(64, 160, 84, 0.1); 
  border-left:5px solid #4caf50;
  border-radius:6px; 
  color:#b8f5b8; 
  font-size: 18px; 
  font-weight: 700; 
  text-align: center; 
}
.summary.warning { 
  background: rgba(255, 159, 67, 0.1); 
  border-left:5px solid #fb923c; 
  color:#f6ad55; 
}

/* DISCLAIMER */
.disclaimer-area {
  margin-top: 25px; 
  padding: 15px;
  border-top: none; 
  background: #1e2024; 
  border-radius: 8px;
  color: #9ca3af; 
  font-size: 13px;
  line-height: 1.6;
}
.disclaimer-area h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--accent);
}
.disclaimer-area p {
  text-align: left; 
  margin: 0;
  font-weight: normal; 
}

/* NAVIGATION */
.main-nav {
  margin-top: -10px; 
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
}
.main-nav li {
  margin: 0 15px;
}
.main-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 0;
  display: block;
  font-weight: 600;
  transition: color 0.2s, border-bottom 0.2s;
  font-size: 16px;
}
.main-nav a:hover {
  color: #e5e7eb;
}
.main-nav a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -2px;
}

/* ABOUT PAGE */
#page-about {
  background: var(--card);
  border-radius: 10px;
  padding: 24px;
  color: #e5e7eb;
  line-height: 1.7;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  animation: fadeIn 0.3s ease-in-out;
}

#page-about h2 {
  color: var(--accent);
  text-align: center;
  margin-bottom: 16px;
}

#page-about p {
  font-size: 15px;
  color: #d1d5db;
  margin-bottom: 14px;
}

#page-about strong {
  color: var(--accent);
  font-weight: 600;
}

/* Smooth fade when switching tabs */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
