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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 登录页面样式 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.login-page::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 50%);
    animation: rotate 20s linear infinite;
    z-index: 1;
}

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

.login-container {
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    z-index: 10;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.login-box {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px;
    padding: 40px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
    transition: all 0.3s ease;
    /* 确保没有任何模糊效果 */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.login-box:hover {
    transform: translateY(-5px);
    background: rgba(0, 0, 0, 0.5);
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    pointer-events: none;
    z-index: -1;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.6),
        rgba(102, 126, 234, 0.8));
    transition: width 0.3s ease;
    border-radius: 1px;
}

.form-group:focus-within::before {
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    /* 确保没有任何模糊效果 */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.4);
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.2),
        0 8px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary-gradient, linear-gradient(135deg,
        rgba(102, 126, 234, 0.9) 0%,
        rgba(118, 75, 162, 0.9) 100%));
    color: var(--text-white, white);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--primary-gradient, linear-gradient(135deg,
        rgba(102, 126, 234, 1) 0%,
        rgba(118, 75, 162, 1) 100%));
    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.25) inset;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #000;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 4px;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

.badge-primary {
    background-color: #007bff;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

/* 警告框样式 */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* 登录页面底部 */
.login-footer {
    margin-top: 30px;
    text-align: center;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    display: inline-block;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.login-footer a:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 1);
}

.user-accounts, .admin-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

/* 隐藏空的admin-info和user-accounts */
.admin-info:empty, .user-accounts:empty {
    display: none;
}

.user-accounts h4, .admin-info h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 14px;
}

.accounts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    font-size: 12px;
    color: #6c757d;
}

.note {
    margin-top: 10px;
    font-size: 11px;
    color: #6c757d;
    text-align: center;
}

/* 管理员登录页面特殊样式 */
.admin-login .login-box {
    border-top: 4px solid #dc3545;
}

.admin-login .login-header h1 {
    color: #dc3545;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-page {
        padding: 15px;
    }

    .login-container {
        max-width: 100%;
    }

    .login-box {
        padding: 30px 20px;
        border-radius: 15px;
        animation: none; /* 在移动设备上禁用浮动动画 */
    }

    .login-header h1 {
        font-size: 24px;
    }

    .form-group input {
        padding: 12px 15px;
        font-size: 16px; /* 防止iOS缩放 */
        box-sizing: border-box; /* 确保padding不会导致溢出 */
        width: 100%;
        max-width: 100%;
    }

    .form-group input:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3) !important;
        transform: none !important; /* 移动端不使用transform避免溢出 */
        border: 1px solid rgba(255, 255, 255, 0.7) !important;
    }

    .form-group {
        margin-bottom: 20px;
        overflow: hidden; /* 防止子元素溢出 */
    }

    .form-group::before {
        display: none; /* 移动端隐藏装饰性元素 */
    }

    .btn-primary {
        padding: 15px 24px;
        font-size: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    /* 移动端登录框额外优化 */
    .login-box {
        overflow: hidden; /* 防止内容溢出 */
        box-sizing: border-box;
    }

    .login-form {
        width: 100%;
        box-sizing: border-box;
    }

    /* 防止输入框在iOS上的缩放和溢出 */
    input[type="text"],
    input[type="password"] {
        -webkit-appearance: none;
        -webkit-border-radius: 12px;
        border-radius: 12px;
        background-clip: padding-box;
    }
}
    
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}

/* 主页面布局 */
.dashboard {
    background: #f8f9fa;
    min-height: 100vh;
}

.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.navbar h1 {
    font-size: 20px;
    font-weight: 600;
}

.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar .user-info span {
    font-size: 14px;
}

.navbar .user-info a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s ease;
}

.navbar .user-info a:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 25px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

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

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

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

.table tr:hover {
    background: #f8f9fa;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 文件上传区域 */
.file-upload {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-upload.dragover {
    border-color: #667eea;
    background: #e3f2fd;
}

/* 折叠面板 */
.collapsible {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.collapsible-header {
    padding: 15px 20px;
    background: #e9ecef;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    transition: background 0.3s ease;
}

.collapsible-header:hover {
    background: #dee2e6;
}

.collapsible-content {
    padding: 20px;
    display: none;
}

.collapsible.active .collapsible-content {
    display: block;
}

.collapsible-toggle {
    transition: transform 0.3s ease;
}

.collapsible.active .collapsible-toggle {
    transform: rotate(180deg);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);

}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #2c3e50;
    font-size: 18px;
}

.close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .card {
        padding: 20px 15px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
}
