* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

body.has-results {
    align-items: flex-start;
    padding-top: 40px;
}

/* 暗黑模式样式 */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 700px;
    margin: 0 auto;
}

/* 暗黑模式下的搜索卡片 */
body.dark-mode .search-card {
    background: rgba(30, 30, 50, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.has-results .search-card {
    max-width: 100%;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 暗黑模式下的结果状态搜索卡片 */
body.dark-mode.has-results .search-card {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 暗黑模式下的切换按钮 */
body.dark-mode .dark-mode-toggle {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 快捷键提示 */
.shortcuts-hint {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.shortcuts-hint:hover {
    opacity: 1;
}

.shortcuts-hint span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.shortcuts-hint kbd {
    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 
        0 1px 0 rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: #333;
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

/* 暗黑模式下的快捷键提示 */
body.dark-mode .shortcuts-hint {
    color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .shortcuts-hint:hover {
    color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .shortcuts-hint kbd {
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 1px 0 rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

/* 暗黑模式下的标题 */
body.dark-mode h1 {
    color: #e0e0e0;
    background: linear-gradient(135deg, #8b9ce8 0%, #a384d8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-section {
    margin-bottom: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.has-results .search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
}

#searchInput {
    flex: 1;
    padding: 15px 45px 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: border-color 0.3s;
}

/* 暗黑模式下的输入框 */
body.dark-mode #searchInput {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

body.dark-mode #searchInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
}

/* 暗黑模式下的输入框焦点 */
body.dark-mode #searchInput:focus {
    border-color: #8b9ce8;
    background: rgba(255, 255, 255, 0.15);
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.clear-btn:hover {
    background: #f0f0f0;
    color: #666;
}

/* 暗黑模式下的清除按钮 */
body.dark-mode .clear-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

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

#searchBtn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 暗黑模式下的搜索按钮 */
body.dark-mode #searchBtn {
    background: linear-gradient(135deg, #8b9ce8 0%, #a384d8 100%);
}

body.dark-mode #searchBtn:hover {
    box-shadow: 0 5px 15px rgba(139, 156, 232, 0.4);
}

#searchBtn:active {
    transform: translateY(0);
}

.search-type {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.search-type label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}

.search-type input[type="radio"] {
    cursor: pointer;
}

.search-history {
    margin-top: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.clear-history {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-history:hover {
    background: #e0e0e0;
    color: #666;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
}

.history-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
}

.history-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 12px;
    transition: all 0.2s;
}

.history-item:hover .history-remove {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.history-remove:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.2);
}

.loading {
    padding: 20px;
}

/* 骨架屏加载动画 */
.skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skeleton-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-poster {
    width: 100px;
    height: 150px;
    background: linear-gradient(90deg, 
        rgba(103, 126, 234, 0.1) 0%, 
        rgba(103, 126, 234, 0.2) 50%, 
        rgba(103, 126, 234, 0.1) 100%);
    border-radius: 8px;
    background-size: 200% 100%;
    animation: skeletonWave 1.5s ease-in-out infinite;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    background: linear-gradient(90deg, 
        rgba(103, 126, 234, 0.1) 0%, 
        rgba(103, 126, 234, 0.2) 50%, 
        rgba(103, 126, 234, 0.1) 100%);
    border-radius: 4px;
    background-size: 200% 100%;
    animation: skeletonWave 1.5s ease-in-out infinite;
}

.skeleton-meta {
    height: 20px;
    width: 40%;
    background: linear-gradient(90deg, 
        rgba(103, 126, 234, 0.1) 0%, 
        rgba(103, 126, 234, 0.2) 50%, 
        rgba(103, 126, 234, 0.1) 100%);
    border-radius: 4px;
    background-size: 200% 100%;
    animation: skeletonWave 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, 
        rgba(103, 126, 234, 0.1) 0%, 
        rgba(103, 126, 234, 0.2) 50%, 
        rgba(103, 126, 234, 0.1) 100%);
    border-radius: 4px;
    background-size: 200% 100%;
    animation: skeletonWave 1.5s ease-in-out infinite;
}

.skeleton-text:nth-child(3) { width: 100%; }
.skeleton-text:nth-child(4) { width: 90%; }
.skeleton-text:nth-child(5) { width: 95%; }

@keyframes skeletonWave {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 暗黑模式下的骨架屏 */
body.dark-mode .skeleton-item {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .skeleton-poster,
body.dark-mode .skeleton-title,
body.dark-mode .skeleton-meta,
body.dark-mode .skeleton-text {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid rgba(204, 51, 51, 0.2);
    font-weight: 500;
}

/* 暗黑模式下的错误提示 */
body.dark-mode .error {
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.hidden {
    display: none !important;
}

.results {
    display: grid;
    gap: 20px;
}

.results-wrapper {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗黑模式下的结果包装器 */
body.dark-mode .results-wrapper {
    background: rgba(30, 30, 50, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body.has-results .results-wrapper {
    max-width: 100%;
    opacity: 1;
    transform: translateY(0);
}

.results-wrapper.hidden {
    display: none !important;
}

.result-item {
    position: relative;
    display: flex;
    flex-direction: column; /* 始终使用纵向布局 */
    gap: 20px;
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
    margin: 15px 0;
}

/* 暗黑模式下的结果项 */
body.dark-mode .result-item {
    background: rgba(30, 30, 50, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.result-item:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 暗黑模式下的结果项悬停 */
body.dark-mode .result-item:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.poster {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.poster:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.poster-wrapper {
    position: relative;
    flex-shrink: 0;
}

.download-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.poster-wrapper:hover .download-hint {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-info h3 {
    color: #333;
    font-size: 1.4em;
}

/* 暗黑模式下的结果标题 */
body.dark-mode .result-info h3 {
    color: #e0e0e0;
}

/* 暗黑模式下的概述文本 */
body.dark-mode .overview {
    color: #b0b0b0;
}

/* 暗黑模式下的类型和ID标签 */
body.dark-mode .type,
body.dark-mode .tmdb-id {
    color: #c0c0c0;
}

/* 暗黑模式下的强调文本 */
body.dark-mode .tmdb-id strong {
    color: #e0e0e0;
}

/* 暗黑模式下的类型标签 */
body.dark-mode .type-movie {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd93d;
}

body.dark-mode .type-tv {
    background: rgba(116, 185, 255, 0.2);
    color: #74b9ff;
}

.meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.type-movie {
    background: #ffeaa7;
    color: #fdcb6e;
}

.type-tv {
    background: #dfe6e9;
    color: #74b9ff;
}

.tmdb-id {
    color: #666;
    font-size: 14px;
}

.tmdb-id strong {
    color: #333;
    font-size: 16px;
    user-select: all;
}

.overview {
    color: #666;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end; /* 按钮靠右对齐 */
    align-items: center;
    margin-top: 15px; /* 在简介下方留间距 */
    flex-wrap: wrap; /* 允许按钮换行 */
}

.copy-btn, .copy-tmdb-btn, .copy-full-btn, .tmdb-link {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap; /* 防止按钮文字换行 */
}

.copy-btn, .copy-tmdb-btn, .copy-full-btn {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.copy-btn:hover, .copy-tmdb-btn:hover, .copy-full-btn:hover {
    background: #e0e0e0;
}

.copy-btn.copied, .copy-tmdb-btn.copied, .copy-full-btn.copied {
    background: #00b894;
    color: white;
    border-color: #00b894;
}

.tmdb-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.tmdb-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

/* 暗黑模式下的TMDB链接 */
body.dark-mode .tmdb-link {
    background: linear-gradient(135deg, #8b9ce8 0%, #a384d8 100%);
}

body.dark-mode .tmdb-link:hover {
    box-shadow: 0 3px 10px rgba(139, 156, 232, 0.3);
}

/* 展开按钮样式 - 重新设计 */
.expand-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(103, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(103, 126, 234, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.expand-btn:hover {
    background: rgba(103, 126, 234, 0.2);
    transform: scale(1.1);
}

.expand-icon {
    transition: transform 0.3s ease;
    font-size: 10px;
}

/* 结果卡片需要相对定位 */
.result-item {
    position: relative;
}

/* 暗黑模式下的展开按钮 */
body.dark-mode .expand-btn {
    background: rgba(139, 156, 232, 0.1);
    color: #8b9ce8;
    border-color: rgba(139, 156, 232, 0.2);
}

body.dark-mode .expand-btn:hover {
    background: rgba(139, 156, 232, 0.2);
}

/* 详情面板样式 */
.detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-10px);
}

.detail-panel.expanded {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
    padding: 20px 0 10px 0;
    margin-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* 暗黑模式下的详情面板 */
body.dark-mode .detail-panel.expanded {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* 主要内容区域 - 水平布局保持海报和文字横排 */
.result-main-content {
    display: flex;
    gap: 20px;
    width: 100%;
}

/* 结果卡片展开状态 - 不再需要改变布局方向 */
.result-item.expanded {
    background: rgba(103, 126, 234, 0.05);
    margin: 20px 0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

/* 展开状态下的主要内容区域保持水平布局 */
.result-item.expanded .result-main-content {
    display: flex;
    gap: 20px;
    width: 100%;
}

/* 暗黑模式下的展开卡片 */
body.dark-mode .result-item.expanded {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 详情包装器 */
.detail-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 加载状态 */
.detail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    color: #666;
}

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

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

/* 暗黑模式下的加载状态 */
body.dark-mode .detail-loading {
    color: #aaa;
}

body.dark-mode .loading-spinner {
    border-color: #444;
    border-top-color: #8b9ce8;
}

/* 影片统计信息 - 更紧凑的水平布局 */
.movie-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* 暗黑模式下的统计信息 */
body.dark-mode .movie-stats {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .stat-label {
    color: #aaa;
}

body.dark-mode .stat-value {
    color: #e0e0e0;
}

/* 紧凑的演员表样式 */
.cast-list-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    line-height: 1.4;
}

.cast-item-compact {
    font-size: 14px;
    color: #333;
    background: rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.cast-item-compact strong {
    color: #667eea;
}

/* 暗黑模式下的紧凑演员表 */
body.dark-mode .cast-item-compact {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .cast-item-compact strong {
    color: #8b9ce8;
}

/* 演员表样式 - 保留旧版本作为备用 */
.cast-section,
.similar-section {
    margin-bottom: 20px;
}

.cast-section h4,
.similar-section h4 {
    color: #333;
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(103, 126, 234, 0.2);
}

.cast-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.cast-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.actor-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.character-name {
    font-size: 12px;
    color: #666;
    opacity: 0.8;
}

/* 暗黑模式下的演员表 */
body.dark-mode .cast-section h4,
body.dark-mode .similar-section h4 {
    color: #e0e0e0;
    border-bottom-color: rgba(139, 156, 232, 0.3);
}

body.dark-mode .cast-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .actor-name {
    color: #e0e0e0;
}

body.dark-mode .character-name {
    color: #aaa;
}

/* 相似推荐样式 */
.similar-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.similar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.similar-item:hover {
    background: rgba(103, 126, 234, 0.1);
    transform: translateY(-2px);
}

body.dark-mode .similar-item {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .similar-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.similar-poster {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 8px;
}

.similar-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.similar-title {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
}

body.dark-mode .similar-title {
    color: #e0e0e0;
}

.similar-rating {
    font-size: 0.85em;
    color: #f39c12;
}

/* 系列标签样式 */
.type-collection {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
}

/* 系列详情样式 */
.collection-overview {
    margin-bottom: 20px;
}

.collection-description {
    margin-bottom: 15px;
}

.collection-description h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

body.dark-mode .collection-description h4 {
    color: #e0e0e0;
}

.collection-description p {
    color: #666;
    line-height: 1.6;
}

body.dark-mode .collection-description p {
    color: #b0b0b0;
}

.collection-stats {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.collection-movies {
    margin-top: 20px;
}

.collection-movies h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}

body.dark-mode .collection-movies h4 {
    color: #e0e0e0;
}

.collection-movies-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.collection-movie-item {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    padding: 10px;
    transition: all 0.3s ease;
}

.collection-movie-item:hover {
    background: rgba(103, 126, 234, 0.1);
    transform: translateY(-2px);
}

body.dark-mode .collection-movie-item {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .collection-movie-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.collection-movie-poster {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 8px;
}

.collection-movie-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.collection-movie-title {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    line-height: 1.2;
}

body.dark-mode .collection-movie-title {
    color: #e0e0e0;
}

.collection-movie-year {
    color: #888;
    font-size: 0.85em;
}

.collection-movie-rating {
    color: #f39c12;
    font-size: 0.85em;
}

.collection-movie-link {
    color: #677eea;
    font-size: 0.85em;
    text-decoration: none;
    margin-top: 5px;
    transition: color 0.3s ease;
}

.collection-movie-link:hover {
    color: #5568c3;
    text-decoration: underline;
}

body.dark-mode .collection-movie-link {
    color: #8fa2ff;
}

body.dark-mode .collection-movie-link:hover {
    color: #a8b8ff;
}

/* 季信息样式 */
.seasons-section {
    margin-top: 20px;
}

.seasons-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}

body.dark-mode .seasons-section h4 {
    color: #e0e0e0;
}

.seasons-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.season-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: rgba(103, 126, 234, 0.05);
    border: 1px solid rgba(103, 126, 234, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.season-item:hover {
    background: rgba(103, 126, 234, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(103, 126, 234, 0.15);
}

body.dark-mode .season-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .season-item:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.season-number {
    font-weight: 600;
    color: #677eea;
    font-size: 1em;
    margin-bottom: 4px;
}

body.dark-mode .season-number {
    color: #8fa2ff;
}

.season-episodes {
    color: #333;
    font-size: 0.9em;
    font-weight: 500;
}

body.dark-mode .season-episodes {
    color: #e0e0e0;
}

.season-year {
    color: #888;
    font-size: 0.85em;
    margin-top: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .seasons-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .season-item {
        padding: 8px;
    }

    .season-number {
        font-size: 0.9em;
    }

    .season-episodes {
        font-size: 0.85em;
    }

    .season-year {
        font-size: 0.75em;
    }
}

/* 下载进度提示样式 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.similar-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.similar-poster {
    width: 60px;
    height: 90px;
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 10px;
}

.similar-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.similar-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.similar-rating {
    font-size: 11px;
    color: #ffd700;
    font-weight: 500;
}

/* 暗黑模式下的相似推荐 */
body.dark-mode .similar-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .similar-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .similar-title {
    color: #e0e0e0;
}

/* 错误消息和重试按钮 */
.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    color: #666;
}

.retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.retry-btn:hover {
    background: #5a67d8;
}

/* 暗黑模式下的错误消息 */
body.dark-mode .error-message {
    color: #aaa;
}

body.dark-mode .retry-btn {
    background: #8b9ce8;
}

body.dark-mode .retry-btn:hover {
    background: #7c8ce0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .movie-stats {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .cast-list {
        grid-template-columns: 1fr;
    }
    
    .similar-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-item.expanded {
        margin: 15px 0;
        padding: 15px;
    }
}

.no-results {
    text-align: center;
    color: #999;
    font-size: 18px;
    padding: 40px;
}

.api-setup {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
}

.api-setup h3 {
    color: #333;
    margin-bottom: 20px;
}

.api-setup ol {
    margin-left: 20px;
    color: #666;
    line-height: 2;
}

.api-setup a {
    color: #667eea;
    text-decoration: none;
}

.api-setup a:hover {
    text-decoration: underline;
}

/* 下载选项面板 */
.download-options {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border-radius: 8px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 5px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 120px;
}

.download-size-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    white-space: nowrap;
}

.download-size-btn:hover {
    background: rgba(102, 126, 234, 0.8);
    border-color: rgba(102, 126, 234, 1);
    transform: translateY(-1px);
}

/* 暗黑模式下的下载选项 */
body.dark-mode .download-options {
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .download-size-btn:hover {
    background: rgba(139, 156, 232, 0.8);
    border-color: rgba(139, 156, 232, 1);
}

/* 下载提示样式 */
.download-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.3s ease;
    max-width: 300px;
}

.download-toast.success {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

.download-toast.progress {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.download-toast.alternative {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    padding: 15px 20px;
}

.download-toast.alternative small {
    display: block;
    margin-top: 5px;
    opacity: 0.9;
    font-size: 12px;
}

.download-toast.fallback {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    padding: 15px 20px;
}

.download-toast.fallback small {
    display: block;
    margin-top: 5px;
    opacity: 0.9;
    font-size: 12px;
}

.download-progress-bar {
    margin-top: 8px;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.download-progress-bar::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 暗黑模式下的搜索历史 */
body.dark-mode .search-history {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 暗黑模式下的历史标题 */
body.dark-mode .history-header {
    color: #c0c0c0;
}

body.dark-mode .history-item {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .history-item:hover {
    background: linear-gradient(135deg, #8b9ce8 0%, #a384d8 100%);
    color: white;
    border-color: transparent;
}

/* 暗黑模式下的历史删除按钮 */
body.dark-mode .history-remove {
    background: rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

body.dark-mode .history-item:hover .history-remove {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* 暗黑模式下的按钮 */
body.dark-mode .copy-btn,
body.dark-mode .copy-tmdb-btn,
body.dark-mode .copy-full-btn,
body.dark-mode .clear-history {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .copy-btn:hover,
body.dark-mode .copy-tmdb-btn:hover,
body.dark-mode .copy-full-btn:hover,
body.dark-mode .clear-history:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 暗黑模式下的搜索类型 */
body.dark-mode .search-type label {
    color: #e0e0e0;
}

body.dark-mode input[type="radio"]:checked + span {
    color: #8b9ce8;
}

/* 暗黑模式下的加载和错误提示 */
body.dark-mode .loading,
/* 暗黑模式下的无结果提示 */
body.dark-mode .no-results {
    color: #b0b0b0;
}

/* 暗黑模式下的返回顶部按钮 */
body.dark-mode .back-to-top {
    background: rgba(139, 156, 232, 0.8);
}

body.dark-mode .back-to-top:hover {
    background: rgba(139, 156, 232, 1);
}

/* 暗黑模式下的下载提示 */
body.dark-mode .download-toast {
    background: linear-gradient(135deg, #8b9ce8, #a384d8);
}

body.dark-mode .download-toast.success {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

body.dark-mode .download-toast.fallback {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .search-card {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .input-wrapper {
        width: 100%;
    }
    
    #searchBtn {
        width: 100%;
    }
    
    .result-item {
        position: relative;
        padding: 15px;
        min-height: 180px;
    }
    
    .poster {
        position: absolute;
        left: 15px;
        top: 15px;
        width: 80px;
        height: 120px;
        object-fit: cover;
    }
    
    .result-info {
        margin-left: 100px;
    }
    
    .result-info h3 {
        font-size: 1.1em;
    }
    
    .overview {
        display: none;
    }
    
    .meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .actions {
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .result-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 15px;
        min-height: auto;
    }
    
    .poster {
        position: relative;
        left: auto;
        top: auto;
        width: 150px;
        height: 225px;
        margin-bottom: 15px;
    }
    
    .result-info {
        margin-left: 0;
        width: 100%;
    }
    
    .meta {
        justify-content: center;
    }
    
    .actions {
        justify-content: center;
    }
    
    .tmdb-id strong {
        display: block;
        margin-top: 5px;
    }
}

.back-to-top {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:active {
    transform: translateY(-50%) scale(0.95);
}

@media (max-width: 768px) {
    .back-to-top {
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}