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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px 20px 72px;
    position: relative;
}

/* 通用组件 */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 认证容器（登录/注册）专用样式 */
#authContainer .card {
    max-width: 400px;
    margin: 0 auto;
}

.card {
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 认证容器的卡片使用白色背景 */
#authContainer .card {
    max-width: 400px;
    margin: 30px auto 0;
    background: white;
}

.auth-beian-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 18px;
    text-align: center;
    font-size: 14px;
    line-height: 1.7;
}

.auth-beian-link {
    color: #8a94a6;
    text-decoration: none;
}

.auth-beian-link:hover {
    color: #8a94a6;
}

.auth-beian-link:focus-visible {
    outline: none;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: #e2e8f0;
  color: #4a5568;
}

.btn-primary:hover {
    background: #e2e8f0;
}

.btn-primary.active {
    background: #ff6b35;
    color: white;
}

.btn-primary.active:hover {
    background: #ff6b35;
}

.btn-secondary {
    background: #e2e8f0;
  color: #4a5568;
  border: 2px solid #cbd5e0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Toast 消息 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, 0);
    background: rgba(0, 0, 0, 0.8);
  color: white;
    padding: 12px 24px;
  border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    max-width: 90%;
    word-wrap: break-word;
    text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
}

.toast-success {
    background: rgba(72, 187, 120, 0.9);
}

.toast-error {
    background: rgba(245, 101, 101, 0.9);
}

/* 警告提示 */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.alert.hidden {
    display: none;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 布局样式 */
.main-layout {
    display: flex;
    min-height: calc(100vh - 100px);
    background: linear-gradient(135deg, #ffffff 0%, #fbfcff 100%);
    border: 1px solid rgba(226, 232, 240, 0.88);
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.sidebar {
    width: 208px;
    background: linear-gradient(180deg, rgba(250, 251, 255, 0.98) 0%, rgba(244, 247, 252, 0.96) 100%);
    padding: 18px 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.72);
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 0 14px;
}

.sidebar-menu li {
    margin: 6px 0;
}

.sidebar-menu .menu-group {
    margin: 6px 0;
}

.sidebar-menu .menu-parent {
    position: relative;
    justify-content: space-between;
    letter-spacing: 0.12px;
}

.sidebar-menu .menu-parent:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(102, 126, 234, 0.015) 100%);
    transform: translateX(1px);
    color: #586bcf;
}

.sidebar-menu .menu-parent.active {
    background: rgba(102, 126, 234, 0.07);
    color: #586bcf;
    box-shadow: none;
}

.sidebar-menu .submenu-arrow {
    font-size: 9px;
    opacity: 0.62;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
    margin-left: auto;
}

.sidebar-menu .menu-parent:hover .submenu-arrow,
.sidebar-menu .menu-parent.expanded .submenu-arrow {
    opacity: 0.92;
    color: #667eea;
}

.sidebar-menu .menu-parent.expanded .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar-menu .submenu {
    list-style: none;
    padding: 5px 0 0 0;
    margin: 3px 0 0 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease, opacity 0.16s ease, margin-top 0.16s ease;
    opacity: 0;
    border-left: 1px solid rgba(102, 126, 234, 0.1);
}

.sidebar-menu .submenu.expanded {
    max-height: 200px;
    opacity: 1;
    margin-top: 5px;
}

.sidebar-menu .submenu li {
    margin: 2px 0;
}

.sidebar-menu .submenu a {
    padding: 7px 12px 7px 16px;
    font-size: 12px;
    font-weight: 500;
    color: #6d7888;
    border-radius: 7px;
    margin-left: 9px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    color: #4f5b68;
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.18px;
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    height: calc(100% - 18px);
    width: 2px;
    background: linear-gradient(180deg, #8b9af3 0%, #667eea 100%);
    transform: scaleY(0.32);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
    border-radius: 0 4px 4px 0;
}

.sidebar-menu a:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(102, 126, 234, 0.015) 100%);
    transform: translateX(1px);
    color: #586bcf;
}

.sidebar-menu .submenu a:hover {
    background: rgba(102, 126, 234, 0.04);
}

.sidebar-menu .submenu a.active:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.88) 0%, rgba(118, 75, 162, 0.78) 100%);
    color: #ffffff;
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.88) 0%, rgba(118, 75, 162, 0.78) 100%);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 8px rgba(102, 126, 234, 0.11);
    transform: translateX(0);
}

.sidebar-menu a.active::before {
    transform: scaleY(1);
    opacity: 1;
    background: rgba(255, 255, 255, 0.88);
}

.sidebar-menu .submenu a.active {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 4px rgba(102, 126, 234, 0.08);
}

.sidebar-menu a.active .menu-icon {
    transform: scale(1.01);
}

.sidebar-menu .menu-icon {
    margin-right: 10px;
    font-size: 18px;
    transition: transform 0.18s ease, opacity 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.92;
}

.content-area {
    flex: 1;
    padding: 32px 34px;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.9) 100%);
}

.tab-content {
    display: none;
}

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

/* 用户资料卡片 */
.user-profile-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.user-profile-card-compact {
    background: #f4f7ff;
    border: 1px solid #dfe7f7;
    border-radius: 14px;
    box-shadow: none;
    padding: 18px;
}

.user-profile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.user-profile-header-compact {
    align-items: center;
    margin-bottom: 14px;
}

.user-profile-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.user-profile-card-compact h3 {
    margin: 0;
    color: #2d3748;
    font-size: 18px;
}

.user-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.user-profile-inline-btn {
    border: 1px solid #d8e0ef;
    background: #ffffff;
    color: #4a5568;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.user-profile-inline-btn:hover {
    border-color: #667eea;
    color: #4c63d2;
    background: #f7f9ff;
}

.user-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.user-profile-grid-compact {
    gap: 10px;
}

.user-profile-info-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e8edf5;
    min-width: 0;
}


.user-profile-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-profile-card-btn {
    border: none;
    background: #e8efff;
    color: #5067d8;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-profile-card-btn:hover {
    background: #dce7ff;
    color: #3f56c9;
}

.user-info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.user-info-item:last-child {
    border-bottom: none;
}

.user-info-label {
    color: #718096;
    font-weight: 500;
}

.user-profile-info-card .user-info-label {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
}

.user-info-value {
    color: #2d3748;
    font-weight: 600;
}

.user-profile-info-card .user-info-value {
    font-size: 15px;
    line-height: 1.4;
    color: #2d3748;
    word-break: break-word;
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .user-profile-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .user-profile-actions {
        justify-content: flex-start;
    }

    .user-profile-grid {
        grid-template-columns: 1fr;
    }

    .user-profile-card-compact {
        padding: 16px;
    }

    .user-profile-card-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

/* 文件列表 */
.file-list {
    list-style: none;
}

.file-item {
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 下载中心 */
.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.download-item:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

/* 会员卡片 */
.membership-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.membership-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
}

.membership-card.active {
    border-color: #667eea;
    background: #ebf4ff;
}

.membership-price {
    font-size: 32px;
    color: #667eea;
    font-weight: bold;
    margin: 15px 0;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9fa;
}
