/* common.css - 所有页面共享的样式 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "Segoe UI", "Source Han Sans CN", sans-serif;
}

body {
    background-color: #0A0A0F;
    color: #E0E0E0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input, select, textarea {
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    flex: 1;
}

/* 顶部导航栏 */
.header {
    width: 100%;
    height: 60px;
    background-color: #1A1A24;
    border-bottom: 2px solid #007BFF;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-icon {
    color: #007BFF;
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(to right, #007BFF, #6F42C1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-item {
    font-size: 16px;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-item:hover, .nav-item.active {
    color: #007BFF;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #007BFF;
}

.user-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #007BFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login, .btn-register {
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-login {
    background-color: transparent;
    border: 1px solid #007BFF;
    color: #007BFF;
}

.btn-register {
    background: linear-gradient(to right, #007BFF, #6F42C1);
    color: white;
}

.btn-login:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* 按钮样式 */
.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(to right, #007BFF, #6F42C1);
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, opacity 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-secondary {
    padding: 10px 20px;
    background-color: #6C757D;
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-danger {
    padding: 10px 20px;
    background: linear-gradient(to right, #FF4500, #FF8C00);
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-danger:hover {
    transform: translateY(-2px);
}

/* 卡片样式 */
.card {
    background-color: #1A1A24;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    color: #007BFF;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

/* 表单控件 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #999;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background-color: #2C2C2C;
    border: 1px solid #444;
    border-radius: 5px;
    color: white;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #007BFF;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #1A1A24;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #FF4500;
}

.modal h2 {
    margin-bottom: 20px;
    color: #007BFF;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2C2C2C;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.page-btn:hover:not(.disabled) {
    background-color: #444;
}

.page-btn.active {
    background-color: #007BFF;
    color: white;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 底部栏 */
.footer {
    width: 100%;
    background-color: #1A1A24;
    margin-top: 50px;
    padding: 30px 0;
    border-top: 1px solid #333;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: #999;
    transition: color 0.3s;
    cursor: pointer;
}

.footer-link:hover {
    color: #007BFF;
}

.copyright {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
}

.tech-support {
    color: #444;
    font-size: 12px;
    text-align: right;
    width: 100%;
    margin-top: 10px;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .nav-menu {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .user-actions .username {
        display: none;
    }
    
    .footer-links {
        gap: 15px;
    }
}

/* 加载动画 */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 123, 255, 0.3);
    border-top-color: #007BFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #444;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.badge-primary {
    background-color: rgba(0, 123, 255, 0.2);
    color: #007BFF;
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28A745;
}

.badge-warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.badge-danger {
    background-color: rgba(220, 53, 69, 0.2);
    color: #DC3545;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th {
    background-color: #2C2C2C;
    padding: 12px 15px;
    text-align: left;
    color: #007BFF;
    border-bottom: 2px solid #007BFF;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #333;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}
/* 在原有common.css文件末尾添加以下样式 */

/* 用户菜单样式 */
.user-menu {
    position: absolute;
    top: 60px;
    right: 15px;
    background-color: #1A1A24;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px 0;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.user-menu a, .user-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #E0E0E0;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s;
}

.user-menu a:hover, .user-menu button:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* 全局提示样式 */
.global-alert {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 20px;
    background: #007BFF;
    color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    animation-fill-mode: forwards;
    max-width: 300px;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.global-alert.alert-success {
    background: #28A745;
}

.global-alert.alert-error {
    background: #DC3545;
}

.global-alert.alert-warning {
    background: #FFC107;
    color: #333;
}

.global-alert.alert-info {
    background: #007BFF;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 登录/注册模态框优化 */
.modal-content {
    max-width: 500px;
}

.modal h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #007BFF;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #999;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background-color: #2C2C2C;
    border: 1px solid #444;
    border-radius: 5px;
    color: white;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.form-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #007BFF;
}

.modal-footer {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-footer button {
    flex: 1;
}

/* 注册表单额外样式 */
.register-note {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        width: 90vw;
        padding: 20px;
    }
    
    .user-menu {
        right: 10px;
        min-width: 180px;
    }
    
    .global-alert {
        max-width: 250px;
        padding: 12px 15px;
    }
}