/**
 * 火桥（huoqiao）· 多功能沉浸式 WordPress 主题
 * 联系方式：12492501@qq.com
 * 支持正版，从我做起，你的支持是我们前行的动力！
 *
 * @package   huoqiao
 * @author    三木
 * @copyright Copyright (c) 2026-09-01 huoqiao.cn
 * @license   GPL-2.0-or-later
 * @link      https://huoqiao.cn
 * @tags      design-tokens, responsive, dark-mode, glassmorphism, animation
 */

@media (min-width: 769px) {
    .huoqiao-mobile-navbar,
    .huoqiao-mobile-toolbar,
    .hq-mobile-toc-panel,
    .hq-mobile-comment-panel {
        display: none !important;
    }
}

@media (max-width: 768px) {
    html,
    body {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    
    body .footer-custom,
    body.single .footer-custom,
    body.single .footer-custom .footer-bottom,
    body.page .footer-custom,
    body.archive .footer-custom,
    body.home .footer-custom,
    body .mag-footer,
    body.single .mag-footer,
    body.page .mag-footer,
    body.archive .mag-footer,
    body.home .mag-footer {
        padding-bottom: 0 !important;
    }

    
    body.hq-image-detail-page .hq-image-detail__content {
        padding-bottom: 0 !important;
    }
}

.huoqiao-mobile-navbar,
.huoqiao-mobile-toolbar {
    position: fixed;
    bottom: 15px;
    left: 10px;
    right: 10px;
    max-width: 100%;
    height: 56px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(var(--glass-blur-lg));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 985;
    padding: 0 6px;
    box-sizing: border-box;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.huoqiao-mobile-navbar.hidden,
.huoqiao-mobile-toolbar.hidden {
    transform: translateY(120px);
    opacity: 0;
    pointer-events: none;
}

.navbar-inner,
.toolbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 8px;
}

.navbar-item,
.toolbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    padding: 4px;
    margin: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    height: 48px;
    flex: 1;
    border-radius: 12px;
    min-width: 0;
}

.navbar-item:active,
.toolbar-item:active {
    transform: scale(0.95);
}

.navbar-icon,
.toolbar-icon {
    font-size: 20px;
    line-height: 1;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    color: #666;
}

.navbar-label,
.toolbar-label {
    display: none;
}

.navbar-item.active {
    color: var(--color-primary);
}

.navbar-item.active .navbar-icon,
.toolbar-item.active .toolbar-icon {
    color: var(--color-primary);
    transform: scale(1.12);
}

.toolbar-item.toolbar-favorite.active .toolbar-icon {
    color: #ffa502;
}

.toolbar-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: #ff6b6b;
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 500;
    z-index: 2;
}

.back-top-btn,
.toolbar-back-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.back-top-btn .navbar-percent,
.toolbar-back-top .scroll-percent {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    z-index: 2;
}

.back-top-btn.scrolling .navbar-icon,
.toolbar-back-top.show-percent .toolbar-arrow {
    opacity: 0;
}

.back-top-btn.scrolling .navbar-percent,
.toolbar-back-top.show-percent .scroll-percent {
    opacity: 1;
}

.toolbar-comment-input {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 160px;
    min-width: 80px;
    height: 38px;
}

.toolbar-comment-input:hover {
    background: #e8e8e8;
}

.comment-avatar {
    margin-right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img,
.comment-avatar a img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
}

.comment-input-field {
    flex: 1;
    min-width: 0;
}

.comment-placeholder {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.toolbar-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    max-width: 80px;
}

.toolbar-buy-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 38px;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    border: none;
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.toolbar-buy-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.toolbar-buy-btn.purchased {
    background: linear-gradient(135deg, #999, #777);
    cursor: default;
}

.buy-text {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.buy-price {
    font-size: 9px;
    opacity: 0.9;
    line-height: 1.2;
}

.hq-mobile-toc-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.hq-mobile-toc-panel.active {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.hq-toc-panel-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(var(--glass-blur-sm));
    animation: hqTocFadeIn 0.3s ease;
}

.hq-toc-panel-content {
    position: relative;
    width: 100%;
    max-height: 65vh;
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.15), 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: hqTocSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hq-mobile-toc-panel.active .hq-toc-panel-content {
    transform: translateY(0);
}

.hq-toc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: #fff;
}

.hq-toc-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.hq-toc-panel-title i {
    font-size: 18px;
    color: var(--color-primary);
}

.hq-toc-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    border: none;
    background: #f5f5f5;
}

.hq-toc-panel-close:hover {
    color: #333;
    background: #eee;
}

.hq-toc-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: calc(65vh - 72px);
    -webkit-overflow-scrolling: touch;
}

.hq-mobile-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hq-mobile-toc-list li {
    padding: 0;
    border-bottom: 1px solid #f5f5f5;
}

.hq-mobile-toc-list li:last-child {
    border-bottom: none;
}

.hq-mobile-toc-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    font-size: 15px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.hq-mobile-toc-list a:hover,
.hq-mobile-toc-list a:active {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.06);
    border-left-color: var(--color-primary);
}

.hq-toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.hq-mobile-comment-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    flex-direction: column;
    justify-content: flex-end;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.35s, opacity 0.3s ease;
}

.hq-mobile-comment-panel.active {
    display: flex;
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 0.3s ease;
}

.hq-comment-panel-mask {
    position: absolute;
    inset: 0;
    background: rgba(13, 15, 19, 0.6);
    backdrop-filter: blur(var(--glass-blur-sm));
    -webkit-backdrop-filter: blur(var(--glass-blur-sm));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hq-mobile-comment-panel.active .hq-comment-panel-mask {
    opacity: 1;
}

.hq-comment-panel-content {
    position: relative;
    background: #fff;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

.hq-mobile-comment-panel.active .hq-comment-panel-content {
    transform: translateY(0);
}

.hq-comment-panel-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
    margin: 8px auto 0;
    flex-shrink: 0;
}

.hq-comment-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.hq-comment-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.hq-comment-panel-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.hq-comment-panel-close:hover {
    background: #f5f5f5;
}

.hq-comment-panel-body {
    padding: 12px 16px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.hq-comment-reply-indicator {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 8px;
    background: #f0f9ff;
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-primary-hover);
}

.hq-comment-reply-indicator.active {
    display: flex;
}

.hq-comment-reply-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hq-comment-reply-cancel {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0 0 0 8px;
    flex-shrink: 0;
}

.hq-mobile-comment-editable {
    width: 100%;
    min-height: 100px;
    max-height: 200px;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background: transparent;
    padding: 0;
    font-family: inherit;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    caret-color: #333;
}

.hq-mobile-comment-editable:empty::before {
    content: attr(data-placeholder);
    color: #bbb;
    pointer-events: none;
}

.hq-mobile-comment-editable .comment-emoji {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    display: inline-block;
}

.hq-comment-panel-textarea-wrapper {
    position: relative;
}

.hq-mobile-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.hq-mobile-image-preview:empty {
    display: none;
}

.hq-mobile-image-preview .preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
}

.hq-mobile-image-preview .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hq-mobile-image-preview .preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

.hq-comment-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.hq-comment-panel-tools {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
    white-space: nowrap;
    flex-shrink: 0;
}

.hq-comment-panel-tool {
    background: none;
    border: none;
    color: #999;
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.hq-comment-panel-tool:hover {
    color: #666;
}

.hq-comment-panel-tool.active {
    color: #ff6b6b;
}

.hq-comment-panel-submit {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hq-comment-panel-submit:active {
    transform: scale(0.95);
}

.hq-comment-panel-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

[data-theme="dark"] .huoqiao-mobile-navbar,
[data-theme="dark"] .huoqiao-mobile-toolbar {
    background: rgba(30, 30, 30, 0.85);
    border-color: rgba(60, 60, 60, 0.5);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .navbar-item,
[data-theme="dark"] .toolbar-item {
    color: #999;
}

[data-theme="dark"] .navbar-item.active,
[data-theme="dark"] .navbar-item.active .navbar-icon,
[data-theme="dark"] .toolbar-item.active .toolbar-icon {
    color: #4db6ac;
}

[data-theme="dark"] .back-top-btn .navbar-percent,
[data-theme="dark"] .toolbar-back-top .scroll-percent {
    background: linear-gradient(135deg, #444 0%, #2a2a2a 100%);
    color: #ccc;
}

[data-theme="dark"] .toolbar-comment-input {
    background: #2a2a2a;
}

[data-theme="dark"] .hq-toc-panel-content {
    background: #1e1e1e;
}

[data-theme="dark"] .hq-toc-panel-header {
    background: #1e1e1e;
    border-bottom-color: #333;
}

[data-theme="dark"] .hq-toc-panel-title {
    color: #fff;
}

[data-theme="dark"] .hq-toc-panel-close {
    color: #666;
    background: #2a2a2a;
}

[data-theme="dark"] .hq-toc-panel-close:hover {
    color: #fff;
    background: #333;
}

[data-theme="dark"] .hq-mobile-toc-list li {
    border-bottom-color: #333;
}

[data-theme="dark"] .hq-mobile-toc-list a {
    color: #aaa;
}

[data-theme="dark"] .hq-mobile-toc-list a:hover,
[data-theme="dark"] .hq-mobile-toc-list a:active {
    color: var(--color-primary-light);
    background: rgba(224, 122, 84, 0.1);
    border-left-color: var(--color-primary-light);
}

[data-theme="dark"] .hq-toc-num {
    background: rgba(224, 122, 84, 0.2);
    color: var(--color-primary-light);
}

[data-theme="dark"] .hq-comment-panel-content {
    background: #1e1e1e;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .hq-comment-panel-content::before {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .hq-comment-panel-header {
    border-bottom-color: #333;
}

[data-theme="dark"] .hq-comment-panel-title {
    color: #fff;
}

[data-theme="dark"] .hq-comment-panel-close {
    color: #666;
    background: #2a2a2a;
}

[data-theme="dark"] .hq-comment-panel-close:hover {
    color: #fff;
    background: #333;
}

[data-theme="dark"] .hq-comment-panel-footer {
    border-top-color: #333;
}

[data-theme="dark"] .hq-mobile-comment-editable {
    color: #e5e5e5;
    caret-color: #e5e7eb;
}

[data-theme="dark"] .hq-mobile-comment-editable:empty::before {
    color: #666;
}

[data-theme="dark"] .hq-comment-reply-indicator {
    background: rgba(224, 122, 84, 0.15);
    color: var(--color-primary-light);
}

[data-theme="dark"] .hq-comment-panel-tool {
    color: #999;
}

[data-theme="dark"] .hq-comment-panel-tool:hover {
    color: #666;
}

[data-theme="dark"] .toolbar-buy-btn.purchased {
    background: linear-gradient(135deg, #555, #444);
}

@media screen and (max-width: 360px) {
    .toolbar-item,
    .navbar-item {
        min-width: 40px;
        padding: 4px;
    }

    .toolbar-buy-btn {
        min-width: 70px;
        padding: 4px 12px;
    }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    .huoqiao-mobile-navbar,
    .huoqiao-mobile-toolbar {
        padding: 4px 6px;
    }

    .navbar-item,
    .toolbar-item {
        height: 40px;
    }

    .toolbar-buy-btn {
        height: 36px;
    }
}

@supports (bottom: env(safe-area-inset-bottom)) {
    .huoqiao-mobile-navbar,
    .huoqiao-mobile-toolbar {
        bottom: calc(15px + env(safe-area-inset-bottom));
    }
}

@keyframes hqTocFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes hqTocSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
