/* ================================================================
   「我的」页面样式
   ================================================================ */

/* ---------- 页面容器 ---------- */
.profile-page {
    min-height: 100vh;
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 70%);
    color: var(--text-primary);
}

/* ---------- 顶部导航栏 ---------- */
.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-panel);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.profile-header-left,
.profile-header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.profile-header-right {
    justify-content: flex-end;
}

.profile-header-center {
    flex: 2;
    text-align: center;
}

.profile-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.profile-back:hover {
    color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.05);
}

.profile-back svg {
    width: 20px;
    height: 20px;
}

.profile-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ---------- 主内容区 ---------- */
.profile-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ---------- Tab 导航 ---------- */
.profile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-tab {
    flex: 1;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.profile-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.profile-tab.active {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.2);
}

/* ---------- 区块卡片 ---------- */
.profile-section {
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ---------- API Key 配置 ---------- */
.api-config-inline {
    display: flex;
    gap: 12px;
    align-items: center;
}

.api-config-inline input {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.api-config-inline input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px var(--glow-cyan);
}

.api-config-inline input::placeholder {
    color: rgba(160, 160, 192, 0.5);
}

.btn-primary-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--glow-purple);
}

.btn-primary-sm:active {
    transform: translateY(0);
}

.api-hint {
    display: block;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ---------- 知识列表 ---------- */
.knowledge-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.knowledge-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.knowledge-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.knowledge-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.knowledge-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.knowledge-card-duration,
.knowledge-card-scenes {
    display: flex;
    align-items: center;
    gap: 4px;
}

.knowledge-card-date {
    font-size: 0.8rem;
    color: rgba(160, 160, 192, 0.6);
    margin-top: 8px;
}

.knowledge-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: var(--transition);
}

.knowledge-card:hover .knowledge-card-actions {
    opacity: 1;
}

.btn-card-action {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-card-action:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
}

.knowledge-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.knowledge-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.btn-page {
    padding: 8px 16px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-page:hover:not(:disabled) {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .profile-header {
        padding: 12px 16px;
    }

    .profile-main {
        padding: 20px 16px;
    }

    .profile-section {
        padding: 16px;
    }

    .api-config-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .api-config-inline input {
        width: 100%;
    }

    .btn-primary-sm {
        width: 100%;
    }

    .knowledge-list {
        grid-template-columns: 1fr;
    }
}
