/**
 * 极光后台管理系统 - 公共样式文件
 * 版本: 2.0.0
 * 更新时间: 2026-02-24
 */

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0b0f1c;
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
}

/* ==================== 动态模糊渐变背景 ==================== */
.dynamic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.dynamic-bg .gradient-orb {
    position: absolute;
    width: 70vmax;
    height: 70vmax;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 40%, rgba(99, 102, 241, 0.5) 0%, rgba(168, 85, 247, 0.3) 50%, transparent 70%);
    filter: blur(80px);
    animation: floatOrb 25s infinite alternate ease-in-out;
}

.dynamic-bg .gradient-orb.second {
    width: 80vmax;
    height: 80vmax;
    background: radial-gradient(circle at 70% 60%, rgba(6, 182, 212, 0.4) 0%, rgba(59, 130, 246, 0.3) 40%, transparent 70%);
    bottom: 0;
    right: 0;
    filter: blur(100px);
    animation: floatOrbSecond 30s infinite alternate ease-in-out;
}

.dynamic-bg .noise-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJmIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iLjc1IiBudW1PY3RhdmVzPSIzIiAvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNmKSIgb3BhY2l0eT0iMC4wMjUiIC8+PC9zdmc+');
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
}

@keyframes floatOrb {
    0% { transform: translate(-10%, -10%) scale(1); }
    100% { transform: translate(5%, 15%) scale(1.2); }
}

@keyframes floatOrbSecond {
    0% { transform: translate(10%, 10%) scale(1); }
    100% { transform: translate(-10%, -5%) scale(1.3); }
}

/* ==================== 顶部导航栏 ==================== */
.top-nav {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(200%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-logo {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(145deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 20px;
    border-radius: 24px;
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(79, 70, 229, 0.15);
    color: #4f46e5;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.nav-user span {
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

/* ==================== 管理后台布局 ==================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    backdrop-filter: blur(8px);
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.06);
    padding: 28px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 0 24px 28px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.sidebar-header h2 i {
    background: linear-gradient(145deg, #4f46e5, #7c3aed);
    -webkit-text-fill-color: white;
    -webkit-background-clip: text;
    background-clip: text;
    font-size: 24px;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
}

.sidebar-menu li {
    margin: 4px 12px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #1e293b;
    font-weight: 500;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.2s ease;
    background: transparent;
    backdrop-filter: blur(4px);
}

.sidebar-menu a i {
    width: 22px;
    color: #4f46e5;
    font-size: 1.2rem;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    color: #0f0f2d;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.1);
}

.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    color: #0f0f2d;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.15);
    border-left: 4px solid #4f46e5;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 32px 36px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 18px 28px;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.08);
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 i {
    color: #4f46e5;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.5);
    padding: 8px 20px 8px 24px;
    border-radius: 40px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ==================== 卡片样式 ==================== */
.card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-radius: 24px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

.card-large {
    border-radius: 36px;
    padding: 32px 36px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.card-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(145deg, #1f2937, #312e81);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-header i {
    font-size: 1.8rem;
    color: #4f46e5;
    background: rgba(255, 255, 255, 0.5);
    padding: 12px;
    border-radius: 20px;
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px -6px #4f46e5;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #94a3b8;
    color: white;
}

.btn-secondary:hover {
    background: #64748b;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    border: 1px solid #4f46e5;
    color: #4f46e5;
}

.btn-outline:hover {
    background: rgba(79, 70, 229, 0.1);
    border-color: #4f46e5;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 12px;
}

.action-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ==================== 表格样式 ==================== */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    background: transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

td {
    padding: 18px 12px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.3);
    color: #1e293b;
    font-weight: 500;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
}

/* ==================== Badge 标签 ==================== */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.badge-trial {
    background: rgba(254, 243, 199, 0.8);
    color: #92400e;
    border-color: #fcd34d;
}

.badge-formal {
    background: rgba(209, 250, 229, 0.8);
    color: #065f46;
    border-color: #6ee7b7;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.source-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #4f46e5;
    width: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
    outline: none;
    color: #0f172a;
    font-weight: 500;
    font-family: inherit;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4f46e5;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

/* ==================== 弹窗样式 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px);
    border-radius: 32px;
    padding: 32px;
    width: 500px;
    max-width: 94%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 40px 70px -20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(145deg, #1f2937, #312e81);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    font-size: 32px;
    cursor: pointer;
    color: #4b5563;
    transition: 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #0f172a;
}

/* ==================== 消息提示 ==================== */
.message-box {
    display: none;
    padding: 14px 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.message-box.show {
    display: block;
}

.message-box.error {
    background: rgba(254, 202, 202, 0.7);
    color: #991b1b;
    border-color: #fecaca;
}

.message-box.success {
    background: rgba(209, 250, 229, 0.7);
    color: #065f46;
    border-color: #bbf7d0;
}

.message-box.loading {
    background: rgba(147, 197, 253, 0.7);
    color: #1e40af;
    border-color: #bfdbfe;
}

.toast-message {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.2s ease;
}

.toast-message.success {
    background: rgba(209, 250, 229, 0.9);
    color: #065f46;
    border-color: #bbf7d0;
}

.toast-message.error {
    background: rgba(254, 202, 202, 0.9);
    color: #991b1b;
    border-color: #fecaca;
}

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

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }

    .main-content {
        padding: 20px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .nav-links {
        display: none;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 10px 8px;
    }
}

/* ==================== 登录/注册页面专用样式 ==================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-radius: 48px;
    padding: 48px 44px;
    width: 100%;
    max-width: 460px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease;
    position: relative;
}

.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 40px 70px -20px rgba(79, 70, 229, 0.3);
}

.login-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 48px;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

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

.login-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(145deg, #1e1b4b, #312e81);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.login-header h1 i {
    background: linear-gradient(145deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 38px;
}

.login-header p {
    color: #475569;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.4);
    padding: 8px 18px;
    border-radius: 40px;
    display: inline-block;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    color: #475569;
    font-size: 0.95rem;
    font-weight: 500;
}

.login-footer a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 700;
    margin-left: 6px;
    background: rgba(255, 255, 255, 0.4);
    padding: 6px 16px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    display: inline-block;
}

.login-footer a:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #312e81;
    border-color: white;
}
