:root {
    --main-pink: #ff94c2;
    --dark-blue: #6464ff;
    --sky-blue: #82c9ff;
    --mint-green: #98FB98;
    --deep-purple: #9370DB;
    --bg-blur: blur(12px);
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(145deg, var(--sky-blue) 0%, var(--main-pink) 100%);
    min-height: 100vh;
    /* padding: 10px; */
    position: relative;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.anime-character {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    max-width: 250px;
    opacity: 0.9;
    display: none;
}

.widgets-container {
    position: fixed;
    top: 10px;
    right: 10px;
    left: 10px;
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

.right-group {
    display: flex;
    gap: 10px;
}

.widget-card-left {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--bg-blur);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.widget-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--bg-blur);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.container {
    position: relative;
    padding: 30px;
}

.main-container {
    position: relative;
    max-width: 800px;
    margin: 0px auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--bg-blur);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.input-box {
    position: relative;
    margin: 20px 0;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 3px 12px rgba(255, 161, 201, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

/* #urlInput {
    width: 100%;
    padding: 14px 110px 14px 45px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #6A5ACD;
    outline: none;
    box-sizing: border-box;
} */

.auto-expand {
    width: 100%;
    padding: 10px 138px 10px 48px;
    /* 初始最小高度 */
    min-height: 88px;
    /* 最大扩展高度（防止无限增长） */
    max-height: 200px;
    /* padding: 8px; */
    line-height: 1.5;
    /* 禁用默认拖拽调整 */
    resize: none;
    /* 隐藏滚动条 */
    overflow-y: hidden;
    /* 平滑过渡效果 */
    transition: all 0.3s ease;

    /* border: 1px solid #ccc; */
    /* border-radius: 4px; */
    border: none;
    background: transparent;
    font-size: 15px;
    color: #6A5ACD;
    outline: none;
    box-sizing: border-box;
}

.auto-expand::placeholder {
    white-space: pre-wrap;
    align-content: center;
    vertical-align: middle;
    /* 允许占位符换行 */
    line-height: 1.5;
    color: #C8A2C8;
    font-size: 14px;
}

.fade-overlay {
    position: absolute;
    left: 0;
    right: 0;
    /* 羽化区域高度 */
    height: 20px;
    /* 允许穿透点击 */
    pointer-events: none;
}

.fade-overlay.top {
    top: 0;
    background: linear-gradient(to bottom, white 0%, rgba(255, 255, 255, 0) 100%);
}

.fade-overlay.bottom {
    bottom: 0;
    background: linear-gradient(to top, white 0%, rgba(255, 255, 255, 0) 100%);
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #C8A2C8;
    font-size: 18px;
}

.opt-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.parse-btn {
    height: 38px;
    width: 132px;
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    touch-action: manipulation;
}

.mofajx-btn {
    background: linear-gradient(135deg, #7735ff, #f61eff);
}

.clear-btn {
    background: linear-gradient(135deg, #ff8d11, #f61eff);
}

.media-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    margin: 15px 0;
    overflow: hidden;
}

.video-container {
    position: relative;
    padding-top: 56.25%;
    border-radius: 12px;
    overflow: hidden;
}

video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bouncing-loader {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.bouncing-loader div {
    width: 10px;
    height: 10px;
    margin: 3px;
    background: var(--deep-purple);
    border-radius: 50%;
    animation: bouncing 0.6s infinite alternate;
}

@keyframes bouncing {
    to {
        transform: translateY(-10px);
    }
}

.debug-info {
    position: fixed;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.555);
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 9999;
    max-width: 90%;
}

.debug-info-hiden {
    display: none;
}

@media (max-aspect-ratio: 1/1) {
    .widget-card {
        gap: 2px;
    }

    .auto-expand {
        font-size: 16px;
        padding: unset;
        margin: 16px 16px 8px 50px;
    }

    .input-box {
        padding-bottom: 42px;
    }

    .opt-btn {
        position: absolute;
        right: 4px;
        left: 4px;
        top: unset;
        bottom: 4px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .parse-btn {
        padding: 12px 18px;
        font-size: 15px;
    }

    .anime-character {
        display: block;
    }
}

@media (orientation: portrait) {
    .widget-card {
        gap: 2px;
    }

    .auto-expand {
        font-size: 16px;
        padding: unset;
        margin: 16px 16px 8px 50px;
    }

    .input-box {
        padding-bottom: 42px;
    }

    .opt-btn {
        position: absolute;
        right: 4px;
        left: 4px;
        top: unset;
        bottom: 4px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .parse-btn {
        padding: 12px 18px;
        font-size: 15px;
    }

    .anime-character {
        display: block;
    }
}

/* 弹窗基础样式 */
.pop-up-window-bg {
    position: absolute;
    display: none;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #000000ba;
    z-index: 10;
    user-select: none;
}

.pop-up-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 24px;
    z-index: 1000;
}

/* 内容布局 */
.pop-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* 二维码样式 */
.qr-code {
    width: 215px;
    height: 215px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px;
}

/* 输入框区域 */
.input-group {
    width: 100%;
    display: flex;
    gap: 10px;
}

.input-field {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.jiexi-btn-disable {
    padding: 10px 20px;
    background: #808080;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.jiexi-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.jiexi-btn:hover {
    background: #0056b3;
}

/* 说明文字 */
.description {
    color: #666;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}


/* 左右两侧 */
/* 固定定位容器 */
.float-guide {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* 左侧定位 */
.guide-left {
    left: 20px;
    animation: slideLeft 0.5s ease-out;
}

/* 右侧定位 */
.guide-right {
    right: 20px;
    animation: slideRight 0.5s ease-out;
}

/* 二维码样式 */
.qrcode-img {
    width: 150px;
    height: 150px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 5px;
    background: white;
}

/* 引导文案 */
.guide-text {
    text-align: center;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    max-width: 160px;
}

.guide-text strong {
    display: block;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
}

/* 悬停效果 */
.float-guide:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 移动端适配 */
@media (max-width: 768px) {
    /*.float-guide {*/
    /*    bottom: 20px;*/
    /*    top: auto;*/
    /*    transform: none;*/
    /*    flex-direction: row;*/
    /*    padding: 10px;*/
    /*}*/
    
    /*.guide-left {*/
    /*    left: 10px;*/
    /*    right: auto;*/
    /*}*/

    /*.guide-right {*/
    /*    right: 10px;*/
    /*    left: auto;*/
    /*}*/

    /*.qrcode-img {*/
    /*    width: 80px;*/
    /*    height: 80px;*/
    /*    margin-bottom: 0;*/
    /*    margin-right: 10px;*/
    /*}*/

    /*.guide-text {*/
    /*    font-size: 12px;*/
    /*    max-width: 100px;*/
    /*}*/
    .float-guide {
        display: none;
    }
}

/* 动画效果 */
@keyframes slideLeft {
    from {
        transform: translate(-100%, -50%);
    }
    to {
        transform: translate(0, -50%);
    }
}

@keyframes slideRight {
    from {
        transform: translate(100%, -50%);
    }
    to {
        transform: translate(0, -50%);
    }
}


/* 加入书签提示框 */
#bookmarkPrompt {
    position: fixed;
    bottom: -100px;
    right: 20px;
    background: #ffffff8c;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    border: 1px solid #dddddd8c;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#bookmarkPrompt.show {
    bottom: 20px;
    opacity: 1;
}

.prompt-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prompt-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

button {
    padding: 8px 16px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.05);
}

#agreeBtn {
    background: #4CAF50;
    color: white;
}

#declineBtn {
    background: #f44336;
    color: white;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}
