/* 全局变量定义 */
:root {
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --text-primary: #2c3e50;
    --text-secondary: #666;
    --text-light: #999;
    --bg-primary: #f0f4f8;
    --bg-secondary: #f8f9fa;
    --bg-white: #fff;
    --border-color: #eaeaea;
    --border-light: #ddd;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 2px 12px rgba(0,0,0,0.08);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --accent-color: #dc3545;
}

/* 基础样式 */
body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-primary);
    color: #333;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

h1 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-size: 2.5em;
}

/* 网格布局 */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* 卡片样式 */
.movie-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s;
}

.movie-card:hover {
    transform: translateY(-5px);
}

.movie-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.movie-info {
    padding: 15px;
}

.movie-title {
    height: 2em;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.movie-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-actions {
    display: flex;
    gap: 12px;
    padding: 15px;
    border-top: 1px solid #f0f0f0;
}

.detail-btn,
.download-btn {
    flex: 1;
    padding: 8px 0;
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.detail-btn {
    background-color: #f5f5f5;
    color: var(--text-secondary);
    border: 1px solid #e0e0e0;
}

.detail-btn:hover {
    background-color: #e8e8e8;
    color: #333;
}

.download-btn {
    background-color: var(--primary-color);
    color: var(--bg-white);
    border: 1px solid var(--primary-color);
}

.download-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.download-btn:active {
    transform: translateY(0);
}

/* 导航样式 */
nav {
    text-align: right;
}

.nav-link {
    height: 44px;  /* 与搜索框和搜索按钮保持一致的高度 */
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

.nav-link::before {
    content: "🔥";
    margin-right: 6px;
    font-size: 16px;
}

.nav-link:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.nav-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

.nav-link.active {
    background-color: var(--primary-hover);
    pointer-events: none;
}

/* 搜索相关样式 */
.search-container {
    max-width: 900px;
    position: relative;
    margin: 0 auto;
}

.search-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    min-width: 0;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 10px 35px 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 16px;
    transition: all 0.2s ease;
    background: var(--bg-white);
    color: #333;
    box-sizing: border-box;
}

.search-input:hover {
    border-color: var(--border-light);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-input::placeholder {
    color: var(--text-light);
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    display: none;
    z-index: 2;
}

.clear-search:hover {
    color: var(--text-secondary);
}

.search-button {
    height: 44px;
    padding: 0 20px;
    background: var(--primary-color);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.search-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.search-button:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        text-align: center;
    }

    .nav-link {
        width: 100%;
        padding: 0;
        justify-content: center;
    }

    .search-form {
        flex-direction: column;
        gap: 10px;
    }

    .search-button {
        width: 100%;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .movie-actions {
        padding: 12px;
        gap: 8px;
    }

    .detail-btn,
    .download-btn {
        padding: 10px 0;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }

    .search-input {
        font-size: 14px;
    }

    .nav-link {
        padding: 0;
        font-size: 13px;
    }
}

.no-results-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 15px;
}

/* 搜索帮助区块 */
.search-help {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* 桌面端两列布局 */
@media (min-width: 992px) {
    .search-help {
        display: flex;
        gap: 40px;
        align-items: flex-start;
        text-align: left;
        padding: 40px;
    }

    .search-content {
        flex: 1;
        padding-right: 40px;
        border-right: 1px solid #eee;
    }

    .demand-section {
        flex: 1;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
}

/* 搜索提示部分 */
.search-content {
    margin-bottom: 0;
}

.search-help-icon {
    color: #dc3545;
    margin-bottom: 15px;
}

.search-help h3 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 15px;
}

.highlight {
    color: #dc3545;
    font-weight: 500;
}

.search-tips {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.search-tips h4 {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.search-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-tips li {
    color: #666;
    margin: 8px 0;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

.search-tips li:before {
    content: "•";
    color: #dc3545;
    margin-right: 8px;
}

/* 需求登记区块 */
.demand-section {
    border-top: 1px solid #eee;
}

.demand-icon {
    color: #4a90e2;
    margin-bottom: 15px;
}

.demand-content h3 {
    color: #2c3e50;
    font-size: 1.2em;
    margin-bottom: 8px;
}

.demand-desc {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.demand-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    position: relative;
}

.form-group label {
    color: #4a5568;
    font-size: 0.9em;
    font-weight: 500;
}

.form-group input {
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s;
    background: #f8f9fa;
}

.form-group input:focus {
    background: #fff;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74,144,226,0.1);
    outline: none;
}

.email-hint {
    font-size: 0.8em;
    color: #666;
    margin-top: 4px;
}

.demand-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.demand-submit:hover {
    background: #357abd;
    transform: translateY(-1px);
}

.demand-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-icon {
    transition: transform 0.3s;
}

.demand-submit:hover .submit-icon {
    transform: translateX(4px);
}

.demand-submit.success {
    background: #34c759;
}

.demand-submit.error {
    background: #dc3545;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 991px) {
    .search-help {
        text-align: center;
    }

    .demand-section {
        margin-top: 25px;
        padding-top: 25px;
        border-top: 1px solid #eee;
    }
}

@media (max-width: 768px) {
    .no-results-container {
        margin: 20px 15px;
    }

    .demand-section {
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }

    .demand-icon {
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2em;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .no-results {
        margin: 10px;
        padding: 20px 15px;
    }

    .demand-form {
        padding: 0 10px;
    }

    .movie-actions {
        padding: 12px;
        gap: 8px;
    }

    .detail-btn,
    .download-btn {
        padding: 10px 0;
        font-size: 13px;
    }
}

/* Video Page Styles */
.video-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.video-info {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.video-header {
    margin-bottom: 20px;
}

.video-header h1 {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.video-stats {
    color: #666;
    font-size: 0.9em;
}

.video-stats span {
    margin-right: 20px;
}

.video-actions {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.download-btn,
.share-btn {
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.download-btn {
    background: #4a90e2;
    color: #fff;
    text-decoration: none;
}

.share-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
}

.video-description {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.video-description h2 {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 15px;
}

.related-videos {
    margin-top: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.related-videos h2 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.video-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-cover {
    max-width: 300px;
    margin: 20px auto;
    border-radius: 12px;
    overflow: hidden;
}

.splash-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.video-item:hover .video-cover img {
    transform: scale(1.05);
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 1em;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-meta {
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.back-to-home {
    margin-bottom: 20px;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #4a90e2;
    border: none;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.home-btn:hover {
    background: #357abd;
}

.home-btn i {
    margin-right: 8px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .video-detail {
        padding: 15px;
    }

    .video-info {
        padding: 20px;
    }

    .video-header h1 {
        font-size: 1.5em;
    }

    .video-actions {
        flex-direction: column;
    }

    .download-btn,
    .share-btn {
        width: 100%;
        text-align: center;
    }

    .related-videos {
        padding: 20px;
        margin-top: 20px;
    }

    .video-grid {
        gap: 15px;
    }

    .video-title {
        font-size: 0.9em;
    }

    .video-cover {
        max-width: 250px;
    }

    .back-to-home {
        margin: 10px 0 15px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-cover {
        max-width: 200px;
    }
}

/* Search Page Styles */
.search-container {
    max-width: 900px;
    position: relative;
    margin: 0 auto;
}

.search-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    min-width: 0;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 10px 35px 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 16px;
    transition: all 0.2s ease;
    background: var(--bg-white);
    color: #333;
    box-sizing: border-box;
}

.search-input:hover {
    border-color: var(--border-light);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-input::placeholder {
    color: var(--text-light);
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    display: none;
    z-index: 2;
}

.clear-search:hover {
    color: var(--text-secondary);
}

.search-button {
    height: 44px;
    padding: 0 20px;
    background: var(--primary-color);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.search-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.search-button:active {
    transform: translateY(0);
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.5rem;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-container label {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.page-size-select {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.page-size-select:hover {
    border-color: #b3b3b3;
}

.page-size-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.search-stats {
    margin-bottom: 1.5rem;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-stats::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #4a90e2;
    border-radius: 50%;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 2rem 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.pagination-button {
    min-width: 100px;
    height: 40px;
    padding: 0 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-button:hover:not(:disabled) {
    border-color: #4a90e2;
    color: #4a90e2;
}

.pagination-button:disabled {
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
    cursor: not-allowed;
}

.page-info {
    color: #666;
    font-size: 14px;
    padding: 0 12px;
    white-space: nowrap;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.page-size-selector label {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .page-size-selector {
        margin-left: 0;
        margin-top: 16px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .search-form {
        flex-direction: column;
        gap: 12px;
    }

    .search-button {
        width: 100%;
    }

    .search-input {
        font-size: 14px;
    }
}