/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    background-color: #f5f7fa;
    color: #333;
    overflow-x: hidden;
}

/* 背景样式 */
.main-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.background-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    opacity: 0.9;
}

/* 毛玻璃效果 */
.glass-panel {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    padding: 30px;
    transition: all 0.3s ease;
}

.content-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: #fff;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.view-toggle {
    display: flex;
    gap: 10px;
}

.view-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-btn i {
    font-size: 1rem;
}

.view-btn:hover, .view-btn.active {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

#logout-btn {
    background: rgba(220, 53, 69, 0.3);
}

#logout-btn:hover {
    background: rgba(220, 53, 69, 0.5);
}

/* 统计卡片样式 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.stat-card i {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.stat-info p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.refresh-time {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 搜索栏样式 */
.search-container {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
    padding: 5px 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-box i {
    color: white;
    margin-right: 10px;
    font-size: 1.2rem;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 10px 0;
    font-size: 1rem;
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box button {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-box button:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* 卡片视图样式 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.km-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.km-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: -1;
}

.km-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    word-break: break-all;
}

.card-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-vip {
    background: rgba(255, 215, 0, 0.3);
    color: #ffe147;
}

.badge-normal {
    background: rgba(255, 255, 255, 0.2);
}

.badge-expiring {
    background: rgba(255, 99, 71, 0.3);
    color: #ffaa9f;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.card-info-label {
    opacity: 0.8;
}

.card-info-value {
    font-weight: 500;
}

/* 表格视图样式 */
.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.data-table th, .data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.table-actions {
    display: flex;
    gap: 10px;
}

.action-icon {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.action-icon.delete {
    background: rgba(220, 53, 69, 0.3);
}

.action-icon.delete:hover {
    background: rgba(220, 53, 69, 0.5);
}

.action-icon.star {
    background: rgba(255, 193, 7, 0.3);
}

.action-icon.star:hover {
    background: rgba(255, 193, 7, 0.5);
}

/* 加载状态样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: white;
    grid-column: 1 / -1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: white;
    grid-column: 1 / -1;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

/* 添加卡密按钮 */
.add-card-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

.add-card-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    width: 95%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus {
    border-color: #2575fc;
    box-shadow: 0 0 0 2px rgba(37, 117, 252, 0.2);
    outline: none;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.cancel-btn, .confirm-btn {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: #f1f1f1;
    border: 1px solid #ddd;
    color: #666;
}

.confirm-btn {
    background: #2575fc;
    border: none;
    color: white;
}

.confirm-btn.danger {
    background: #dc3545;
}

.cancel-btn:hover {
    background: #e5e5e5;
}

.confirm-btn:hover {
    filter: brightness(1.1);
}

/* 卡密信息模态框 */
.card-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.card-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.card-info-row:last-child {
    border-bottom: none;
}

.card-info-label {
    font-weight: 500;
    color: #555;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.danger {
    background: #dc3545;
    color: white;
}

.action-btn.primary {
    background: #2575fc;
    color: white;
}

.action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.warning-text {
    color: #dc3545;
    font-weight: 500;
    text-align: center;
    margin-top: 10px;
}

/* Toast通知样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(120%);
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i {
    color: #28a745;
}

.toast.error i {
    color: #dc3545;
}

.toast.info i {
    color: #2575fc;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.toast-message {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 密码输入框样式 */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    flex: 1;
    padding-right: 40px;
}

.toggle-password-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.toggle-password-btn:hover {
    color: #2575fc;
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 15px;
    }
    
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .modal-container {
        width: 95%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
} 