/**
 * 帮助中心页面样式
 * 原生 HTML + CSS 实现
 */

/* ==================== CSS Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--fm-size-body);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--fm-bg);
    min-height: 100vh;
    line-height: 1.5;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 页面容器 ==================== */
.prompt-page {
    padding: 17px 16px;
    padding-bottom: 100px; /* 为底部按钮留出空间 */
    min-height: 100vh;
}

/* ==================== 标题 ==================== */
.support-intro {
    margin-bottom: 16px;
    padding: 22px;
    border-radius: 16px;
    background: var(--fm-tint);
    color: var(--fm-muted);
    font-size: var(--fm-size-small);
}

.support-label {
    color: var(--fm-accent);
    font-weight: 650;
}

.page-title {
    margin: 4px 0;
    color: var(--fm-ink);
    font-size: var(--fm-size-heading);
    line-height: 1.3;
}

/* ==================== 问题列表 ==================== */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-item {
    width: 100%;
    font-family: inherit;
    text-align: left;
    background: var(--fm-surface);
    border: 1px solid var(--fm-line);
    padding: 17px 14px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fm-size-small);
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;

}

.question-item:hover {
    background: var(--fm-tint);
}

.question-item:active {
    transform: scale(0.99);
    background: var(--fm-tint);
}

.question-text {
    flex: 1;
    overflow: hidden;
    overflow-wrap: anywhere;
    padding-right: 10px;
    line-height: 1.4;
}

.question-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-arrow svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #999;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==================== 底部按钮 ==================== */
.bottom-btn-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: var(--fm-bg);
    padding-top: 30px;
}

.contact-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
    background: var(--fm-brand);
    color: var(--fm-ink);
    font-size: var(--fm-size-body);
    font-weight: 500;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;

}

.contact-btn:hover {
    background: var(--fm-brand-hover);
}

.contact-btn:active {
    transform: scale(0.98);
    background: var(--fm-brand-hover);
}

.contact-btn svg {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    fill: currentColor;
}

/* ==================== 加载状态 ==================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #999;
    font-size: var(--fm-size-small);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--fm-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== 空状态 ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    font-size: var(--fm-size-small);
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    fill: #ddd;
    margin-bottom: 16px;
}

/* ==================== 错误状态 ==================== */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #999;
    font-size: var(--fm-size-small);
    text-align: center;
}

.retry-btn {
    margin-top: 16px;
    padding: 10px 24px;
    background: var(--fm-accent);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: var(--fm-size-small);
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: var(--fm-accent-hover);
}

.retry-btn:active {
    transform: scale(0.98);
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: var(--fm-size-small);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 80%;
    text-align: center;
    word-break: break-word;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ==================== 响应式适配 ==================== */
@media screen and (min-width: 768px) {
    .prompt-page {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .bottom-btn-wrapper {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* 安全区域适配（iPhone X及以上） */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-btn-wrapper {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    
    .prompt-page {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}
