:root {
  --bg: #f0f0f0;
  --card: #fff;
  --text: #333;
  --text-dim: #555;
  --muted: #888;
  --link: #004b8d;
  --link-hover: #003366;
  --accent: #4c7b25;
  --accent-hover: #3d6520;
  --gold: #e8c520;
  --gold-bg: #fdf8e1;
  --line: #ccc;
  --line-light: #ddd;
  --font: Arial, Helvetica, sans-serif;
  --wrap: 820px;
  --r: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }

/* header */
.site-header {
  background: #003366;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.site-logo:hover { color: #ddd; text-decoration: none; }
.logo-icon { font-size: 1.1rem; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  padding: .4rem .7rem;
  font-size: .82rem;
  color: rgba(255,255,255,.85);
  border-radius: 3px;
}
.nav-links a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav-links a.active { background: rgba(255,255,255,.2); color: #fff; }
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #fff;
}

/* main */
.page-content {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.page-intro {
  font-size: .95rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.breadcrumb {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb span { margin: 0 .3rem; }

h1 {
  font-size: 1.55rem;
  font-weight: 700;
  color: #003366;
  margin-bottom: .4rem;
  line-height: 1.3;
}
h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 .8rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
  color: #003366;
}
h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.2rem 0 .4rem;
}

/* calculator */
.calc-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem;
  margin: 1rem 0 2rem;
}
.calc-tabs { display: flex; gap: 0; margin-bottom: 1.2rem; flex-wrap: wrap; }
.calc-tab {
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  background: #e9e9e9;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text);
  font-family: var(--font);
  margin-right: -1px;
}
.calc-tab:first-child { border-radius: var(--r) 0 0 var(--r); }
.calc-tab:last-child { border-radius: 0 var(--r) var(--r) 0; }
.calc-tab:hover { background: #ddd; }
.calc-tab.active { background: var(--card); border-bottom-color: var(--card); color: var(--link); font-weight: 700; }

.calc-form { margin-bottom: 1rem; }
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: .8rem; }

.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .25rem;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: .95rem;
  font-family: var(--font);
  background: #fff;
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--link);
}

.btn-calc {
  background: var(--accent);
  color: #fff;
  border: 1px solid #3a5e18;
  padding: .55rem 1.8rem;
  border-radius: var(--r);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  width: 100%;
}
.btn-calc:hover { background: var(--accent-hover); }
.btn-calc:active { background: #345b1a; }

/* results */
.calc-result {
  background: #f5f5dc;
  border: 1px solid #d4c87a;
  border-radius: var(--r);
  padding: 1.2rem;
  text-align: center;
  display: none;
  margin-top: 1rem;
}
.calc-result.show { display: block; }
.result-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .2rem;
}
.result-value { font-size: 1.7rem; font-weight: 700; color: #003366; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .5rem;
  margin-top: .8rem;
}
.result-card {
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: var(--r);
  padding: .6rem;
  text-align: center;
}
.rc-label { font-size: .72rem; color: var(--muted); margin-bottom: .1rem; }
.rc-value { font-size: 1.05rem; font-weight: 700; color: #003366; }

/* articles */
.article-body { margin-top: .8rem; }
.article-body p { margin-bottom: .9rem; }
.article-body ul,
.article-body ol { margin: .6rem 0 1rem 1.5rem; }
.article-body li { margin-bottom: .3rem; }
.article-body code {
  background: #f4f4f4;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: .9em;
}

/* tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .9rem;
}
thead { background: #003366; color: #fff; }
th { padding: .55rem .7rem; font-size: .82rem; font-weight: 700; text-align: left; }
td { padding: .5rem .7rem; border: 1px solid var(--line-light); }
tbody tr:nth-child(even) { background: #f9f9f9; }
tbody tr:hover { background: #f0f0e8; }

/* callout */
.info-box {
  padding: .8rem 1rem;
  border-radius: var(--r);
  margin: .8rem 0 1.2rem;
  font-size: .9rem;
  border-left: 3px solid;
}
.info-box.tip { background: var(--gold-bg); border-color: var(--gold); color: #5c4d00; }
.info-box.warning { background: #fff3cd; border-color: #e6a817; color: #664d03; }
.info-box.info { background: #e8f0fe; border-color: #3b82f6; color: #1e3a5f; }

/* FAQ */
.faq-section { margin: .8rem 0 1.5rem; }
.faq-item {
  border: 1px solid var(--line-light);
  margin-bottom: .4rem;
  background: var(--card);
}
.faq-question {
  display: block;
  width: 100%;
  text-align: left;
  padding: .7rem 2rem .7rem .9rem;
  background: none;
  border: none;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text);
  position: relative;
}
.faq-question::after {
  content: '+';
  position: absolute;
  right: .9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--muted);
}
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer { display: none; padding: 0 .9rem .7rem; color: var(--text-dim); font-size: .9rem; }
.faq-item.open .faq-answer { display: block; }

/* sidebar links */
.sidebar-links {
  background: #f7f7f0;
  border: 1px solid var(--line-light);
  border-radius: var(--r);
  padding: 1rem;
  margin: 2rem 0;
}
.sidebar-links h3 { margin-top: 0; font-size: 1rem; }
.sidebar-links ul { list-style: none; padding: 0; margin: .4rem 0 0; }
.sidebar-links li { margin: .3rem 0; }
.sidebar-links a {
  font-size: .88rem;
  display: block;
  padding: .3rem .5rem;
  border-radius: 3px;
}
.sidebar-links a:hover { background: #eee; text-decoration: none; }

/* stat cards */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  margin: 1.2rem 0;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line-light);
  border-radius: var(--r);
  padding: .8rem;
  text-align: center;
}
.stat-icon { font-size: 1.2rem; margin-bottom: .2rem; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: #003366; }
.stat-label { font-size: .72rem; color: var(--muted); margin-top: .1rem; }

/* countdown */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .6rem;
  margin: 1rem 0;
}
.countdown-card {
  background: var(--card);
  border: 1px solid var(--line-light);
  border-radius: var(--r);
  padding: .8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cd-name { font-weight: 700; font-size: .88rem; }
.cd-date { font-size: .75rem; color: var(--muted); }
.cd-days { font-size: 1.1rem; font-weight: 700; color: #003366; white-space: nowrap; }

/* footer */
.site-footer {
  background: #003366;
  color: #aab;
  margin-top: 2rem;
  font-size: .85rem;
}
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
}
.footer-brand h3 { color: #fff; font-size: 1rem; margin-bottom: .3rem; }
.footer-brand p { font-size: .82rem; line-height: 1.5; }
.footer-col h4 { color: #fff; font-size: .88rem; margin-bottom: .5rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin: .25rem 0; }
.footer-col a { color: #8899aa; font-size: .82rem; }
.footer-col a:hover { color: #ddd; }
.footer-bottom {
  text-align: center;
  padding: .8rem 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .78rem;
  color: #667;
}

@media (max-width: 768px) {
  h1 { font-size: 1.3rem; }
  .calc-row { grid-template-columns: 1fr; }
  .calc-box { padding: 1rem; }
  .mobile-menu-btn { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0; right: 0;
    background: #003366;
    border-bottom: 1px solid #004;
    flex-direction: column;
    padding: .8rem;
  }
  .nav-links.open { display: flex; }
  .footer-inner { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-stats { grid-template-columns: repeat(2, 1fr); }
  .countdown-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .page-content { padding: 1rem .8rem 2rem; }
  .result-value { font-size: 1.3rem; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
}
