/* Help Center Page - Apple Style Design */

/* CSS Variables - 语义化命名 */
:root {
    /* 颜色系统 */
    --color-bg: #f5f5f7;
    --color-container-bg: #ffffff;
    --color-text: #1d1d1f;
    --color-text-secondary: #86868b;
    --color-border: #d2d2d7;
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-accent-light: rgba(0, 113, 227, 0.08);
    --color-accent-lighter: rgba(0, 113, 227, 0.05);
    
    /* 阴影系统 */
    --shadow-soft: rgba(0, 0, 0, 0.08);
    --shadow-card: 
        0 2px 8px var(--shadow-soft),
        0 1px 0 rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 2px 8px rgba(0, 113, 227, 0.08);
    --shadow-card-active: 0 4px 12px rgba(0, 113, 227, 0.12);
    --shadow-button-hover: 0 4px 12px rgba(0, 113, 227, 0.3);
    --shadow-focus: 0 0 0 4px rgba(0, 113, 227, 0.1);
    
    /* 圆角系统 */
    --radius-large: 18px;
    --radius-medium: 12px;
    --radius-small: 8px;
    --radius-button: 12px;
    
    /* 过渡动画 */
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-expand: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #000000;
        --color-container-bg: #1c1c1e;
        --color-text: #f5f5f7;
        --color-text-secondary: #98989d;
        --color-border: #38383a;
        --color-accent: #0a84ff;
        --color-accent-hover: #409cff;
        --shadow-soft: rgba(0, 0, 0, 0.3);
        --shadow-card: 
            0 2px 8px var(--shadow-soft),
            0 1px 0 rgba(0, 0, 0, 0.2);
    }
}

/* 通用字体样式 - 统一声明 */
.help-page-wrapper,
.help-page-wrapper * {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.help-page-wrapper {
    min-height: 100vh;
    background: var(--color-bg);
    padding: 80px 20px 0 20px;
}

.help-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

/* Header */
.help-header {
    text-align: center;
    margin-bottom: 48px;
}

.help-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.help-subtitle {
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    color: var(--color-text-secondary);
    margin: 0;
    font-weight: 400;
}

/* Search Box */
.help-search {
    margin-bottom: 48px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--color-container-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    padding: 12px 16px;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.search-box:focus-within {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}

.search-icon {
    color: var(--color-text-secondary);
    margin-right: 12px;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--color-text);
    background: transparent;
}

.search-input::placeholder {
    color: var(--color-text-secondary);
}

/* FAQ Categories */
.help-categories {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.faq-category {
    background: var(--color-container-bg);
    border-radius: var(--radius-large);
    padding: 32px;
    box-shadow: var(--shadow-card);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.category-title {
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

/* FAQ List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--color-container-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.faq-item:hover {
    border-color: rgba(0, 113, 227, 0.3);
    box-shadow: var(--shadow-card-hover);
}

.faq-item.active {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-card-active);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    transition: background-color var(--transition-base), color var(--transition-base);
}

.faq-question:hover {
    background-color: var(--color-accent-lighter);
}

.faq-item.active .faq-question {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
}

.faq-question-text {
    flex: 1;
    padding-right: 20px;
    line-height: 1.5;
}

.faq-icon {
    color: var(--color-text-secondary);
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform var(--transition-smooth), color var(--transition-base);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--color-accent);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-expand), opacity var(--transition-smooth);
    opacity: 0;
    will-change: max-height, opacity;
}

.faq-item.active .faq-answer {
    opacity: 1;
}

.faq-answer-content {
    padding: 16px 24px 20px 24px;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: -1px;
    animation: fadeInAnswer var(--transition-smooth);
}

@keyframes fadeInAnswer {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* No Results */
.help-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px;
    text-align: center;
    background: var(--color-container-bg);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.no-results-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 8px 0;
}

.no-results-hint {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.no-results-hint a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-base);
}

.no-results-hint a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Footer */
.help-footer {
    margin-top: 64px;
    padding-top: 32px;
    padding-bottom: 0;
    margin-bottom: 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.help-footer-text {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0 0 12px 0;
}

.help-footer-link {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    background: var(--color-accent);
    border-radius: var(--radius-button);
    text-decoration: none;
    transition: background var(--transition-base), transform var(--transition-base);
}

.help-footer-link:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-button-hover);
}

.help-footer-link:active {
    transform: translateY(0);
}

/* 响应式设计 */

/* 平板端 (768px - 991.98px) */
@media (max-width: 991.98px) and (min-width: 768px) {
    .help-page-wrapper {
        padding: 60px 24px;
    }

    .help-container {
        max-width: 100%;
    }

    .help-header {
        margin-bottom: 40px;
    }

    .help-search {
        margin-bottom: 40px;
    }

    .faq-category {
        padding: 28px;
        border-radius: var(--radius-large);
    }

    .faq-question {
        padding: 16px 22px;
    }

    .faq-answer-content {
        padding: 14px 22px 18px 22px;
    }

    .help-footer {
        margin-top: 56px;
        padding-top: 28px;
    }
}

/* 移动端 (≤767.98px) */
@media (max-width: 767.98px) {
    .help-page-wrapper {
        padding: 40px 16px;
    }

    .help-header {
        margin-bottom: 36px;
    }

    .help-search {
        margin-bottom: 36px;
    }

    .search-box {
        padding: 11px 15px;
    }

    .search-icon {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }

    .search-input {
        font-size: 16px; /* 防止iOS自动缩放 */
    }

    .help-categories {
        gap: 24px;
    }

    .faq-category {
        padding: 24px 20px;
        border-radius: var(--radius-large);
    }

    .category-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .faq-list {
        gap: 10px;
    }

    .faq-item {
        border-radius: 10px;
    }

    .faq-question {
        padding: 16px 20px;
        font-size: 0.9375rem;
    }

    .faq-question-text {
        padding-right: 16px;
    }

    .faq-icon {
        width: 18px;
        height: 18px;
    }

    .faq-answer-content {
        padding: 14px 20px 16px 20px;
        font-size: 0.875rem;
        line-height: 1.65;
    }

    .help-no-results {
        padding: 56px 28px;
    }

    .help-footer {
        margin-top: 48px;
        padding-top: 24px;
    }

    .help-footer-text {
        font-size: 0.9375rem;
    }

    .help-footer-link {
        padding: 11px 22px;
        font-size: 0.9375rem;
    }
}

/* 小屏移动端 (≤575.98px) */
@media (max-width: 575.98px) {
    .help-page-wrapper {
        padding: 32px 12px;
    }

    .help-header {
        margin-bottom: 28px;
    }

    .help-search {
        margin-bottom: 28px;
    }

    .search-box {
        padding: 10px 14px;
        border-radius: 10px;
    }

    .search-icon {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }

    .search-input {
        font-size: 16px; /* 防止iOS自动缩放 */
    }

    .help-categories {
        gap: 20px;
    }

    .faq-category {
        padding: 20px 16px;
        border-radius: var(--radius-medium);
    }

    .category-header {
        margin-bottom: 16px;
        padding-bottom: 10px;
    }

    .faq-item {
        border-radius: var(--radius-small);
        margin-bottom: 10px;
    }

    .faq-question {
        padding: 12px 14px;
        font-size: 0.875rem;
    }

    .faq-question-text {
        padding-right: 12px;
        line-height: 1.4;
    }

    .faq-icon {
        width: 16px;
        height: 16px;
    }

    .faq-answer-content {
        padding: 12px 14px 14px 14px;
        font-size: 0.8125rem;
        line-height: 1.6;
    }

    .help-no-results {
        padding: 48px 24px;
    }

    .no-results-icon {
        font-size: 2.5rem;
    }

    .no-results-text {
        font-size: 1.125rem;
    }

    .help-footer {
        margin-top: 40px;
        padding-top: 20px;
    }

    .help-footer-link {
        padding: 10px 20px;
        font-size: 0.9375rem;
        border-radius: 10px;
    }
}

/* 超小屏设备 (≤375px) */
@media (max-width: 375px) {
    .help-page-wrapper {
        padding: 28px 10px;
    }

    .faq-category {
        padding: 18px 14px;
    }

    .faq-question {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }

    .faq-answer-content {
        padding: 10px 12px 12px 12px;
        font-size: 0.75rem;
    }
}
