/**
 * 子比主题 - 公众号关注引导 前端样式 v2.0
 * 优化响应式布局，适配子比主题
 */

/* 重置和基础 */
.zwg-guide-card,
.zwg-guide-card * {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

.zwg-guide-card {
    --zwg-accent: #07c160;
    --zwg-accent-dark: #06ad56;
    --zwg-bg-start: #f0fdf4;
    --zwg-bg-end: #ecfdf5;
    --zwg-radius: 16px;
    --zwg-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 30px 0;
    padding: 0;
    border-radius: var(--zwg-radius);
    background: linear-gradient(135deg, var(--zwg-bg-start) 0%, var(--zwg-bg-end) 100%);
    box-shadow: var(--zwg-shadow);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
    line-height: 1.6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    clear: both;
}

.zwg-guide-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 装饰性背景元素 */
.zwg-guide-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--zwg-accent) 0%, transparent 70%);
    opacity: 0.08;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.zwg-guide-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--zwg-accent) 0%, transparent 70%);
    opacity: 0.05;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* 内部容器 - 桌面端水平布局 */
.zwg-guide-inner {
    display: flex !important;
    display: -webkit-flex !important;
    flex-direction: row !important;
    -webkit-flex-direction: row !important;
    align-items: center !important;
    -webkit-align-items: center !important;
    justify-content: flex-start !important;
    -webkit-justify-content: flex-start !important;
    gap: 28px;
    padding: 28px 32px;
    position: relative;
    z-index: 1;
    width: 100%;
    flex-wrap: nowrap;
    -webkit-flex-wrap: nowrap;
}

/* 左侧二维码区域 */
.zwg-guide-left {
    flex: 0 0 auto;
    -webkit-flex: 0 0 auto;
    width: auto;
    min-width: 0;
    display: block;
}

.zwg-qrcode-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    min-width: 140px;
    min-height: 140px;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    margin: 0 auto;
}

.zwg-guide-card:hover .zwg-qrcode-wrap {
    transform: scale(1.03);
}

.zwg-qrcode {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
    display: block !important;
    border-radius: 6px;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

.zwg-qrcode-label {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
    white-space: nowrap;
    background: #07c160 !important;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%) !important;
    padding: 4px 14px;
    border-radius: 12px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.35);
    letter-spacing: 0.5px;
    display: inline-block;
}

.zwg-no-qrcode .zwg-qrcode-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    color: #ccc;
    text-align: center;
}

.zwg-no-qrcode .zwg-qrcode-placeholder .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.zwg-no-qrcode .zwg-qrcode-placeholder p {
    font-size: 12px;
    margin: 0;
    padding: 0;
}

/* 右侧内容区域 */
.zwg-guide-right {
    flex: 1 1 auto;
    -webkit-flex: 1 1 auto;
    min-width: 0;
    width: auto;
    display: block;
}

/* 头部区域 */
.zwg-guide-header {
    display: flex;
    display: -webkit-flex;
    flex-direction: row;
    -webkit-flex-direction: row;
    align-items: flex-start;
    -webkit-align-items: flex-start;
    justify-content: flex-start;
    -webkit-justify-content: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
}

.zwg-guide-icon {
    flex: 0 0 auto;
    -webkit-flex: 0 0 auto;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: linear-gradient(135deg, var(--zwg-accent) 0%, var(--zwg-accent-dark) 100%);
    border-radius: 12px;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
    overflow: hidden;
}

.zwg-guide-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.zwg-guide-titles {
    flex: 1 1 auto;
    -webkit-flex: 1 1 auto;
    min-width: 0;
    width: auto;
    display: block;
}

.zwg-guide-title {
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    line-height: 1.3 !important;
    border: none !important;
    background: none !important;
    text-align: left !important;
    float: none !important;
}

.zwg-guide-subtitle {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    color: #666 !important;
    line-height: 1.5 !important;
    font-weight: normal !important;
    border: none !important;
    background: none !important;
    text-align: left !important;
    float: none !important;
}

/* 步骤区域 */
.zwg-steps {
    display: flex;
    display: -webkit-flex;
    flex-direction: row;
    -webkit-flex-direction: row;
    align-items: center;
    -webkit-align-items: center;
    justify-content: flex-start;
    -webkit-justify-content: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    -webkit-flex-wrap: wrap;
    width: 100%;
}

.zwg-step {
    display: flex;
    display: -webkit-flex;
    flex-direction: row;
    -webkit-flex-direction: row;
    align-items: center;
    -webkit-align-items: center;
    justify-content: flex-start;
    -webkit-justify-content: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    white-space: nowrap;
}

.zwg-step-num {
    flex: 0 0 auto;
    -webkit-flex: 0 0 auto;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    background: var(--zwg-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.zwg-step-text {
    line-height: 1.4;
}

/* 关键词区域 */
.zwg-keyword-box {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(7, 193, 96, 0.15);
    width: 100%;
}

.zwg-keyword-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
    line-height: 1.4;
    text-align: left;
}

.zwg-keyword-row {
    display: flex;
    display: -webkit-flex;
    flex-direction: row;
    -webkit-flex-direction: row;
    align-items: center;
    -webkit-align-items: center;
    justify-content: flex-start;
    -webkit-justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    -webkit-flex-wrap: wrap;
    width: 100%;
}

.zwg-keyword-tag {
    display: inline-flex;
    display: -webkit-inline-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--zwg-accent) 0%, var(--zwg-accent-dark) 100%);
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 8px;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    line-height: 1.4 !important;
    border: none !important;
    text-decoration: none !important;
    float: none !important;
    margin: 0 !important;
}

.zwg-keyword-tag:hover {
    transform: scale(1.05);
}

.zwg-copy-btn {
    display: inline-flex;
    display: -webkit-inline-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    color: var(--zwg-accent);
    border: 1.5px solid var(--zwg-accent);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.zwg-copy-btn:hover {
    background: var(--zwg-accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.zwg-copy-btn:active {
    transform: translateY(0);
}

.zwg-copy-btn.copied {
    background: var(--zwg-accent);
    color: #fff;
    border-color: var(--zwg-accent);
}

.zwg-copy-icon {
    flex: 0 0 auto;
    -webkit-flex: 0 0 auto;
    width: 16px;
    height: 16px;
    display: block;
}

/* Toast 提示 */
.zwg-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    -webkit-transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.zwg-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    -webkit-transform: translate(-50%, -50%) scale(1);
}

.zwg-toast::before {
    content: '✓';
    display: inline-block;
    margin-right: 8px;
    color: var(--zwg-accent);
    font-weight: 700;
}

/* ============================================
   响应式 - 平板 (769px - 1024px)
   ============================================ */
@media (max-width: 1024px) and (min-width: 769px) {
    .zwg-guide-inner {
        padding: 24px 24px;
        gap: 24px;
    }
    
    .zwg-qrcode-wrap {
        width: 130px;
        height: 130px;
        min-width: 130px;
        min-height: 130px;
    }
    
    .zwg-guide-title {
        font-size: 18px !important;
    }
}

/* ============================================
   响应式 - 手机 (<=768px) 垂直布局
   ============================================ */
@media (max-width: 768px) {
    .zwg-guide-card {
        margin: 20px 0;
        border-radius: 12px;
    }
    
    .zwg-guide-inner {
        flex-direction: column !important;
        -webkit-flex-direction: column !important;
        align-items: center !important;
        -webkit-align-items: center !important;
        justify-content: center !important;
        -webkit-justify-content: center !important;
        gap: 20px;
        padding: 24px 20px;
        text-align: center;
    }
    
    .zwg-guide-left {
        width: 100%;
        display: flex;
        display: -webkit-flex;
        justify-content: center;
        -webkit-justify-content: center;
        align-items: center;
        -webkit-align-items: center;
        padding-bottom: 10px;
    }
    
    .zwg-qrcode-wrap {
        width: 130px;
        height: 130px;
        min-width: 130px;
        min-height: 130px;
        margin-bottom: 34px !important;
    }
    
    .zwg-qrcode-label {
        bottom: -26px;
        font-size: 13px;
        padding: 3px 12px;
    }
    
    .zwg-guide-right {
        width: 100%;
        text-align: center;
    }
    
    .zwg-guide-header {
        justify-content: center !important;
        -webkit-justify-content: center !important;
        align-items: center !important;
        -webkit-align-items: center !important;
        flex-direction: column !important;
        -webkit-flex-direction: column !important;
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        gap: 10px !important;
    }
    
    .zwg-guide-titles {
        text-align: center !important;
        flex: 0 1 auto !important;
        -webkit-flex: 0 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        display: block !important;
    }
    
    .zwg-guide-card .zwg-guide-right .zwg-guide-header .zwg-guide-titles .zwg-guide-title,
    .zwg-guide-card .zwg-guide-title,
    h3.zwg-guide-title {
        font-size: 18px !important;
        text-align: center !important;
        display: block !important;
        width: 100% !important;
        float: none !important;
        margin: 0 0 4px 0 !important;
        padding: 0 !important;
    }
    
    .zwg-guide-card .zwg-guide-right .zwg-guide-header .zwg-guide-titles .zwg-guide-subtitle,
    .zwg-guide-card .zwg-guide-subtitle,
    p.zwg-guide-subtitle {
        font-size: 13px !important;
        text-align: center !important;
        display: block !important;
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .zwg-guide-icon {
        margin: 0 !important;
        float: none !important;
    }
    
    .zwg-steps {
        justify-content: center !important;
        -webkit-justify-content: center !important;
        flex-direction: column !important;
        -webkit-flex-direction: column !important;
        gap: 10px !important;
        align-items: center !important;
        -webkit-align-items: center !important;
    }
    
    .zwg-step {
        justify-content: center !important;
        -webkit-justify-content: center !important;
    }
    
    .zwg-keyword-label {
        text-align: center !important;
    }
    
    .zwg-keyword-row {
        justify-content: center !important;
        -webkit-justify-content: center !important;
    }
    
    .zwg-keyword-row {
        justify-content: center;
        -webkit-justify-content: center;
    }
    
    .zwg-keyword-tag {
        font-size: 15px !important;
        padding: 7px 16px;
    }
    
    .zwg-copy-btn {
        padding: 7px 14px;
        font-size: 12px;
    }
}

/* ============================================
   响应式 - 小屏手机 (<=480px)
   ============================================ */
@media (max-width: 480px) {
    .zwg-guide-card {
        margin: 16px 0;
    }
    
    .zwg-guide-inner {
        padding: 20px 16px;
        gap: 16px;
    }
    
    .zwg-qrcode-wrap {
        width: 120px;
        height: 120px;
        min-width: 120px;
        min-height: 120px;
        margin-bottom: 32px !important;
    }
    
    .zwg-guide-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .zwg-guide-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .zwg-guide-title {
        font-size: 17px !important;
    }
    
    .zwg-guide-subtitle {
        font-size: 12px !important;
    }
    
    .zwg-step {
        font-size: 12px;
    }
    
    .zwg-keyword-box {
        padding: 12px 14px;
    }
    
    .zwg-keyword-tag {
        font-size: 14px !important;
        padding: 6px 14px;
    }
    
    .zwg-copy-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ============================================
   子比主题适配
   ============================================ */
/* 防止子比主题内容区域样式覆盖 */
.entry-content .zwg-guide-card,
.post-content .zwg-guide-card,
.article-content .zwg-guide-card,
.wp-posts-content .zwg-guide-card,
.content .zwg-guide-card {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.entry-content .zwg-guide-card p,
.post-content .zwg-guide-card p,
.article-content .zwg-guide-card p,
.wp-posts-content .zwg-guide-card p,
.content .zwg-guide-card p {
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
}

.entry-content .zwg-guide-card img,
.post-content .zwg-guide-card img,
.article-content .zwg-guide-card img,
.wp-posts-content .zwg-guide-card img {
    max-width: 100% !important;
    height: auto !important;
}

/* 防止子比主题的标题样式覆盖 */
.zwg-guide-card h3.zwg-guide-title,
.zwg-guide-card h1.zwg-guide-title,
.zwg-guide-card h2.zwg-guide-title {
    position: static !important;
    padding: 0 !important;
    margin: 0 0 4px 0 !important;
    border: none !important;
    background: none !important;
    font-size: 20px !important;
    line-height: 1.3 !important;
    color: #1a1a1a !important;
    text-align: left !important;
}

.zwg-guide-card h3.zwg-guide-title::before,
.zwg-guide-card h3.zwg-guide-title::after,
.zwg-guide-card h1.zwg-guide-title::before,
.zwg-guide-card h1.zwg-guide-title::after,
.zwg-guide-card h2.zwg-guide-title::before,
.zwg-guide-card h2.zwg-guide-title::after {
    display: none !important;
    content: none !important;
}

/* ============================================
   深色模式适配
   ============================================ */
@media (prefers-color-scheme: dark) {
    .zwg-guide-card {
        background: linear-gradient(135deg, #1a2e1f 0%, #16251a 100%);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .zwg-guide-title {
        color: #f0f0f0 !important;
    }
    
    .zwg-guide-subtitle,
    .zwg-step-text,
    .zwg-keyword-label {
        color: #aaa !important;
    }
    
    .zwg-keyword-box {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(7, 193, 96, 0.25);
    }
    
    .zwg-copy-btn {
        background: transparent;
    }
    
    .zwg-qrcode-wrap {
        background: #fff;
    }
}

/* 子比主题深色模式 */
html[data-night='night'] .zwg-guide-card,
body.night .zwg-guide-card,
.dark-mode .zwg-guide-card {
    background: linear-gradient(135deg, #1a2e1f 0%, #16251a 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html[data-night='night'] .zwg-guide-title,
body.night .zwg-guide-title,
.dark-mode .zwg-guide-title {
    color: #f0f0f0 !important;
}

html[data-night='night'] .zwg-guide-subtitle,
html[data-night='night'] .zwg-step-text,
html[data-night='night'] .zwg-keyword-label,
body.night .zwg-guide-subtitle,
body.night .zwg-step-text,
body.night .zwg-keyword-label,
.dark-mode .zwg-guide-subtitle,
.dark-mode .zwg-step-text,
.dark-mode .zwg-keyword-label {
    color: #aaa !important;
}

html[data-night='night'] .zwg-keyword-box,
body.night .zwg-keyword-box,
.dark-mode .zwg-keyword-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(7, 193, 96, 0.25);
}
