/* ===================================================================
   FAN Photos - 主样式表 (Main Stylesheet)
   =================================================================== */


/* ===================================================================
   1. 基础与布局 (Base & Layout)
   =================================================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}


/* ===================================================================
   2. 可重用组件 (Reusable Components)
   =================================================================== */

/* ----------------- 2.1 导航栏 (Navigation) ----------------- */

header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover, nav ul li a.active {
    color: #007bff;
}

.nav-item-admin {
    position: relative;
}

.nav-item-admin a {
    color: #dc3545 !important;
    font-weight: bold;
}


/* ----------------- 2.2 表单 (Forms) ----------------- */

.form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8rem;
}
.form-container h3 {
    font-size: 1.2rem;
    color: #333;
    margin-top: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="file"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-group textarea {
    resize: vertical;
}

.required {
    color: #dc3545;
    margin-left: 2px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #6c757d;
}

.input-with-button {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-with-button input {
    flex-grow: 1;
}


/* ----------------- 2.3 按钮 (Buttons) ----------------- */

button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

button[type="submit"]:hover {
    background-color: #0056b3;
}

#autocomplete-btn {
    padding: 0 15px;
    height: 40px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

#autocomplete-btn:hover {
    background-color: #218838;
}

#autocomplete-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn:hover {
    opacity: 0.8;
}
.btn-approve { background-color: #28a745; }
.btn-reject { background-color: #dc3545; }


/* ----------------- 2.4 消息提示框 (Messages & Alerts) ----------------- */

.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    text-align: center;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message a {
    font-weight: bold;
    color: inherit;
}


/* ----------------- 2.5 页脚 (Footer) ----------------- */

footer {
    text-align: center;
    padding: 20px;
    background-color: #343a40;
    color: #f8f9fa;
    margin-top: 40px;
}


/* ===================================================================
   3. 特定页面/功能样式 (Page-specific Styles)
   =================================================================== */

/* ===================================
   首页英雄区域与新搜索框样式 (Flexbox 最终版)
   =================================== */
/* ... .hero-section 和 .hero-content 的样式保持不变 ... */
.hero-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.hero-content h1 {
    font-size: 2.5rem;
    color: #333;
    margin: 0 0 10px 0;
}

.hero-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

/* --- 以下是核心修改 --- */

.search-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.search-wrapper form {
    display: flex; /* 1. 启用 Flexbox 布局 */
    align-items: center; /* 2. 垂直居中所有子元素 */
    position: relative; /* 3. 保持 position 用于图标定位 */
    background-color: #fff; /* 背景色，用于圆角 */
    border-radius: 28px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.search-wrapper form:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}


.search-wrapper .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none; /* 让图标不影响鼠标点击输入框 */
}

.search-wrapper input[type="text"] {
    flex-grow: 1; /* 占据所有剩余空间 */
    border: none; /* 移除自身的边框和背景 */
    background: none;
    padding: 15px 20px 15px 45px; /* 左边距留出图标位置 */
    font-size: 1rem;
    outline: none; /* 移除默认的蓝色轮廓 */
}

.search-wrapper button {
    /* 移除所有定位属性 */
    flex-shrink: 0; /* 防止按钮被压缩 */
    width: 100px;
    height: 42px; /* 给一个固定的、合适的高度 */
    margin: 5px; /* 与外部容器的边距 */
    border: none;
    background-color: #007bff;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 22px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-wrapper button:hover {
    background-color: #0056b3;
}


/* ----------------- 3.2 图库卡片 (Gallery Cards) ----------------- */

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.no-images {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    padding: 50px 0;
}

.gallery-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.gallery-card a {
    text-decoration: none;
    line-height: 0;
}

.gallery-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
}

.card-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-info .card-main-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #212529;
}

.card-info .details-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    color: #495057;
}

.card-info .details-list li {
    margin-bottom: 8px;
    display: flex;
}

.card-info .details-list strong {
    color: #343a40;
    min-width: 70px;
    font-weight: 600;
}

.card-info .meta {
    font-size: 0.85rem;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-item {
    display: flex;
    align-items: center;
}

.meta-item strong {
    color: #666;
    margin-right: 5px;
}

.profile-link {
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
    transition: text-decoration 0.2s;
}

.profile-link:hover {
    text-decoration: underline;
}


/* ----------------- 3.3 分页导航 (Pagination) ----------------- */

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 5px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.pagination-container li a,
.pagination-container li span {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #007bff;
    background-color: #fff;
    border-right: 1px solid #ddd;
    transition: background-color 0.2s;
}

.pagination-container li:last-child a,
.pagination-container li:last-child span {
    border-right: none;
}

.pagination-container li a:hover {
    background-color: #f0f2f5;
}

.pagination-container li.active span {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    cursor: default;
}

.pagination-container li.disabled span {
    color: #aaa;
    background-color: #f8f9fa;
    cursor: not-allowed;
}


/* ----------------- 3.4 图片详情页 (Photo Details) ----------------- */

.photo-details-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.photo-main-image {
    flex: 3;
    min-width: 300px;
}

.photo-main-image img {
    width: 100%;
    border-radius: 6px;
}

.photo-sidebar {
    flex: 2;
    min-width: 300px;
}

.photo-sidebar h2 {
    margin-top: 0;
    font-size: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
    line-height: 1.2;
}

.photo-info-section {
    margin-bottom: 25px;
}

.photo-info-section h3 {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.photo-info-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.photo-info-section ul li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.photo-info-section ul li:last-child {
    border-bottom: none;
}

.photo-info-section ul li strong {
    color: #555;
    margin-right: 15px;
}

.photo-info-section p {
    line-height: 1.6;
    color: #333;
    margin-top: 0;
}

.exif-data .exif-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 20px;
    font-size: 0.95rem;
    color: #444;
}

.exif-data .exif-grid div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exif-data .exif-grid i.fas {
    color: #888;
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}


/* ----------------- 3.5 用户主页 (Profile Page) ----------------- */

.profile-header {
    background-color: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.profile-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    color: #333;
}

.profile-stats {
    color: #6c757d;
    font-size: 1rem;
}

.profile-stats span {
    margin: 0 5px;
}


/* ----------------- 3.6 管理页面 (Admin Page) ----------------- */

.admin-container {
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.admin-table tbody tr:hover {
    background-color: #f1f1f1;
}

.admin-thumb {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.admin-table .actions {
    text-align: center;
    position: relative;
    z-index: 2;
}

.admin-table .exif-cell {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
    white-space: nowrap;
}

.admin-table .exif-cell div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-table .exif-cell i.fas,
.admin-table .exif-cell strong {
    color: #888;
    width: 20px;
    text-align: center;
}

.admin-table .no-exif {
    color: #aaa;
    font-style: italic;
}


/* ===================================================================
   4. 辅助与特效 (Helpers & Effects)
   =================================================================== */

/* ----------------- 4.1 上传等待提示 ----------------- */

#upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#upload-overlay.upload-overlay-hidden {
    opacity: 0;
    pointer-events: none;
}

#upload-overlay p {
    margin-top: 20px;
    font-weight: 500;
}

.upload-spinner, #loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}
#upload-overlay .upload-spinner {
    width: 60px;
    height: 60px;
    border-width: 5px;
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

#loading-spinner.spinner-hidden {
    display: none;
}

/* ----------------- 4.2 导航栏通知气泡 ----------------- */

.notification-bubble {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 10px;
    min-width: 10px;
    text-align: center;
    transform: scale(1);
    animation: bubble-pop 0.5s ease-out;
}

/* ----------------- 4.3 动画 (Animations) ----------------- */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bubble-pop {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* ----------------- 4.4 高亮效果 (Highlights) ----------------- */

.form-group input.autofilled {
    background-color: #e6f7ff;
    border-color: #91d5ff;
}

/* ----------------- 4.5 上传页EXIF展示区 ----------------- */

#exif-info-section {
    grid-column: 1 / -1;
    border-top: 1px solid #eee;
    margin-top: 20px;
    padding-top: 20px;
    opacity: 1;
    transition: opacity 0.5s ease, max-height 0.5s ease, margin 0.5s ease, padding 0.5s ease;
    max-height: 500px;
    overflow: hidden;
}

#exif-info-section.exif-info-section-hidden {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}

#exif-info-section h3 {
    font-size: 1rem;
    color: #555;
    margin-top: 0;
    margin-bottom: 15px;
}

.exif-readonly-input {
    background-color: #f8f9fa;
    color: #495057;
    cursor: default;
    border-color: #dee2e6;
}

.exif-readonly-input:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

/* ===================================
   管理后台统计卡片样式
   =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    color: #007bff;
    background-color: #e6f7ff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.stat-card .stat-icon .fa-clock { color: #ffc107; }
.stat-card .stat-icon .fa-users { color: #28a745; }
.stat-card .stat-icon .fa-user-shield { color: #dc3545; }


.stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.stat-card.stat-card-small {
    padding: 15px 20px;
    gap: 15px;
    text-align: center;
    flex-direction: column;
}
.stat-card.stat-card-small .stat-number { font-size: 1.8rem; }
.stat-card.stat-card-small .stat-label { font-size: 0.85rem; }


/* 审核区域标题 */
.review-section-wrapper {
    margin-top: 40px;
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.review-section-wrapper h2 {
    font-size: 1.5rem;
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* ===================================
   编辑按钮和链接样式
   =================================== */

/* 表格中的编辑按钮 */
.btn-edit {
    background-color: #ffc107; /* 黄色 */
    color: #212529;
}

/* 编辑页的返回链接 */
.btn-back-to-admin {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    color: #343a40;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-back-to-admin:hover {
    background-color: #e2e6ea;
}

/* ===================================
   页脚增强样式 (Footer Enhancements)
   =================================== */
footer {
    padding: 30px 20px; /* 增加上下内边距 */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.qq-join-link {
    margin: 0 0 15px 0;
}

.qq-join-link a {
    display: inline-flex; /* 使用Flex布局让图片和文字垂直居中 */
    align-items: center;
    gap: 8px; /* 图片和文字之间的间距 */
    padding: 8px 15px;
    background-color: #4e5d6c;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.qq-join-link a:hover {
    background-color: #5a6978;
}

.qq-join-link a img {
    /* 限制QQ官方图片的高度，防止过大 */
    height: 20px; 
    vertical-align: middle; /* 确保图片垂直居中 */
}

.qq-join-link a span {
    color: #f8f9fa;
    font-size: 0.9rem;
    font-weight: 500;
}

.copyright {
    margin: 0;
    font-size: 0.85rem;
    color: #adb5bd;
}