/* 全局基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
}

body {
    background-color: #f8f9fa;
    padding: 0 10px;
    line-height: 1.6;
}

/* 顶部留白 */
.top-spacing {
    height: 10px;
}

/* 核心容器样式 */
.guidang {
    overflow: hidden;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    background: #fff;
    margin: 15px auto;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.guidang:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* 提示文案样式 */
.tips-box {
    background: #f2f5f9;
    border-radius: 8px;
    padding: 18px 20px;
    font-size: 15px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.6;
    position: relative;
    padding-left: 40px;
}

.tips-box::before {
    content: "\f0eb";
    font-family: "Font Awesome 6 Free";
    font-weight: 600;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #007bf5;
    font-size: 18px;
}

.tips-box.warning {
    background: #fef7e5;
    color: #ed8936;
    border: 1px solid #fcd34d;
    margin-top: 15px;
    padding-left: 40px;
}

.tips-box.warning::before {
    content: "\f071";
    color: #ed8936;
}

/* 视频播放容器 */
.video-player-wrap {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

#palybox {
    width: 100%;
    height: 600px;
    border: 0;
    background: #000;
    transition: opacity 0.3s ease;
}

#palybox.loading {
    opacity: 0.5;
}

/* 加载状态提示（带动画） */
.loading-tips {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    z-index: 10;
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 24px;
    border-radius: 30px;
}

.loading-tips.show {
    display: flex;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 解析操作区域 */
.url-box {
    background: #fff;
    padding: 20px 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 输入框优化 */
.url-text {
    flex: 1;
    min-width: 200px;
    height: 44px;
    background: #f2f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 22px 0 0 22px;
    padding: 0 15px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.url-text:focus {
    border-color: #007bf5;
    box-shadow: 0 0 0 2px rgba(0, 123, 245, 0.1);
    background: #fff;
}

.url-text::placeholder {
    color: #9ca3af;
}

/* 清空按钮（输入框右侧） */
.clear-btn {
    position: absolute;
    right: calc(120px + 100px + 16px);
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #666;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 5;
}

.clear-btn.show {
    display: flex;
}

.clear-btn:hover {
    background: #d1d5db;
    color: #333;
}

/* 接口选择下拉框优化 */
.url-line {
    height: 44px;
    background: #f2f5f9;
    border: 1px solid #e5e7eb;
    padding: 0 10px;
    border-radius: 0;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    min-width: 140px;
    transition: border-color 0.3s ease;
}

.url-line:focus {
    border-color: #007bf5;
    box-shadow: 0 0 0 2px rgba(0, 123, 245, 0.1);
}

/* 解析按钮优化 */
.btn-parse {
    height: 44px;
    color: #fff;
    border-radius: 0 22px 22px 0;
    border: none;
    background: #007bf5;
    padding: 0 20px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-parse:hover {
    background: #0068d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 245, 0.2);
}

.btn-parse:active {
    transform: translateY(0);
}

.btn-parse:disabled {
    background: #909399;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 快捷操作区 */
.shortcut-box {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.shortcut-btn {
    padding: 6px 12px;
    background: #f2f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shortcut-btn:hover {
    background: #e5e7eb;
    color: #333;
    transform: translateY(-1px);
}

/* 响应式适配 */
@media screen and (max-width: 800px) {
    #palybox {
        height: 300px;
    }

    .url-box {
        flex-direction: column;
        gap: 10px;
        padding: 15px 0;
    }

    .url-text, .url-line, .btn-parse {
        width: 100%;
        border-radius: 22px;
    }

    .guidang {
        padding: 15px;
        margin: 10px auto;
    }

    .tips-box {
        padding: 15px 15px 15px 40px;
        font-size: 14px;
    }

    .clear-btn {
        right: 20px;
    }

    .loading-tips {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 夜间模式兼容 */
.night-bg {
    background: #1f2937 !important;
}

.night-black {
    background: #374151 !important;
    color: #f9fafb !important;
    border-color: #4b5563 !important;
}

.night-border {
    border-color: #4b5563 !important;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}