/*
Theme Name: 卡券屋
Theme URI: https://www.kaquanwu.cn/
Author: 卡券屋
Author URI: https://www.kaquanwu.cn/
Description: 卡券屋主题 - 提供虚拟卡券数字发卡权益货源平台推荐导航功能
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kaquanwu
Tags: one-column, custom-menu, custom-logo, featured-images, translation-ready
*/

/* 强力清除，防止溢出 */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s;
}

.home-header {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.home-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    height: 64px;
    width: 100%;
}

.home-header-left {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
}

.home-logo {
    display: flex;
    align-items: center;
    height: 64px;
    flex-shrink: 0;
}

.home-logo-img {
    max-height: 40px;
    width: auto;
    display: block;
}

.home-nav {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.home-nav-item {
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.home-nav-item:hover {
    background-color: #e8f0fe;
    color: #1890ff;
}

.home-nav-item.active {
    background-color: #1890ff;
    color: #ffffff;
}

.home-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.home-top-search {
    display: flex;
    align-items: center;
    background-color: #f5f7fa;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.home-top-search input {
    padding: 8px 12px;
    border: none;
    background-color: transparent;
    width: 180px;
    font-size: 13px;
    outline: none;
}

.home-top-search button {
    background-color: #1890ff;
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-top-search button:hover {
    background-color: #40a9ff;
}

.home-btn {
    padding: 7px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    white-space: nowrap;
}

.home-btn-primary {
    background-color: #1890ff;
    color: #ffffff;
    border: 1px solid #1890ff;
}

.home-btn-primary:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
}

.home-btn-outline {
    background-color: #ffffff;
    color: #1890ff;
    border: 1px solid #d9d9d9;
}

.home-btn-outline:hover {
    color: #40a9ff;
    border-color: #40a9ff;
}

.home-main {
    padding: 10px 0;
    width: 100%;
}

.front-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
    width: 100%;
}

/* 顶部区域：海报 + 侧边栏 */
.top-row {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    margin-bottom: 16px;
}

/* 底部区域：公告及站点列表 */
.bottom-row {
    width: 100%;
}

/* 侧边栏 */
.home-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-hero-carousel {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-repeat: no-repeat;
    position: relative;
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.carousel-slides {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide-item.active {
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.2);
}

/* 前端弹窗样式 */
.frontend-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.frontend-modal.active {
    display: block;
}

.frontend-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.frontend-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.frontend-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f2f5;
    position: relative;
}

.frontend-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-align: center;
}

.frontend-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.frontend-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.frontend-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.8;
    color: #374151;
}

.frontend-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f2f5;
    text-align: right;
}

.frontend-modal-btn-primary {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(24, 144, 255, 0.3);
}

.frontend-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

.carousel-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
}

.side-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
}

.side-card h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.title-icon {
    color: #1890ff;
}

.side-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.side-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.side-card input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.side-card button {
    background-color: #1890ff;
    color: #ffffff;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.side-card button:hover {
    background-color: #40a9ff;
}

.action-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
}

.action-card-icon {
    width: 36px;
    height: 36px;
    background-color: #e6f7ff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #1890ff;
    font-weight: bold;
    flex-shrink: 0;
}

.action-card-head h3 {
    font-size: 14px;
    margin: 0 0 2px 0;
}

.action-card-head p {
    font-size: 12px;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-card-head em {
    margin-left: auto;
    background-color: #52c41a;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-style: normal;
    flex-shrink: 0;
}

.action-card-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
}

.action-card-buttons a {
    flex: 1;
    padding: 8px;
    text-align: center;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-tertiary {
    background-color: #f5f5f5;
    color: #666;
}

.action-tertiary:hover {
    background-color: #e8e8e8;
}

.action-primary {
    background-color: #1890ff;
    color: #ffffff;
}

.action-primary:hover {
    background-color: #40a9ff;
}

.action-secondary {
    background-color: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.action-secondary:hover {
    background-color: #bae7ff;
}

.notice-bar {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
}

.notice-bar > div:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.notice-icon {
    color: #ff4d4f;
}

.notice-bar strong {
    color: #333;
    font-size: 14px;
}

.notice-slider {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.notice-item {
    color: #333;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.notice-more {
    color: #1890ff;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.notice-more:hover {
    text-decoration: underline;
}

.category-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
}

.promo-slot,
.strip-vacant {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    width: 100%;
    min-width: 0;
}

.promo-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.strip-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.strip-icon.green {
    background-color: #d6f4d9;
    color: #389e0d;
}

.strip-icon.gray {
    background-color: #f5f5f5;
    color: #bfbfbf;
}

.strip-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e5e7eb;
}

.promo-slot div {
    flex: 1;
    min-width: 0;
}

.promo-slot strong,
.strip-vacant strong {
    display: block;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.promo-slot small,
.strip-vacant small {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sponsor-banner {
    background: linear-gradient(135deg, #fff7e6 0%, #ffefd5 100%);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border: 1px solid #ffd591;
    width: 100%;
}

.sponsor-banner > div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sponsor-banner span {
    color: #fa8c16;
    font-weight: bold;
    flex-shrink: 0;
}

.sponsor-banner strong {
    color: #d46b08;
    font-size: 14px;
    white-space: nowrap;
}

.sponsor-banner small {
    color: #fa8c16;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sponsor-banner a {
    color: #d46b08;
    font-size: 12px;
    padding: 6px 12px;
    background-color: #ffffff;
    border-radius: 4px;
    border: 1px solid #ffd591;
    white-space: nowrap;
    flex-shrink: 0;
}

.sponsor-banner a:hover {
    background-color: #fff7e6;
}

.content-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    width: 100%;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    width: 100%;
}

.section-heading h2 {
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.section-heading h2 span {
    color: #1890ff;
}

.section-heading a {
    color: #1890ff;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.section-heading a:hover {
    text-decoration: underline;
}

.site-list-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
}

.site-mini-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background-color: #fafafa;
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
    width: 100%;
    min-width: 0;
}

.site-mini-card:hover {
    background-color: #f0f7ff;
    border-color: #91d5ff;
    transform: translateY(-2px);
}

.site-avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #f0f0f0;
    flex-shrink: 0;
}

.site-mini-card div {
    flex: 1;
    min-width: 0;
}

.site-mini-card strong {
    display: block;
    font-size: 13px;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-mini-card small {
    display: block;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-footer {
    background-color: #ffffff;
    border-top: 1px solid #e8e8e8;
    padding: 24px 0;
    margin-top: 24px;
    width: 100%;
}

.home-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.home-footer-info p {
    margin: 4px 0;
    color: #666;
    font-size: 12px;
}

.home-footer-info a {
    color: #666;
}

.home-footer-links {
    display: flex;
    gap: 20px;
}

.home-footer-links a {
    color: #666;
    font-size: 13px;
    white-space: nowrap;
}

.home-footer-links a:hover {
    color: #1890ff;
}

.home-mobile-toggle {
    display: none;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .site-list-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .top-row {
        grid-template-columns: 1fr 280px;
    }
}

@media (max-width: 992px) {
    .top-row {
        grid-template-columns: 1fr;
    }
    
    .home-side {
        width: 100%;
        flex-direction: row;
    }
    
    .home-side .side-card {
        flex: 1;
    }
    
    .site-list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .home-nav,
    .home-header-right {
        display: none;
    }
    
    .home-mobile-toggle {
        display: block;
    }
    
    .home-top-search input {
        width: 140px;
    }
    
    .site-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-strip {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .home-footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .site-list-grid {
        grid-template-columns: 1fr;
    }
    
    .category-strip {
        grid-template-columns: 1fr;
    }
}
