/**
 * 高级SEO管理器 - 前端样式
 * WooCommerce SEO Manager - Frontend Styles
 */

/* =====================================
   基础样式重置
   ===================================== */
.asm-schema-markup {
    display: none !important;
}

/* =====================================
   面包屑导航
   ===================================== */
.asm-breadcrumbs {
    padding: 10px 0;
    margin: 15px 0;
    font-size: 14px;
    color: #666;
}

.asm-breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.asm-breadcrumbs li {
    display: flex;
    align-items: center;
}

.asm-breadcrumbs li:not(:last-child):after {
    content: "›";
    margin: 0 8px;
    color: #999;
    font-weight: normal;
}

.asm-breadcrumbs a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.2s ease;
}

.asm-breadcrumbs a:hover {
    color: #005a87;
    text-decoration: underline;
}

.asm-breadcrumbs .current {
    color: #333;
    font-weight: 500;
}

/* =====================================
   SEO优化的图片
   ===================================== */
.asm-optimized-image {
    max-width: 100%;
    height: auto;
    display: block;
}

.asm-optimized-image[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.asm-optimized-image[loading="lazy"].loaded {
    opacity: 1;
}

/* =====================================
   响应式图片容器
   ===================================== */
.asm-responsive-image {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.asm-responsive-image img {
    width: 100%;
    height: auto;
    display: block;
}

.asm-image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 20px 15px 15px;
    font-size: 14px;
    line-height: 1.4;
}

/* =====================================
   SEO友好的表格
   ===================================== */
.asm-data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.asm-data-table th,
.asm-data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.asm-data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.asm-data-table tr:hover {
    background: #f8f9fa;
}

.asm-data-table tr:last-child td {
    border-bottom: none;
}

/* =====================================
   内容区域优化
   ===================================== */
.asm-content-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

.asm-content-wrapper h1,
.asm-content-wrapper h2,
.asm-content-wrapper h3,
.asm-content-wrapper h4,
.asm-content-wrapper h5,
.asm-content-wrapper h6 {
    line-height: 1.3;
    margin: 1.5em 0 0.5em;
    color: #333;
}

.asm-content-wrapper h1 {
    font-size: 2.2em;
    margin-top: 0;
}

.asm-content-wrapper h2 {
    font-size: 1.8em;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.3em;
}

.asm-content-wrapper h3 {
    font-size: 1.5em;
}

.asm-content-wrapper p {
    line-height: 1.6;
    margin: 1em 0;
    color: #444;
}

.asm-content-wrapper ul,
.asm-content-wrapper ol {
    margin: 1em 0;
    padding-left: 2em;
}

.asm-content-wrapper li {
    margin: 0.5em 0;
    line-height: 1.6;
}

/* =====================================
   FAQ样式
   ===================================== */
.asm-faq-container {
    margin: 20px 0;
}

.asm-faq-item {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.asm-faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.asm-faq-question {
    background: #f8f9fa;
    padding: 15px 20px;
    margin: 0;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.asm-faq-question:hover {
    background: #e9ecef;
}

.asm-faq-question:after {
    content: "+";
    font-size: 20px;
    font-weight: bold;
    color: #666;
    transition: transform 0.2s ease;
}

.asm-faq-question.active:after {
    transform: rotate(45deg);
}

.asm-faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.asm-faq-answer.active {
    padding: 20px;
    max-height: 500px;
}

.asm-faq-answer p {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

/* =====================================
   评论优化
   ===================================== */
.asm-comments-section {
    margin: 40px 0;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.asm-comments-title {
    font-size: 1.5em;
    margin: 0 0 20px;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.asm-comment-item {
    border-left: 3px solid #007cba;
    padding: 15px 20px;
    margin: 15px 0;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
}

.asm-comment-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.asm-comment-author {
    font-weight: 600;
    color: #333;
}

.asm-comment-date {
    margin-left: 10px;
}

.asm-comment-content {
    line-height: 1.6;
    color: #444;
}

/* =====================================
   搜索结果优化
   ===================================== */
.asm-search-results {
    margin: 20px 0;
}

.asm-search-result-item {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.asm-search-result-item:last-child {
    border-bottom: none;
}

.asm-search-result-title {
    font-size: 1.3em;
    margin: 0 0 8px;
}

.asm-search-result-title a {
    color: #007cba;
    text-decoration: none;
}

.asm-search-result-title a:hover {
    text-decoration: underline;
}

.asm-search-result-url {
    color: #006621;
    font-size: 14px;
    margin-bottom: 5px;
}

.asm-search-result-excerpt {
    color: #545454;
    line-height: 1.5;
    margin: 0;
}

.asm-search-result-meta {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* =====================================
   加载状态
   ===================================== */
.asm-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

.asm-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: asm-spin 1s linear infinite;
}

@keyframes asm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =====================================
   可访问性增强
   ===================================== */
.asm-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.asm-focus-visible:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* =====================================
   性能优化类
   ===================================== */
.asm-lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.asm-lazy-load.loaded {
    opacity: 1;
}

.asm-preload-image {
    content-visibility: auto;
    contain-intrinsic-size: 300px 200px;
}

/* =====================================
   响应式设计
   ===================================== */
@media (max-width: 768px) {
    .asm-breadcrumbs {
        font-size: 13px;
    }

    .asm-breadcrumbs li:not(:last-child):after {
        margin: 0 4px;
    }

    .asm-content-wrapper h1 {
        font-size: 1.8em;
    }

    .asm-content-wrapper h2 {
        font-size: 1.5em;
    }

    .asm-content-wrapper h3 {
        font-size: 1.3em;
    }

    .asm-data-table {
        font-size: 13px;
    }

    .asm-data-table th,
    .asm-data-table td {
        padding: 8px 10px;
    }

    .asm-faq-question {
        padding: 12px 15px;
        font-size: 15px;
    }

    .asm-faq-answer.active {
        padding: 15px;
    }

    .asm-comments-section {
        padding: 20px 15px;
        margin: 30px 0;
    }

    .asm-comment-item {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .asm-breadcrumbs ol {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .asm-breadcrumbs li:not(:last-child):after {
        display: none;
    }

    .asm-data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .asm-search-result-title {
        font-size: 1.1em;
    }
}

/* =====================================
   打印样式
   ===================================== */
@media print {
    .asm-breadcrumbs,
    .asm-faq-question:after {
        display: none !important;
    }

    .asm-faq-answer {
        max-height: none !important;
        padding: 10px 0 !important;
    }

    .asm-content-wrapper {
        font-size: 12pt;
        line-height: 1.4;
    }

    .asm-content-wrapper h1,
    .asm-content-wrapper h2,
    .asm-content-wrapper h3 {
        page-break-after: avoid;
    }
}

/* =====================================
   深色模式支持
   ===================================== */
@media (prefers-color-scheme: dark) {
    .asm-content-wrapper h1,
    .asm-content-wrapper h2,
    .asm-content-wrapper h3,
    .asm-content-wrapper h4,
    .asm-content-wrapper h5,
    .asm-content-wrapper h6 {
        color: #e4e4e4;
    }

    .asm-content-wrapper p {
        color: #ccc;
    }

    .asm-data-table th {
        background: #2a2a2a;
        color: #e4e4e4;
    }

    .asm-data-table tr:hover {
        background: #2a2a2a;
    }

    .asm-faq-question {
        background: #2a2a2a;
        color: #e4e4e4;
    }

    .asm-faq-question:hover {
        background: #333;
    }

    .asm-faq-answer p {
        color: #ccc;
    }

    .asm-comment-item {
        background: #2a2a2a;
        border-left-color: #007cba;
    }

    .asm-comment-content {
        color: #ccc;
    }
}