:root {
    --bg: #0f1115;
    --bg-soft: #161a21;
    --border: #262b35;
    --text: #e6e8ec;
    --text-dim: #9aa1ad;
    --accent: #ff9a9e;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

/* ------------------------------------------------------------------ *
 * hidden 属性兜底
 *
 * 浏览器 UA 样式表里的 [hidden] { display: none } 属于 UA 样式，
 * 会被作者样式表里的任何 display 声明无条件压过 —— 例如下面
 * .overlay / .stage / .source-bar 的 display: flex，以及 .btn 的
 * display: inline-block。结果是 JS 设了 hidden = true，元素照样显示。
 * 所以这里必须用 !important 把它锁住。
 * ------------------------------------------------------------------ */

[hidden] {
    display: none !important;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
        Arial, sans-serif;
}

/* ------------------------------------------------------------------ *
 * 加载遮罩
 * ------------------------------------------------------------------ */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #111;
    color: #ddd;
    font-size: 14px;
    letter-spacing: 2px;
    transition: opacity 0.35s ease;
}

.overlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.heart {
    color: var(--accent);
    font-size: 42px;
    line-height: 1;
    animation: heartbeat 1.15s infinite ease-in-out;
}

@keyframes heartbeat {
    0% {
        opacity: 0.75;
        transform: scale(0.82);
    }

    50% {
        opacity: 1;
        transform: scale(1.12);
    }

    100% {
        opacity: 0.75;
        transform: scale(0.82);
    }
}

/* ------------------------------------------------------------------ *
 * 内容区
 * ------------------------------------------------------------------ */

.stage {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

.source-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    font-size: 13px;
}

.source-label {
    flex: none;
    color: var(--text-dim);
}

.source-url {
    flex: 1 1 240px;
    min-width: 0;
    overflow: hidden;
    color: var(--accent);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-open {
    flex: none;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.source-open:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: #000;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.frame.is-ready {
    opacity: 1;
}

/* ------------------------------------------------------------------ *
 * 首页 / 确认卡片
 * ------------------------------------------------------------------ */

.panel {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 20px;
}

.panel-inner {
    max-width: 720px;
    margin: 12vh auto 0;
}

.panel-title {
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 700;
}

.panel-text {
    margin: 0;
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1.7;
}

.panel-url-wrap {
    margin: 16px 0 0;
}

.panel-url {
    display: block;
    overflow-wrap: anywhere;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
    color: var(--accent);
    font-size: 13px;
}

.panel-actions {
    margin-top: 24px;
}

.btn {
    display: inline-block;
    padding: 11px 22px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent);
    font-size: 15px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover {
    background: var(--accent);
    color: #17181c;
}

/* ------------------------------------------------------------------ *
 * 无障碍：尊重系统的「减少动态效果」设置
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {

    .heart {
        animation: none;
    }

    .overlay,
    .frame {
        transition: none;
    }
}
