/* 站点单页 */

.site-page-wrap {
    padding: 28px 0 48px;
    background: #f5f7fb;
    min-height: 52vh;
}

.site-page-wrap > .container.site-page,
.site-page {
    max-width: 1250px;
    width: 100%;
}

.site-page-bc {
    margin-bottom: 14px;
    font-size: 13px;
    color: #94a3b8;
}

.site-page-bc a {
    color: #64748b;
    text-decoration: none !important;
}

.site-page-bc a:hover {
    color: #2563eb;
}

.site-page-bc span {
    margin: 0 6px;
}

.site-page-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 28px 32px 36px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.site-page-title {
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef2f7;
    font-size: 26px;
    font-weight: 450;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.site-page-body {
    color: #334155;
    font-size: 15px;
    line-height: 1.85;
}

.site-page-body h2,
.site-page-body h3 {
    margin: 1.4em 0 0.6em;
    color: #0f172a;
    font-weight: 450;
}

.site-page-body p {
    margin: 0 0 1em;
}

.site-page-body ul,
.site-page-body ol {
    margin: 0 0 1em;
    padding-left: 1.4em;
}

.site-page-body li {
    margin-bottom: 0.35em;
}

.site-page-body a {
    color: #2563eb;
}

/* 右侧浮动工具：反馈按钮在上，返回顶部在下（各自 fixed） */
.site-float-tools {
    position: contents;
}

/* 反馈按钮：与返回顶部同款白底方块 */
.site-bug-btn {
    position: fixed;
    left: auto;
    right: max(12px, calc((100vw - var(--site-width, 1250px)) / 2 - 56px));
    bottom: min(510px, calc(100vh - 56px));
    z-index: 1081;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 10px;
    background: #fff;
    color: #475569;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.site-bug-btn:hover,
.site-bug-btn:focus {
    background: #fff;
    color: #1677ff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    outline: none;
}

.site-bug-icon {
    display: block;
    width: 18px;
    height: 18px;
}

/* 返回顶部（桌面端）：白底圆角方块 + 细线向上箭头 */
.site-backtop {
    position: fixed;
    left: auto;
    right: max(12px, calc((100vw - var(--site-width, 1250px)) / 2 - 56px));
    bottom: min(460px, calc(100vh - 106px));
    z-index: 1080;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 10px;
    background: #fff;
    color: #475569;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.site-backtop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-backtop:hover,
.site-backtop:focus {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    outline: none;
}

.site-backtop svg {
    display: block;
    width: 18px;
    height: 18px;
}

/* 反馈弹层：白底卡片 + 品牌蓝，对齐站内视觉 */
.site-bug-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    will-change: opacity;
}

.site-bug-modal[hidden] {
    display: none !important;
}

.site-bug-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.site-bug-dialog {
    width: min(520px, 100%);
    padding: 22px 22px 18px;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    background: #fff;
    color: #1f2329;
    box-shadow:
        0 1px 2px rgba(31, 35, 41, 0.04),
        0 18px 48px rgba(15, 23, 42, 0.16);
    transform: translate3d(0, 12px, 0) scale(0.98);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
    will-change: transform, opacity;
}

.site-bug-modal.is-open .site-bug-dialog {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
}

.site-bug-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.site-bug-head-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-bug-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #e8f3ff;
    color: #1677ff;
    flex: 0 0 auto;
}

.site-bug-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1f2329;
    letter-spacing: -0.01em;
}

.site-bug-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    background: #f8fafc;
    color: #646a73;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.site-bug-close:hover {
    color: #1f2329;
    background: #fff;
    border-color: #e2e8f0;
}

.site-bug-hint {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #8f959e;
}

.site-bug-textarea {
    display: block;
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    color: #1f2329;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.site-bug-textarea::placeholder {
    color: #94a3b8;
}

.site-bug-textarea:focus {
    border-color: #1677ff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.site-bug-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.site-bug-count {
    font-size: 13px;
    color: #8f959e;
}

.site-bug-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    background: #1677ff;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.site-bug-submit:hover:not(:disabled) {
    background: #0f66e0;
}

.site-bug-submit:active:not(:disabled) {
    transform: translateY(1px);
}

.site-bug-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.site-bug-open {
    overflow: hidden;
}

/* 轻量 Toast：替代原生 alert，避免卡顿 */
.site-toast {
    position: fixed;
    left: 50%;
    top: 18%;
    z-index: 1300;
    transform: translate3d(-50%, -8px, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.2s ease;
    will-change: transform, opacity;
}

.site-toast[hidden] {
    display: none !important;
}

.site-toast.is-show {
    opacity: 1;
    visibility: visible;
    transform: translate3d(-50%, 0, 0);
}

.site-toast-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #eef0f3;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 14px 36px rgba(15, 23, 42, 0.14);
}

.site-toast-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e8f3ff;
    position: relative;
}

.site-toast-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 10px;
    height: 6px;
    border-left: 2px solid #1677ff;
    border-bottom: 2px solid #1677ff;
    transform: translateY(-1px) rotate(-45deg);
}

.site-toast.is-error .site-toast-icon {
    background: #fff1f0;
}

.site-toast.is-error .site-toast-icon::before {
    width: 10px;
    height: 10px;
    border: 0;
    background:
        linear-gradient(45deg, transparent 42%, #ff4d4f 42%, #ff4d4f 58%, transparent 58%),
        linear-gradient(-45deg, transparent 42%, #ff4d4f 42%, #ff4d4f 58%, transparent 58%);
    transform: none;
}

.site-toast.is-warn .site-toast-icon {
    background: #fff7e6;
}

.site-toast.is-warn .site-toast-icon::before {
    width: 3px;
    height: 9px;
    border: 0;
    border-radius: 2px;
    background: #fa8c16;
    box-shadow: 0 5px 0 0 #fa8c16;
    transform: translateY(-2px);
}

.site-toast-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2329;
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .site-bug-modal,
    .site-bug-dialog,
    .site-toast {
        transition: none;
    }
}

@media (min-width: 769px) {
    .site-bug-btn,
    .site-backtop {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .site-bug-btn,
    .site-backtop {
        display: inline-flex;
        right: 12px;
    }
    .site-bug-btn {
        bottom: 72px;
    }
    .site-backtop {
        bottom: 20px;
    }
}

@media (max-width: 640px) {
    .site-page-wrap {
        padding: 16px 0 32px;
    }
    .site-page-card {
        padding: 20px 16px 24px;
        border-radius: 10px;
    }
    .site-page-title {
        font-size: 22px;
    }
}
