/* ===== Tab 页面系统 ===== */

.tab-page {
    display: none;
    width: 100%;
    min-height: calc(100vh - 3.75rem);
    padding-bottom: 4.375rem;
}

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

.tab-page-inner {
    max-width: 87.5rem;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* Tab 2 命盘页面内的 result-section 不需要额外上边距 */
#tabChart .result-section {
    margin-top: 0;
}

#tabChart .result-content {
    max-height: none;
}

/* 争论和回答tab内的 ai-section 不需要额外上边距 */
#tabDebate .ai-section,
#tabChat .ai-section {
    margin-top: 0;
}

/* AI container 在 tab 模式下自适应高度 */
#tabDebate .ai-container,
#tabChat .ai-container {
    height: auto;
    min-height: calc(100vh - 10rem);
}

#tabDebate .ai-chat-window,
#tabChat .ai-chat-window {
    min-height: calc(100vh - 13.75rem);
    max-height: none;
    flex-grow: 1;
}

/* 占位提示（未排盘时） */
.tab-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    color: #666;
}

.tab-placeholder .placeholder-icon {
    font-size: var(--font-3xl);
    margin-bottom: var(--spacing-xl);
    opacity: 0.5;
}

.tab-placeholder .placeholder-text {
    font-size: var(--font-2xl);
    color: #888;
    font-family: 'Ma Shan Zheng', cursive;
    margin-bottom: var(--spacing-md);
}

.tab-placeholder .placeholder-hint {
    font-size: var(--font-sm);
    color: #666;
}

/* 辩论tab输入区域 */
.debate-input-area {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid rgba(255, 215, 0, 0.15);
    background: rgba(0, 0, 0, 0.2);
}

.debate-input-area .ai-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: var(--spacing-sm);
}

.debate-cost-hint {
    font-size: var(--font-xs);
    color: #999;
}

.debate-start-btn {
    background: linear-gradient(135deg, #ff6b35, #ff4500);
    min-width: 6.25rem;
}

/* ===== 底部 Tab 导航栏 ===== */

.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3.75rem;
    background: rgba(13, 13, 30, 0.98);
    border-top: 1px solid rgba(255, 215, 0, 0.25);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.5);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    cursor: pointer;
    color: #777;
    transition: all 0.25s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.tab-item .tab-icon {
    font-size: 1.4em;
    line-height: 1;
    margin-bottom: 2px;
    transition: transform 0.25s ease;
}

.tab-item .tab-label {
    font-size: 0.72em;
    letter-spacing: 1px;
    font-family: 'Noto Serif SC', serif;
}

.tab-item.active {
    color: #ffd700;
}

.tab-item.active .tab-icon {
    transform: scale(1.15);
}

.tab-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: #ffd700;
    border-radius: 0 0 2px 2px;
}

.tab-item:active {
    opacity: 0.7;
}

/* 浮动帮助按钮上移，避免被 tab bar 遮挡 */
.floating-help {
    bottom: 4.6875rem;
}

/* footer attribution 上移 */
.footer-attribution {
    bottom: 4.0625rem;
}

/* 移动端底部 tab 适配 */
@media (max-width: 480px) {
    .bottom-tab-bar {
        height: 3.4375rem;
    }

    .tab-item .tab-icon {
        font-size: 1.2em;
    }

    .tab-item .tab-label {
        font-size: 0.65em;
    }

    .tab-page {
        padding-bottom: 3.75rem;
    }

    .floating-help {
        bottom: 4.0625rem;
    }
}

/* ===== 个人中心 Tab 页样式 ===== */

.profile-container {
    padding: var(--spacing-md) var(--spacing-sm);
    padding-bottom: 5rem;
    max-width: 37.5rem;
    margin: 0 auto;
}

.profile-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 1rem;
    padding: 1.75rem var(--spacing-xl);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.profile-avatar {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.3));
}

.profile-name {
    color: #fff;
    font-size: 1.375rem;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
    margin-bottom: var(--spacing-sm);
}

.profile-credits {
    color: #ffd700;
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.profile-logout-btn {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.4);
    color: #ff6b6b;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 1.25rem;
    font-size: var(--font-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.profile-logout-btn:hover {
    background: rgba(255, 68, 68, 0.3);
}

.profile-section {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 0.75rem;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.profile-section h3 {
    color: #ffd700;
    font-size: var(--font-base);
    font-family: 'Noto Serif SC', serif;
    margin: 0 0 var(--spacing-sm) 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.profile-debate-item {
    background: rgba(13, 27, 42, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 0.625rem;
    padding: var(--spacing-sm);
    margin-bottom: 0.625rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.profile-debate-item:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.3);
}

.profile-debate-question {
    color: #fff;
    font-size: var(--font-sm);
    margin-bottom: 0.375rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.profile-debate-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-xs);
    color: #888;
    flex-wrap: wrap;
}

.profile-debate-meta .status-completed {
    color: #4ecdc4;
}

.profile-debate-meta .status-running {
    color: #ffd700;
}

.profile-debate-meta .status-failed {
    color: #ff5252;
}

.profile-debate-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.profile-debate-actions button {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.25);
    color: #ffd700;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 0.375rem;
    font-size: var(--font-xs);
    cursor: pointer;
}

.profile-debate-actions button:hover {
    background: rgba(255, 215, 0, 0.25);
}

.profile-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    font-size: 0.8125rem;
    color: #aaa;
}

.profile-pagination button {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.25);
    color: #ffd700;
    padding: 0.375rem var(--spacing-sm);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

.profile-empty {
    text-align: center;
    color: #666;
    padding: var(--spacing-xl);
    font-size: var(--font-sm);
}

.profile-refresh-btn {
    display: block;
    margin: var(--spacing-sm) auto 0;
    background: none;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 0.375rem var(--spacing-md);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
}

.profile-local-item {
    background: rgba(13, 27, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.625rem;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.profile-local-item .local-q {
    color: #ddd;
    font-size: var(--font-sm);
    margin-bottom: var(--spacing-xs);
}

.profile-local-item .local-meta {
    color: #666;
    font-size: var(--font-xs);
}

/* 有"我的"Tab后，隐藏右上角悬浮用户信息栏 */
#userInfoBar {
    display: none !important;
}
