:root {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #0f766e; /* Teal - Trust & Labor */
  --primary-hover: #115e59;
  --primary-light: #f0fdfa;
  --accent-emerald: #059669;
  --accent-blue: #2563eb;
  --accent-amber: #d97706;
  --font-sans: 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 導航 */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-badge {
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 3px 8px;
  border-radius: 6px;
}

.brand-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.1rem;
}

.nav-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #99f6e4;
}

/* 主內容區 */
.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px;
  flex: 1;
  width: 100%;
}

.hero-section {
  text-align: center;
  margin-bottom: 28px;
}

.hero-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  border: 1px solid #cbd5e1;
}

.hero-section h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.hero-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto;
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  background-color: #f8fafc;
  color: var(--text-main);
  transition: all 0.2s;
  min-width: 0;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

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

.input-with-unit input {
  padding-right: 65px;
}

.input-with-unit .unit {
  position: absolute;
  right: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 12px 24px;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #0f766e;
  color: #ffffff;
}

.btn-secondary:hover {
  background: #115e59;
}

.btn-outline {
  background: #ffffff;
  color: #334155;
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: #f1f5f9;
}

/* 結果卡 */
.result-card {
  border-top: 6px solid var(--primary);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.result-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.tenure-badge {
  font-size: 0.88rem;
  color: var(--primary);
  font-weight: 700;
}

.total-amount {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--primary);
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.breakdown-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.item-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.law-ref {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
}

.item-amount {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.text-emerald { color: var(--accent-emerald); }
.text-blue { color: var(--accent-blue); }
.text-amber { color: var(--accent-amber); }

.item-desc {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

.action-bar {
  text-align: center;
}

/* 守則指南 */
.guide-card h2 {
  font-size: 1.25rem;
  margin-bottom: 18px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 768px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

.guide-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f8fafc;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.guide-num {
  background: var(--primary);
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.guide-text h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #0f172a;
}

.guide-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer-notice {
  text-align: center;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 10px;
  margin-bottom: 24px;
}

.home-link-wrap {
  margin-top: 20px;
}

.footer {
  border-top: 1px solid var(--border-color);
  background: #ffffff;
  padding: 20px;
  text-align: center;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.footer-brand {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 4px;
}

.hidden {
  display: none !important;
}
