/*!
 * site.css —— 页面外壳（顶栏、解析框、播放器容器、提示）
 */

:root {
    --site-bg: #0b0e11;
    --site-bg-2: #12161b;
    --site-panel: #151a20;
    --site-line: rgba(255, 255, 255, .08);
    --site-text: #e8edf3;
    --site-dim: #8b96a3;
    --site-accent: #00bfff;
    --site-radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--site-bg);
    color: var(--site-text);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 50% -20%, rgba(0, 191, 255, .12), transparent 60%),
        radial-gradient(800px 400px at 100% 0%, rgba(120, 80, 255, .08), transparent 55%),
        var(--site-bg);
}

a { color: inherit; text-decoration: none; }

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================ 顶栏 ============================ */
.site-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px clamp(14px, 3vw, 34px);
    border-bottom: 1px solid var(--site-line);
    background: rgba(11, 14, 17, .72);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.site-logo {
    display: inline-flex;
    width: 30px;
    height: 30px;
    color: var(--site-accent);
    filter: drop-shadow(0 0 8px rgba(0, 191, 255, .45));
}
.site-logo svg { width: 30px; height: 30px; }

.site-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
}
.site-name span { color: var(--site-accent); font-weight: 500; }

.site-parse {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 760px;
    margin: 0 auto;
    padding: 4px 4px 4px 12px;
    border: 1px solid var(--site-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    transition: border-color .2s, box-shadow .2s;
}
.site-parse:focus-within {
    border-color: rgba(0, 191, 255, .55);
    box-shadow: 0 0 0 3px rgba(0, 191, 255, .12);
}

.site-parse-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: var(--site-dim);
    flex: 0 0 auto;
}
.site-parse-icon svg { width: 18px; height: 18px; }

.site-parse input {
    flex: 1 1 auto;
    min-width: 0;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--site-text);
    font-size: 13.5px;
    outline: none;
}
.site-parse input::placeholder { color: #5d6875; }

.site-parse button {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #00bfff, #0086d6);
    color: #04121a;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .18s, transform .18s;
    white-space: nowrap;
}
.site-parse button:hover { filter: brightness(1.08); }
.site-parse button:active { transform: scale(.97); }
.site-parse button:disabled { opacity: .6; cursor: progress; }

.site-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.site-ghost {
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--site-line);
    border-radius: 8px;
    background: transparent;
    color: var(--site-dim);
    font-size: 12.5px;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}
.site-ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .05); }

/* ============================ 主体 ============================ */
.site-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: clamp(14px, 2.4vw, 28px) clamp(12px, 2.6vw, 28px) 40px;
}

.player-shell { display: flex; flex-direction: column; gap: 16px; }

.player-meta {
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.player-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    color: #f3f7fb;
}

.player-sub {
    font-size: 12.5px;
    color: var(--site-dim);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}
.player-sub em { font-style: normal; color: #b9c4d0; }
.player-sub a { color: var(--site-accent); }

/* ============================ 提示条 ============================ */
.toast {
    position: fixed;
    left: 50%;
    bottom: 42px;
    transform: translate(-50%, 14px);
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(20, 24, 30, .95);
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 99999;
    max-width: 80vw;
    text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 90, 90, .45); color: #ffb3b3; }
.toast.success { border-color: rgba(0, 191, 255, .45); color: #a9e9ff; }

/* ============================ 加载骨架 ============================ */
.player-shell.is-parsing .lemonplayer::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .05) 40%, transparent 60%) 0 0 / 200% 100%,
        #05070a;
    animation: site-shimmer 1.4s linear infinite;
    z-index: 30;
    pointer-events: none;
}

@keyframes site-shimmer {
    from { background-position: 200% 0, 0 0; }
    to { background-position: -200% 0, 0 0; }
}

/* ============================ 响应式 ============================ */
@media (max-width: 900px) {
    .site-header { flex-wrap: wrap; gap: 10px; }
    .site-parse { order: 3; flex-basis: 100%; max-width: none; }
    .site-actions { margin-left: auto; }
}

@media (max-width: 560px) {
    .site-name { display: none; }
    .site-parse button { padding: 0 14px; }
    .player-title { font-size: 16px; }
    .site-actions .site-ghost { padding: 0 10px; }
}


/* ============================================================================
 * 播放模式：播放器铺满视口，隐藏页面外壳
 * ==========================================================================*/
body.lemon-playing { overflow: hidden; }

body.lemon-playing .site-header,
body.lemon-playing .player-meta { display: none; }

body.lemon-playing .site-main {
    padding: 0;
    max-width: none;
}

body.lemon-playing .player-shell { gap: 0; }

body.lemon-playing .lemonplayer {
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
}

body.lemon-playing .lemonplayer-video-wrap { height: 100%; }


/* v5：播放模式改为自适应尺寸，不再强制铺满 */
body.lemon-playing .site-main {
    padding: 0;
    max-width: none;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.lemon-playing .player-shell {
    gap: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.lemon-playing .lemonplayer {
    width: min(100vw, 177.78vh);
    max-width: 1600px;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 0;
}


/* v8：确保 .player-shell 真正铺满 <main class="site-main"> */
body.lemon-playing .site { min-height: 100vh; }

body.lemon-playing .site-main {
    width: 100%;
    height: 100vh;
    max-width: none;
    padding: 0;
    margin: 0;
    display: block;
    flex: 1 1 auto;
}

body.lemon-playing .player-shell {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    display: block;
    gap: 0;
}

body.lemon-playing .lemonplayer {
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
}

body.lemon-playing .lemonplayer-video-wrap {
    width: 100%;
    height: 100%;
}


/* ============================================================================
 * 主字体：fonts/Lemon-CUEu2PYy.woff2
 * ==========================================================================*/
@font-face {
    font-family: "Lemon Sans";
    src: url("../fonts/Lemon-CUEu2PYy.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

body,
.site,
.lemonplayer,
.lemon-modal-card,
.toast,
button,
input,
textarea,
select {
    font-family: "Lemon Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

.lemonplayer button,
.lemonplayer input,
.lemonplayer textarea {
    font-family: inherit;
}
