/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #3498db;
}

/* 主要内容区域 */
main {
    flex: 1;
    padding: 2rem 0;
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, #3498db, #8e44ad);
    color: white;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 用户信息样式 */
.user-info {
    background: #e8f4fc;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #3498db;
}

/* 电影筛选区域 */
.movie-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    display: flex;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.search-box button {
    border-radius: 0 4px 4px 0;
}

.filter-options {
    display: flex;
    gap: 1rem;
}

.filter-options select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}



/* 按钮样式 */
.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: #2980b9;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
    transition: all 0.3s;
}

.page-link:hover {
    background: #f5f7fa;
    border-color: #3498db;
}

.page-link.current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.page-link.prev, .page-link.next {
    font-weight: bold;
}

/* 表单样式 */
.form-container {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    border-color: #3498db;
    outline: none;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.form-footer a {
    color: #3498db;
    text-decoration: none;
}

/* 消息提示样式 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 1rem;
        justify-content: center;
    }
    
    nav ul li {
        margin: 0 0.75rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .movie-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-options {
        width: 100%;
        justify-content: space-between;
    }
    
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 1.5rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin: 0.5rem 0;
    }
    
    .movies-grid {
        grid-template-columns: 1fr;
    }
    
    .movie-actions {
        flex-direction: column;
    }
    
    .movie-actions .btn {
        width: 100%;
    }
}

/* 验证码相关样式 */
.captcha-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.captcha-input {
    width: 100%;
}

.captcha-image-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-image {
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: 80px; /* 增加高度以适应更大的字体 */
}

.captcha-refresh {
    width: 80px; /* 增加宽度以匹配验证码图片高度 */
    height: 80px; /* 增加高度以匹配验证码图片高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.5rem; /* 增加刷新图标大小 */
    transition: all 0.3s;
}

.captcha-refresh:hover {
    background: #e9ecef;
    transform: rotate(90deg);
}

/* 响应式调整 */
@media (max-width: 480px) {
    .captcha-image-container {
        flex-direction: column;
    }
    
    .captcha-refresh {
        width: 100%;
        height: 50px;
    }
}

/* 首页特定样式 */
.hero-section {
    background: linear-gradient(135deg, #3498db, #8e44ad);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hero-content {
    flex: 2;
    max-width: 800px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 300px;
}

.floating-element {
    position: absolute;
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

.floating-element:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 1s;
}

.floating-element:nth-child(3) {
    bottom: 20%;
    right: 10%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.method-section, .features-section, .testimonials-section {
    padding: 5rem 0;
}

.method-section {
    background-color: #f8f9fa;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: #7f8c8d;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.method-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.step-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.step-card:hover {
    transform: translateY(-10px);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.step-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.feature-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

.testimonials-section {
    background-color: #f8f9fa;
}

/* 修复推荐卡片高度问题 */
.testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    align-items: stretch; /* 确保所有卡片高度一致 */
}

.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%; /* 确保卡片填满网格单元格 */
    min-height: 200px; /* 设置最小高度 */
}

.testimonial-card::before {
    content: """;
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 4rem;
    color: #3498db;
    opacity: 0.2;
    font-family: Georgia, serif;
}

.testimonial-content {
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #555;
    flex-grow: 1; /* 内容区域填充剩余空间 */
    display: flex;
    align-items: center; /* 垂直居中内容 */
}

.testimonial-content p {
    margin: 0; /* 移除段落默认边距 */
    width: 100%; /* 确保段落宽度填满容器 */
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    margin-top: auto; /* 将作者信息推到卡片底部 */
}

.testimonial-author strong {
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.testimonial-author span {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .testimonials {
        grid-template-columns: 1fr;
    }
    
    .testimonial-card {
        min-height: 180px; /* 在移动设备上稍微减小最小高度 */
    }
}

.cta-section {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .floating-element {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .method-steps, .features-grid, .testimonials {
        grid-template-columns: 1fr;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .step-card, .feature-card, .testimonial-card {
        padding: 1.5rem;
    }
}

/* Logo 样式 */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
}

.logo-image {
    height: 40px;
    width: auto;
    transition: transform 0.3s;
}

.logo-image:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: 10px;
    display: none; /* 默认隐藏，只在图片加载失败时显示 */
}

/* 退出按钮样式 */
.logout-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

.logout-btn:hover {
    color: #3498db;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .logo-image {
        height: 35px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 30px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
}

.book-images {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
/*    background-color: black;*/
}

.bookimg {
    flex: 1;
    max-width: 450px;
    text-align: center;
    display: flex;
    align-items: center; /* 垂直居中 /
    justify-content: center; / 水平居中 */

}

.bookimg img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-image {
    max-height: 450px; /* 最大高度限制 */
  max-width: 100%; /* 宽度最大不超过容器 */
  width: auto; /* 宽度自适应 */
  height: auto; /* 高度自适应，但受max-height限制 */
  object-fit: contain;
}






/* 响应式调整 */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.movie-card {
    position: relative;
    height: 450px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.movie-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.movie-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s;
    background-color: #f5f7fa; /* 默认背景色，图片加载失败时显示 */
}

.movie-card:hover .movie-bg {
    transform: scale(1.03);
}

.movie-title-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(128, 128, 128, 0.7);
    padding: 12px 0;
    text-align: center;
    z-index: 10;
}

.movie-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .movie-card {
        height: 420px;
    }
}

@media (max-width: 768px) {
    .movies-grid {
        grid-template-columns: 1fr;
    }
    
    .movie-card {
        height: 450px;
    }
    
    .movie-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .movie-card {
        height: 375px;
    }
    
    .movie-title {
        font-size: 0.9rem;
    }
}