/* Taiwan Agri Price - Design System */

:root {
    --green: #21614b;
    --dark: #203e34;
    --muted: #79847e;
    --soft: #f2f5ee;
    --line: #e5e9e0;
    --red: #dc2626;
    --bg: #f8f9f4;
    --card: #fff;
    --shadow: 0 12px 30px rgba(32,74,52,0.06);
    --radius: 22px;
}

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

body {
    background: var(--bg);
    color: var(--dark);
    font-family: 'Noto Sans TC', system-ui, sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ==========================================
   Header
   ========================================== */
header { background: #fff; border-bottom: 1px solid var(--line); }

.nav {
    max-width: 1160px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 23px 28px;
}

.logo a {
    text-decoration: none;
    display: flex;
    gap: 12px;
    align-items: center;
}

.logo a:before {
    content: '葉';
    display: grid;
    place-items: center;
    background: var(--green);
    color: #fff;
    width: 43px;
    height: 43px;
    border-radius: 14px;
    font-size: 23px;
}

.logo h1 { font-size: 19px; margin: 0; letter-spacing: 1px; }
.logo p { font-size: 11px; margin: 4px 0 0; color: var(--muted); letter-spacing: 2px; }

.menu { display: flex; gap: 34px; }
.menu a { text-decoration: none; color: var(--muted); padding: 10px 0; }
.menu a.active { color: var(--green); border-bottom: 2px solid var(--green); font-weight: 700; }
.menu a:hover { color: var(--green); }

.header-actions { display: none; }
.menu-toggle { border: 1px solid var(--line); background: white; padding: 7px 10px; border-radius: 8px; }
.mobile-menu { display: none; }
.mobile-menu.open { display: flex; padding: 12px 20px; gap: 22px; background: #fff; border-bottom: 1px solid var(--line); }
.mobile-menu a { text-decoration: none; color: var(--dark); }

/* ==========================================
   Hero / Main / Footer layout
   ========================================== */
.hero, main { max-width: 1104px; margin: auto; }
.hero { position: relative; padding: 32px 0 0; }
.hero h2 { font-size: 32px; letter-spacing: 1px; margin: 0 0 22px; }
.lead { font-size: 15px; color: var(--muted); margin-bottom: 16px; }

/* ==========================================
   Tags
   ========================================== */
.tag {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--dark);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
}
.tag:hover, .tag.active {
    background: var(--green);
    color: #fff;
}

/* ==========================================
   Panels / Cards
   ========================================== */
.content-panel {
    border: 1px solid var(--line);
    background: white;
    border-radius: 18px;
    padding: 26px 28px;
    margin-bottom: 22px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
}

.section { margin-bottom: 22px; }

.section h3 {
    font-size: 18px !important;
    letter-spacing: .3px;
}
.section h3:before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--green);
    opacity: 0.6;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: -2px;
}

.headline {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 16px;
}

/* ==========================================
   Grid
   ========================================== */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* ==========================================
   Tables
   ========================================== */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.table th {
    color: var(--muted);
    font-weight: 500;
    background: #f6f8f3;
    font-size: 13px;
}
.table th:first-child, .table td:first-child { text-align: left; }
.table td, .table th {
    padding: 16px 18px;
    font-size: 13px;
    border-bottom: 1px solid #edf0e9;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbf7; }

/* Price change badges */
.up { color: #b06341; background: #fcf0e8; border-radius: 7px; padding: 5px 8px; }
.down { color: #41816b; background: #edf6ef; border-radius: 7px; padding: 5px 8px; }
.muted { color: var(--muted); }

/* ==========================================
   Footer
   ========================================== */
footer {
    border-top: 1px solid var(--line);
    max-width: 1104px;
    margin: auto;
    padding: 35px 0;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    color: var(--muted);
    font-size: 12px;
}
footer h4, footer span { color: var(--dark); font-weight: 700; }
footer a { display: block; text-decoration: none; margin: 9px 0; }
footer p a { display: inline; }

.copyright {
    text-align: center;
    color: #9aa29b;
    padding: 18px;
    border-top: 1px solid var(--line);
    font-size: 11px;
}

/* ==========================================
   Accessibility
   ========================================== */
a:focus-visible, button:focus-visible {
    outline: 3px solid #d49b57;
    outline-offset: 4px;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1180px) {
    .hero, main, footer { margin-left: 28px; margin-right: 28px; }
}

@media (max-width: 700px) {
    .nav { padding: 16px 20px; }
    .menu { display: none; }
    .header-actions { display: block; }
    .mobile-menu.open { display: flex; flex-direction: column; }
    .hero, main, footer { margin-left: 18px; margin-right: 18px; }
    .hero { padding-top: 22px; }
    .hero h2 { font-size: 27px; }
    .content-panel { padding: 20px 16px; }
    .table td, .table th { padding: 14px 12px; }
    .grid2 { grid-template-columns: 1fr; }
    .grid3 { grid-template-columns: 1fr; }
    footer { grid-template-columns: 1fr 1fr; gap: 15px; }
    footer > div:first-child { grid-column: 1 / -1; }
}
