/**
 * APP单页下载主题 - 附加样式
 * 补充 style.css 之外的细节调整、动画、交互状态
 */

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f5e6c8; }
::-webkit-scrollbar-thumb { background: #b87333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #8b4513; }

/* ==================== Header 滚动状态 ==================== */
.site-header { transition: background .3s, padding .3s; }
.site-header.scrolled {
    background: rgba(20, 14, 8, 0.95);
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.site-header.scrolled .header-inner { padding: 8px 20px; }

/* ==================== 菜单切换动画 ==================== */
.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ==================== Hero 入场 ==================== */
.hero-content {
    animation: heroFadeUp 1s ease-out;
}
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== Tab 切换动画 ==================== */
.news-list { animation: tabFade .3s ease; }
@keyframes tabFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 3D 轮播 ==================== */
.carousel-slide {
    cursor: pointer;
    backface-visibility: hidden;
}
.carousel-slide:not(.center) { pointer-events: none; }
.carousel-slide img { pointer-events: none; }

/* ==================== 截图画廊 ==================== */
.gallery-item {
    position: relative;
    overflow: hidden;
}
.gallery-item::after {
    content: '🔍';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none; /* 遮罩不拦截点击，保证点击穿透到 img 触发大图 */
}
.gallery-item:hover::after { opacity: 1; }

/* ==================== 模态框 ==================== */
.modal {
    animation: modalFade .3s ease;
}
.modal-img {
    animation: modalZoom .4s ease;
}
@keyframes modalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalZoom {
    from { transform: scale(.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==================== 二维码卡片 ==================== */
.qr-content {
    position: relative;
    overflow: hidden;
}
.qr-content::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(184,115,51,.1), transparent);
    transform: rotate(45deg) translateY(-100%);
    transition: transform .6s;
}
.qr-content:hover::before {
    transform: rotate(45deg) translateY(100%);
}

/* ==================== 文章卡片网格 ==================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 1024px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .posts-grid { grid-template-columns: 1fr; }
}

/* ==================== 分页导航 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 30px 0;
}
.pagination a,
.pagination span {
    display: inline-block;
    min-width: 36px;
    height: 36px;
    line-height: 36px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #f0e6d2;
    border-radius: 4px;
    color: #3a2a1a;
    font-size: 14px;
    text-align: center;
}
.pagination a:hover { background: #b87333; color: #fff; border-color: #b87333; }
.pagination .current {
    background: #b87333;
    color: #fff;
    border-color: #b87333;
    font-weight: bold;
}

/* ==================== 评论 ==================== */
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { padding: 16px 0; border-bottom: 1px solid #f0e6d2; }
.comment-list .comment:last-child { border-bottom: none; }
.comment-author { font-weight: bold; color: #3a2a1a; }
.comment-meta { font-size: 12px; color: #a89888; }
.comment-reply-link { color: #b87333; font-size: 12px; margin-left: 8px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; }
.comment-form input,
.comment-form textarea {
    padding: 10px;
    border: 1px solid #f0e6d2;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.comment-form input[type="submit"] {
    background: #b87333;
    color: #fff;
    border: none;
    cursor: pointer;
    width: auto;
    align-self: flex-start;
    padding: 10px 24px;
    border-radius: 4px;
}
.comment-form input[type="submit"]:hover { background: #8b4513; }

/* ==================== 返回顶部按钮 ==================== */
.back-to-top {
    transition: all .2s;
}
.back-to-top:hover {
    background: #b87333 !important;
    color: #fff !important;
}

/* ==================== 后台设置页美化 ==================== */
.appdown-settings-wrap .form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
}
.appdown-settings-wrap .form-table td { padding: 20px 0; }
.appdown-settings-wrap .description { display: block; margin-top: 4px; color: #666; font-size: 12px; }
.appdown-settings-wrap .nav-tab-wrapper { margin-bottom: 20px; }
.appdown-settings-wrap .repeater-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background: #fafafa;
    border-radius: 4px;
}
.appdown-settings-wrap .repeater-row input[type="text"],
.appdown-settings-wrap .repeater-row input[type="url"] {
    flex: 1;
}
.appdown-settings-wrap .repeater-row .remove-btn {
    background: #dc3232;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 4px 10px;
    cursor: pointer;
    flex-shrink: 0;
}
.appdown-settings-wrap .repeater-row .preview-img {
    max-width: 60px;
    max-height: 60px;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.appdown-settings-wrap .add-row-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    margin-top: 8px;
}
.appdown-settings-wrap .checkbox-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.appdown-settings-wrap .checkbox-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* ==================== 后台 SEO 元框 ==================== */
.appdown-seo-metabox .inside { padding: 12px; }
.appdown-seo-metabox .seo-field { margin-bottom: 12px; }
.appdown-seo-metabox label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 13px;
}
.appdown-seo-metabox input[type="text"],
.appdown-seo-metabox textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}
.appdown-seo-metabox .char-count {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}
.appdown-seo-metabox .char-count.warning { color: #d63638; }
.appdown-seo-metabox .char-count.good { color: #46b450; }

/* ==================== 后台授权页 ==================== */
.appdown-license-wrap {
    max-width: 600px;
    margin: 40px auto;
}
.appdown-license-wrap .license-status {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}
.appdown-license-wrap .license-status.active {
    background: #f0fdf4;
    border: 1px solid #46b450;
    color: #1a8a3a;
}
.appdown-license-wrap .license-status.inactive {
    background: #fef0f0;
    border: 1px solid #dc3232;
    color: #b32d2d;
}
.appdown-license-wrap textarea {
    width: 100%;
    min-height: 120px;
    font-family: monospace;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.appdown-license-wrap button {
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 24px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
}
.appdown-license-wrap button:hover { background: #135e96; }
.appdown-license-wrap .license-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.8;
}

/* ==================== 未授权拦截页 ==================== */
.appdown-license-blocked {
    text-align: center;
    padding: 80px 20px;
    max-width: 500px;
    margin: 0 auto;
}
.appdown-license-blocked h1 {
    color: #b87333;
    font-size: 32px;
    margin-bottom: 16px;
}
.appdown-license-blocked p {
    color: #5a4a3a;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* ==================== 表单通用 ==================== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
    font-family: inherit;
    font-size: 14px;
    border: 1px solid #f0e6d2;
    border-radius: 4px;
    padding: 8px 12px;
    background: #fff;
}
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #b87333;
    box-shadow: 0 0 0 2px rgba(184, 115, 51, .2);
}

/* ==================== 响应式补充 ==================== */
@media (max-width: 768px) {
    .appdown-settings-wrap .form-table th { width: auto; display: block; padding-bottom: 4px; }
    .appdown-settings-wrap .form-table td { display: block; padding: 0 0 16px; }
    .appdown-settings-wrap .repeater-row { flex-wrap: wrap; }
    .appdown-settings-wrap .repeater-row input { width: 100%; }
}
