:root {
    --home-bg: #f7f3ed;
    --home-surface: #fffdf9;
    --home-surface-soft: #fbf7f1;
    --home-line: #eadfd3;
    --home-line-strong: #dfd0c1;
    --home-text: #252421;
    --home-muted: #756e66;
    --home-coral: #ef7354;
    --home-coral-dark: #d95f43;
    --home-coral-soft: #fff0e9;
    --home-teal: #197a74;
    --home-teal-soft: #eaf6f2;
    --home-shadow: 0 16px 42px rgba(88, 67, 44, .075);
    --home-shadow-hover: 0 22px 50px rgba(88, 67, 44, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.public-home-body {
    margin: 0;
    color: var(--home-text);
    background:
        radial-gradient(circle at 4% 7%, rgba(255, 227, 208, .36), transparent 23%),
        radial-gradient(circle at 94% 78%, rgba(219, 244, 236, .38), transparent 24%),
        var(--home-bg);
    font-family: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.public-home-main { width: 100%; overflow: clip; }
.home-container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
a { color: inherit; text-decoration: none; }
section[id] { scroll-margin-top: 96px; }

.home-eyebrow {
    margin: 0 0 8px;
    color: var(--home-coral);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

/* Shared controls */
.home-btn,
.home-link-btn,
.home-card-action,
.home-empty-state > a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 0 17px;
    font-size: 13px;
    font-weight: 900;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.home-btn:hover,
.home-link-btn:hover,
.home-card-action:hover,
.home-empty-state > a:hover { transform: translateY(-2px); }
.home-btn-primary {
    border: 1px solid var(--home-coral);
    color: #fff;
    background: var(--home-coral);
    box-shadow: 0 10px 24px rgba(239, 115, 84, .2);
}
.home-btn-primary:hover { background: var(--home-coral-dark); }
.home-btn-secondary,
.home-link-btn,
.home-card-action,
.home-empty-state > a {
    border: 1px solid var(--home-line-strong);
    color: var(--home-teal);
    background: #fff;
}
.home-link-btn { flex: 0 0 auto; min-height: 40px; }
.home-link-btn span { margin-left: 5px; }

/* Hero */
.home-hero { padding: 30px 0 22px; }
.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(350px, .75fr);
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 26px;
    background: rgba(255, 253, 249, .92);
    box-shadow: var(--home-shadow);
}
.hero-copy {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(34px, 4.2vw, 54px);
}
.hero-copy h1 {
    max-width: 720px;
    margin: 0;
    color: #22211f;
    font-size: clamp(42px, 4.1vw, 58px);
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: -.04em;
}
.hero-description {
    max-width: 720px;
    margin: 17px 0 0;
    color: var(--home-muted);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.85;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; }
.hero-points span {
    position: relative;
    padding-left: 15px;
    color: #67605a;
    font-size: 11px;
    font-weight: 800;
}
.hero-points span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--home-teal);
    transform: translateY(-50%);
}

.hero-menu {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--home-line);
    padding: 28px;
    background:
        linear-gradient(145deg, rgba(255, 239, 230, .72), rgba(231, 247, 241, .8)),
        #fff;
}
.hero-menu-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.hero-logo-mark {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: #fff;
    background: var(--home-coral);
    box-shadow: 0 12px 24px rgba(239, 115, 84, .2);
    font-size: 18px;
    font-weight: 900;
}
.hero-menu-head p {
    margin: 0 0 3px;
    color: var(--home-coral);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.hero-menu-head h2 { margin: 0; font-size: 21px; font-weight: 900; line-height: 1.3; }
.hero-menu-list { display: grid; gap: 8px; }
.hero-menu-list a {
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    border: 1px solid rgba(225, 209, 194, .86);
    border-radius: 14px;
    padding: 9px 12px;
    background: rgba(255,255,255,.78);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.hero-menu-list a:hover {
    transform: translateX(3px);
    border-color: rgba(25, 122, 116, .35);
    background: #fff;
}
.hero-menu-index {
    color: var(--home-coral);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .06em;
}
.hero-menu-list a > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.hero-menu-list strong { overflow: hidden; font-size: 13px; font-weight: 900; white-space: nowrap; text-overflow: ellipsis; }
.hero-menu-list small { overflow: hidden; color: var(--home-muted); font-size: 10px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.hero-menu-list b { color: var(--home-coral); font-size: 17px; }

/* Sections */
.home-content-section { padding: 28px 0 34px; }
.home-content-section-muted {
    border-top: 1px solid rgba(234, 223, 211, .7);
    border-bottom: 1px solid rgba(234, 223, 211, .7);
    background: rgba(255,255,255,.25);
}
.home-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}
.home-section-head-compact { margin-bottom: 13px; }
.home-section-head h2,
.trust-intro h2 {
    margin: 0;
    color: #252421;
    font-size: clamp(28px, 2.8vw, 38px);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -.035em;
}
.home-section-head > div > p:last-child,
.trust-intro p:not(.home-eyebrow) {
    max-width: 690px;
    margin: 7px 0 0;
    color: var(--home-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.65;
}

/* Cards */
.home-card-grid,
.home-announcement-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.home-card-grid[data-count="2"],
.home-announcement-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; }
.home-card-grid[data-count="1"],
.home-announcement-grid[data-count="1"] { grid-template-columns: 1fr; max-width: 920px; }

.home-public-card,
.home-announcement-card,
.home-empty-state,
.trust-panel {
    border: 1px solid var(--home-line);
    background: var(--home-surface);
    box-shadow: var(--home-shadow);
}
.home-public-card {
    min-width: 0;
    overflow: hidden;
    border-radius: 20px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.home-public-card:hover { transform: translateY(-3px); box-shadow: var(--home-shadow-hover); }
.home-card-media {
    position: relative;
    height: 170px;
    display: block;
    overflow: hidden;
    background: linear-gradient(135deg, #fff0e8, #edf8f4);
}
.home-card-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .28s ease;
}
.home-public-card:hover .home-card-media img { transform: scale(1.035); }
.home-media-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--home-teal);
    background: rgba(239, 250, 246, .95);
    font-size: 10px;
    font-weight: 900;
}
.home-card-body {
    min-height: 235px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
}
.home-card-tag {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    border-radius: 999px;
    padding: 0 10px;
    color: var(--home-teal);
    background: var(--home-teal-soft);
    font-size: 10px;
    font-weight: 900;
}
.home-card-body h3,
.home-announcement-card h3 {
    margin: 10px 0 7px;
    color: #242321;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.4;
}
.home-card-description,
.home-announcement-card > p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 12px;
    color: var(--home-muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.home-card-meta {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: auto;
    color: #635d56;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.55;
}
.home-card-meta span + span::before { content: "•"; margin-right: 10px; color: #d7a03c; }
.home-card-meta-stack { display: grid; gap: 4px; margin-top: 0; }
.home-card-meta-stack span + span::before { content: none; }
.home-card-topline {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--home-coral-dark);
    font-size: 11px;
    font-weight: 900;
}
.home-card-topline strong { color: var(--home-teal); }
.home-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.home-chip-row span {
    border-radius: 999px;
    padding: 5px 8px;
    color: var(--home-teal);
    background: var(--home-teal-soft);
    font-size: 10px;
    font-weight: 900;
}
.home-card-action { min-height: 36px; margin-top: 13px; padding: 0 13px; font-size: 11px; }

/* Single recommendation */
.home-card-grid[data-count="1"] .home-public-card {
    display: grid;
    grid-template-columns: minmax(290px, 44%) minmax(0, 1fr);
}
.home-card-grid[data-count="1"] .home-card-media { height: 100%; min-height: 250px; }
.home-card-grid[data-count="1"] .home-card-body { min-height: 250px; padding: 24px; }
.home-card-grid[data-count="1"] .home-card-body h3 { font-size: clamp(22px, 2vw, 27px); }
.home-card-grid[data-count="1"] .home-card-description { max-width: 580px; -webkit-line-clamp: 3; }

/* Announcements */
.home-announcement-section { padding-top: 20px; padding-bottom: 22px; }
.home-announcement-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-radius: 18px;
    padding: 18px;
}
.home-announcement-card.is-pinned {
    border-color: rgba(239, 115, 84, .4);
    background: linear-gradient(135deg, rgba(255, 240, 232, .85), #fff);
}
.home-announcement-meta { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-announcement-meta > span:last-child:not(.home-card-tag) { color: var(--home-coral); font-size: 10px; font-weight: 900; }
.home-announcement-card .home-card-action { margin-top: auto; }
.home-announcement-grid[data-count="1"] .home-announcement-card { min-height: auto; padding: 20px 22px; }

.home-empty-state {
    min-height: 92px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-radius: 18px;
    padding: 16px 18px;
    color: var(--home-muted);
}
.home-empty-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--home-coral);
    background: var(--home-coral-soft);
    font-size: 13px;
    font-weight: 900;
}
.home-empty-state strong { display: block; color: var(--home-text); font-size: 15px; font-weight: 900; }
.home-empty-state p { margin: 4px 0 0; font-size: 12px; font-weight: 650; line-height: 1.55; }
.home-empty-state > a { min-height: 36px; padding: 0 13px; font-size: 11px; }
.home-empty-state-compact { min-height: 84px; }

/* Trust overview */
.home-trust-section { padding: 16px 0 26px; }
.trust-panel {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    border-radius: 22px;
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(255, 241, 233, .62), rgba(237, 248, 244, .7)),
        #fff;
}
.trust-intro { display: flex; flex-direction: column; justify-content: center; }
.trust-intro h2 { font-size: 27px; }
.trust-rule {
    align-self: flex-start;
    margin-top: 14px;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--home-teal);
    background: rgba(255,255,255,.8);
    font-size: 10px;
    font-weight: 900;
}
.trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.trust-grid article {
    min-width: 0;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(226, 213, 200, .9);
    border-radius: 15px;
    padding: 11px;
    background: rgba(255,255,255,.88);
}
.trust-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--home-coral);
    background: var(--home-coral-soft);
    font-size: 12px;
    font-weight: 900;
}
.trust-grid strong { display: block; color: var(--home-teal); font-size: 22px; font-weight: 900; line-height: 1; }
.trust-grid p { margin: 4px 0 0; color: var(--home-muted); font-size: 10px; font-weight: 900; }

/* System banner */
.home-system-banner { padding: 16px 0 0; }
.banner-inner {
    border: 1px solid var(--home-line);
    border-radius: 16px;
    padding: 15px 18px;
    background: #fff;
    box-shadow: var(--home-shadow);
}
.banner-inner h2 { margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.banner-inner > div > p:last-child { margin: 0; color: var(--home-muted); font-size: 12px; font-weight: 700; }

/* Footer */
.home-footer { padding: 18px 0 28px; }
.home-footer-inner {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--home-line);
    border-radius: 20px;
    padding: 18px 22px;
    background: rgba(255,253,249,.86);
}
.home-footer-brand { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.home-footer-brand strong { color: var(--home-coral); font-size: 25px; font-weight: 900; }
.home-footer-brand span { color: var(--home-muted); font-size: 11px; font-weight: 700; }
.home-footer-links { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.home-footer-links a { color: var(--home-teal); font-size: 11px; font-weight: 900; }

@media (max-width: 1080px) {
    .hero-panel { grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); }
    .trust-panel { grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .hero-panel { grid-template-columns: 1fr; }
    .hero-copy { min-height: auto; }
    .hero-menu { border-top: 1px solid var(--home-line); border-left: 0; }
    .hero-menu-list { grid-template-columns: 1fr 1fr; }
    .trust-panel { grid-template-columns: 1fr; }
    .trust-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px; }
    .trust-rule { margin-top: 0; }
    .home-card-grid,
    .home-card-grid[data-count="2"],
    .home-announcement-grid,
    .home-announcement-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
    .home-card-grid[data-count="1"] { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .home-container { width: min(100% - 28px, 1180px); }
    .home-hero { padding-top: 22px; }
    .hero-panel { border-radius: 21px; }
    .hero-copy { padding: 28px 22px; }
    .hero-copy h1 { font-size: clamp(36px, 11vw, 48px); }
    .hero-description { font-size: 14px; }
    .hero-menu { padding: 22px; }
    .hero-menu-list { grid-template-columns: 1fr; }
    .home-section-head { align-items: flex-start; flex-direction: column; gap: 13px; }
    .home-card-grid,
    .home-card-grid[data-count="2"],
    .home-announcement-grid,
    .home-announcement-grid[data-count="2"] { grid-template-columns: 1fr; }
    .home-card-grid[data-count="1"] .home-public-card { display: block; }
    .home-card-grid[data-count="1"] .home-card-media { height: 190px; min-height: 0; }
    .home-card-grid[data-count="1"] .home-card-body { min-height: 225px; padding: 19px; }
    .home-empty-state { grid-template-columns: 42px minmax(0, 1fr); }
    .home-empty-state > a { grid-column: 2; justify-self: start; }
    .trust-intro { display: block; }
    .trust-rule { margin-top: 12px; }
    .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
    .hero-actions { display: grid; grid-template-columns: 1fr; }
    .home-btn { width: 100%; }
    .trust-grid { grid-template-columns: 1fr; }
}
