/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    background-color: #f5f5f5;
    background-image: url('/static/css/all/bg.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
}

/* 链接样式 */
a {
    color: #2196F3;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #1976D2;
}

/* ICP备案链接下划线动画 */
.icp-link {
    position: relative;
}

.icp-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transform: translateX(-50%);
    transition: width 0.5s ease;
}

.icp-link:hover::after {
    width: 100%;
}

/* 表单样式 */
form {
    width: 100%;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* 按钮基础样式 */
button,
.btn,
input[type="submit"] {
    cursor: pointer;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: #2196F3;
    color: white;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
    background-color: #1976D2;
}

button:active,
.btn:active,
input[type="submit"]:active {
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

/* 错误信息样式 */
.error-message {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* 提示信息样式 */
.flash-message {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #2196F3;
}

/* 头部样式 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo a {
    color: #2196F3;
    text-decoration: none;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
}

.search-bar button {
    border-radius: 0 8px 8px 0;
    padding: 10px 20px;
}

/* 用户信息样式 */
.nav-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.user-info:hover {
    background-color: #f5f5f5;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    min-width: 160px;
    z-index: 1001;
    display: none;
}

.user-info:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
    color: #2196F3;
}

/* 登录/注册按钮 */
.login-btn,
.register-btn,
.upload-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.login-btn {
    background-color: #f5f5f5;
    color: #333;
}

.login-btn:hover {
    background-color: #e0e0e0;
    color: #333;
}

.register-btn {
    background-color: #2196F3;
    color: white;
}

.register-btn:hover {
    background-color: #1976D2;
    color: white;
}

.upload-btn {
    background-color: #4CAF50;
    color: white;
}

.upload-btn:hover {
    background-color: #45a049;
    color: white;
}

/* 主内容区域 */
main {
    min-height: calc(100vh - 160px);
    padding: 40px 0;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    margin-top: 40px;
}

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

.footer-container p {
    color: white;
    margin: 0;
    font-size: 14px;
    margin-bottom: 8px;
}

.icp-link {
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.icp-link:hover {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.icp-icon {
    vertical-align: middle;
    max-height: 16px;
    width: auto;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: white;
    margin-top: 0;
}

/* 错误页面样式 */
.error-container {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.error-container h1 {
    font-size: 64px;
    font-weight: bold;
    color: #f44336;
    margin-bottom: 20px;
}

.error-container p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.error-container .btn {
    display: inline-block;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-bar {
        width: 100%;
        margin: 0;
    }
    
    .nav-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.modal-header {
    background-color: #2196F3;
    color: white;
    padding: 20px;
    text-align: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 30px 20px;
    text-align: center;
    color: #333;
    line-height: 1.6;
}

.modal-body p {
    margin: 0;
    font-size: 16px;
}

.modal-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #2196F3;
    color: white;
}

.modal-btn:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

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

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 模态框类型样式 */
.modal.success .modal-header {
    background-color: #4CAF50;
}

.modal.error .modal-header {
    background-color: #f44336;
}

.modal.info .modal-header {
    background-color: #2196F3;
}

.modal.confirm .modal-header {
    background-color: #FF9800;
}