/* 全站统一主题变量与公共组件 */

:root {
    --theme-bg: #f6f7fb;
    --theme-card: #ffffff;
    --theme-border: #e8eaf1;
    --theme-title: #171c2e;
    --theme-muted: #6b7488;
    --theme-accent: #4f46e5;
    --theme-accent-hover: #4338ca;
    --theme-font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ===== 返回首页按钮：仅鼠标移到左上角时显示 ===== */
.home-hotzone {
    position: fixed;
    top: 0;
    left: 0;
    width: 72px;
    height: 72px;
    z-index: 10001;
}

.home-btn {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 10002;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--theme-card);
    border: 1px solid var(--theme-border);
    color: var(--theme-title);
    font-family: var(--theme-font);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(23, 28, 46, 0.12);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.home-hotzone:hover .home-btn,
.home-btn:hover,
.home-btn:focus-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.home-btn:hover {
    color: var(--theme-accent);
    border-color: var(--theme-accent);
    text-decoration: none;
}

/* 移动端（触屏设备或小屏）不显示返回首页按钮 */
@media (hover: none), (max-width: 768px) {
    .home-hotzone,
    .home-btn {
        display: none;
    }
}

/* ===== 右上角 Token 校验面板（全站公共组件，hover 显示） ===== */
.token-hotzone {
    position: fixed;
    top: 0;
    right: 0;
    width: 72px;
    height: 72px;
    z-index: 10001;
}

.token-panel {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--theme-card);
    border: 1px solid var(--theme-border);
    box-shadow: 0 8px 24px rgba(23, 28, 46, 0.12);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    min-width: 320px;
}

.token-hotzone:hover .token-panel,
.token-panel:hover {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.token-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.token-row input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--theme-font);
    color: var(--theme-title);
    background: var(--theme-card);
    outline: none;
    transition: border-color 0.18s ease;
}

.token-row input:focus {
    border-color: var(--theme-accent);
}

.token-row button {
    padding: 8px 14px;
    border: 1px solid #dfe3ff;
    border-radius: 8px;
    background: #eef0ff;
    color: var(--theme-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.token-row button:hover:not(:disabled) {
    background: #e2e6ff;
    border-color: #ccd2ff;
}

.token-row button:disabled {
    background: #f2f4fa;
    color: #aab0c2;
    border-color: #e3e6f0;
    cursor: not-allowed;
}

.token-status {
    font-size: 12px;
    min-height: 18px;
    line-height: 1.4;
}

.token-status.ok {
    color: #15803d;
}

.token-status.err {
    color: #dc2626;
}

.token-status.info {
    color: var(--theme-muted);
}

/* 移动端：触屏无 hover，面板改为常驻可点且更宽 */
@media (hover: none), (max-width: 768px) {
    .token-hotzone {
        width: 48px;
        height: 48px;
    }

    .token-panel {
        min-width: calc(100vw - 28px);
        max-width: 360px;
    }
}
