.front-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px 18px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px 28px 0;
}

.home-hero-carousel {
    position: relative;
    min-height: 298px;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(120deg, #eef6ff 0%, #d9eafe 55%, #c8ddff 100%);
    box-shadow: var(--shadow-sm);
}
.carousel-slide {
    display: none;
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.carousel-slide.active { display: block; }
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.3);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-arrow:hover { background: rgba(0,0,0,.55); }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }
.carousel-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    cursor: pointer;
    transition: background .2s;
}
.carousel-dot.active { background: #fff; }
.carousel-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 40px;
}
.carousel-empty h1 {
    margin: 0 0 8px;
    color: #0d357f;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.22;
}
.carousel-empty p {
    color: #153d83;
    font-size: 18px;
    margin-bottom: 20px;
}

.home-side,
.ad-stack {
    display: grid;
    gap: 12px;
}
.side-card,
.content-card {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.side-card { padding: 18px; }
.side-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 20px;
    line-height: 1.2;
}
.title-icon { color: var(--primary); }
.side-card input {
    width: 100%;
    height: 42px;
    border: 1px solid #dce5f1;
    border-radius: 7px;
    outline: 0;
    padding: 0 14px;
    color: var(--text-primary);
}
.side-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,119,255,.1); }
.quick-card button {
    width: 100%;
    height: 40px;
    margin-top: 14px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: var(--primary);
    font-weight: 700;
    cursor: pointer;
}
.action-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(22, 119, 255, .06), rgba(47, 201, 99, .04)),
        #fff;
}
.action-card::after {
    content: "";
    position: absolute;
    right: -42px;
    top: -58px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(22, 119, 255, .08);
    pointer-events: none;
}
.action-card-head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.action-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: #fff;
    background: var(--primary);
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(22, 119, 255, .18);
}
.action-card h3 {
    margin: 0 0 4px;
    font-size: 18px;
    line-height: 1.25;
}
.action-card p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}
.action-card em {
    align-self: start;
    padding: 4px 8px;
    border-radius: 999px;
    color: #147a3d;
    background: #eaf8f0;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}
.action-card-buttons {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.action-card-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    border-radius: 7px;
    font-weight: 800;
    font-size: 14px;
}
.action-primary {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 10px 18px rgba(22, 119, 255, .18);
}
.action-primary:hover { color: #fff; background: var(--primary-hover); }
.action-secondary {
    color: var(--primary);
    border: 1px solid #bcd8ff;
    background: #fff;
}
.action-secondary:hover { border-color: var(--primary); background: var(--primary-light); }
.action-tertiary {
    color: #fff;
    background: #10b5c2;
    border: 1px solid #09a0ad;
    box-shadow: 0 10px 18px rgba(16, 181, 194, .2);
}
.action-tertiary:hover { background: #0ea0ab; }
.hot-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.hot-tags span {
    color: #1f2937;
    font-weight: 700;
}
.hot-tags a {
    min-width: 46px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #5d667a;
    background: #fff;
    font-size: 13px;
}

.notice-bar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 42px;
    overflow: hidden;
    border: 1px solid #cfe1fb;
    border-radius: 8px;
    background: #eff6ff;
    box-shadow: var(--shadow-sm);
}
.notice-bar > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    color: #095fd4;
    border-right: 1px solid #d4e4f9;
}
.notice-icon { font-size: 18px; }
.notice-slider {
    position: relative;
    min-width: 0;
    height: 100%;
    min-height: 42px;
    overflow: hidden;
}
.notice-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: #334155;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .28s, transform .28s;
}
.notice-item.active {
    opacity: 1;
    transform: translateY(0);
}
.notice-more {
    padding: 0 18px;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.category-strip {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.category-strip a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    min-height: 78px;
    padding: 15px 25px;
    border-right: 1px solid var(--border-light);
}
.category-strip a:last-child { border-right: 0; }
.category-strip strong,
.category-strip small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.category-strip a.promo-slot > div,
.category-strip a.ad-slot > div,
.category-strip a.ad-slot .strip-ad-content {
    min-width: 0;
}
.category-strip strong { color: #18233b; font-size: 15px; }
.category-strip small { color: #6b7280; font-size: 12px; }
.strip-vacant {
    opacity: .72;
}
.strip-vacant:hover {
    opacity: 1;
    background: #f8fafc;
}
.strip-vacant strong { color: #9ca3af; }
.strip-vacant small { color: #b0b8c4; }
.strip-vacant .strip-icon { background: #d1d5db; }
.strip-ad-content { min-width: 0; }
.strip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
}
.green { background: #35c95a; }
.purple { background: #7646e8; }
.orange { background: #ff9820; }
.blue { background: #2387ef; }
.pink { background: #ff5a84; }
.cyan { background: #19c8cf; }

.sponsor-banner {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid #fde3c0;
    border-radius: 8px;
    background: linear-gradient(90deg, #fff8ee, #fffdf9);
    color: #a34b0d;
}
.sponsor-banner div {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.sponsor-banner span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #ff7a1a;
    border-radius: 50%;
    background: #fff;
}
.sponsor-banner small {
    color: #6d5c50;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.sponsor-banner a {
    min-width: 88px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ffc883;
    border-radius: 6px;
    color: #d96d12;
    background: #fff9f1;
    font-size: 13px;
}

.ad-contact-modal[hidden] { display: none !important; }
.ad-contact-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.ad-contact-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .46);
}
.ad-contact-dialog {
    position: relative;
    z-index: 1;
    width: min(360px, 100%);
    padding: 24px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(15, 23, 42, .2);
    text-align: center;
}
.ad-contact-close {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    color: #64748b;
    background: transparent;
    cursor: pointer;
}
.ad-contact-close:hover { background: #f1f5f9; color: #0f172a; }
.ad-contact-dialog h3 {
    margin: 4px 0 8px;
    color: #111827;
    font-size: 20px;
}
.ad-contact-dialog p {
    margin: 0 0 18px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}
.ad-contact-dialog img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}
.ad-contact-empty {
    padding: 18px;
    border: 1px dashed #d7dee8;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 13px;
}

.content-card {
    grid-column: 1 / -1;
    padding: 16px 14px;
}
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.section-heading h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #111827;
    font-size: 20px;
    line-height: 1.2;
}
.section-heading h2 span { color: var(--primary); font-size: 18px; }
.section-heading a {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.section-heading.compact { margin-bottom: 10px; }
.section-heading.compact h2 { font-size: 18px; }

.site-list-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.site-mini-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 62px;
    padding: 10px 12px;
    border: 1px solid #e1e8f2;
    border-radius: 8px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.site-mini-card:hover {
    border-color: #b8d5ff;
    box-shadow: 0 8px 18px rgba(22, 119, 255, .08);
    transform: translateY(-1px);
}
.site-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
}
.site-mini-card div { min-width: 0; }
.site-mini-card strong,
.site-mini-card small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.site-mini-card strong { color: #18233b; font-size: 15px; }
.site-mini-card small { color: #69758a; font-size: 12px; }

.front-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}
.front-category-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 74px;
    padding: 14px;
    border: 1px solid #e1e8f2;
    border-radius: 8px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.front-category-card:hover {
    border-color: #b8d5ff;
    box-shadow: 0 8px 18px rgba(22, 119, 255, .08);
    transform: translateY(-1px);
}
.front-category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #1677ff, #22c7d8);
    font-weight: 800;
}
.front-category-card strong,
.front-category-card small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.front-category-card strong { color: #18233b; font-size: 16px; }
.front-category-card small { color: #69758a; font-size: 12px; }

.ad-stack {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr) minmax(0, 1fr);
}
.ad-card {
    position: relative;
    min-height: 154px;
    overflow: hidden;
    border-radius: 8px;
    padding: 22px 28px;
}
.ad-card h3 {
    margin: 6px 0 4px;
    font-size: 26px;
    line-height: 1.2;
}
.ad-card p { font-size: 16px; }
.ad-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    height: 34px;
    padding: 0 18px;
    border-radius: 7px;
    font-weight: 700;
}
.blue-ad {
    color: #fff;
    background: linear-gradient(140deg, #2456f5, #6965ff);
}
.blue-ad > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 18px;
    border-radius: 5px;
    background: rgba(255,255,255,.18);
    font-size: 12px;
}
.blue-ad a { color: #fff; border: 1px solid rgba(255,255,255,.52); }
.ad-bars {
    position: absolute;
    right: 48px;
    bottom: 24px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    opacity: .86;
}
.ad-bars i {
    display: block;
    width: 24px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.28));
}
.ad-bars i:nth-child(1) { height: 22px; }
.ad-bars i:nth-child(2) { height: 34px; }
.ad-bars i:nth-child(3) { height: 52px; }
.ad-bars i:nth-child(4) { height: 76px; }
.gold-ad {
    min-height: 118px;
    text-align: center;
    color: #9a4c0b;
    background: linear-gradient(120deg, #fff5e7, #fffaf1);
    border: 1px solid #ffe0b7;
}
.gold-ad h3 { font-size: 20px; }
.gold-ad p { color: #a66a2d; font-size: 14px; }
.gold-ad a {
    min-width: 148px;
    color: #d87514;
    border: 1px solid #ffc988;
    background: #fff8ef;
}
.news-card ul { list-style: none; }
.news-card li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 27px;
    color: #64748b;
    font-size: 14px;
}
.news-card li::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
}
.news-card li a {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.news-card time { color: #8a96aa; }

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.tool-grid a {
    display: block;
    min-height: 76px;
    padding: 14px;
    border: 1px solid #e1e8f2;
    border-radius: 8px;
    background: #fff;
}
.tool-grid strong,
.tool-grid small { display: block; }
.tool-grid strong { color: #18233b; font-size: 15px; margin-bottom: 4px; }
.tool-grid small { color: #69758a; font-size: 12px; }

@media (max-width: 1180px) {
    .front-shell { grid-template-columns: 1fr; }
    .home-side,
    .ad-stack,
    .notice-bar,
    .category-strip,
    .sponsor-banner,
    .content-card {
        grid-column: 1;
    }
    .home-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ad-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .site-list-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .front-shell { padding: 14px 16px 0; }
    .home-hero-carousel { min-height: 0; aspect-ratio: 2.5 / 1; }
    .home-hero-carousel .carousel-slide img { object-fit: contain; background: #eef6ff; }
    .notice-bar { display: none; }
    .sponsor-banner { display: none; }
    .side-card input { font-size: 16px; }
    .home-side,
    .ad-stack,
    .site-list-grid,
    .tool-grid { grid-template-columns: 1fr 1fr; }
    .category-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .front-shell { padding-left: 12px; padding-right: 12px; }
    .home-hero-carousel {
        min-height: 0;
        aspect-ratio: 2.5 / 1;
    }
    .home-hero-carousel .carousel-slide img { object-fit: contain; background: #eef6ff; }
    .carousel-empty { padding: 30px 20px; }
    .carousel-empty h1 { font-size: 22px; }
    .carousel-empty p { font-size: 14px; }
    .carousel-arrow { width: 28px; height: 28px; font-size: 13px; }
    .side-card input { font-size: 16px; }
    .home-side,
    .tool-grid { grid-template-columns: 1fr; }
    .site-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ad-stack { grid-template-columns: 1fr 1fr; }
    .ad-stack .news-card { grid-column: 1 / -1; }
    .ad-stack .gold-ad { min-height: auto; }
}
