/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                 "Microsoft YaHei", "Source Han Sans CN", sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, button, textarea {
    font-family: inherit;
    outline: none;
    border: none;
    background: none;
}

button { cursor: pointer; }

ol, ul { list-style: none; }

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* ========== 页面容器 ========== */
.page {
    position: relative;
    width: 100%;
    max-width: 750px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #f5f5f7;
    padding-bottom: 24px;
    overflow: hidden;
}

/* ========== 顶部标题栏 ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 12px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.nav-back:active {
    background: #f2f2f2;
}

.nav-title {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.5px;
}

.nav-placeholder {
    width: 32px;
    height: 32px;
}

/* ========== 标题右侧"主页"按钮 ========== */
.nav-home {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    border-radius: 15px;
    background: #ffffff;
    border: 1px solid #3b6ef0;
    color: #222;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    transition: background 0.15s ease, transform 0.1s ease;
}

.nav-home:active {
    background: #f5f5f5;
    transform: scale(0.97);
}

.nav-home-text {
    line-height: 1;
}

/* ========== Tab 切换栏 ========== */
.tabs {
    position: sticky;
    top: 46px;
    z-index: 19;
    display: flex;
    align-items: stretch;
    height: 44px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.tab-item {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0;
    background: transparent;
    color: #666;
    font-size: 20px;
    font-weight: 500;
    transition: color 0.18s ease;
}

.tab-item .tab-text {
    position: relative;
    line-height: 1;
    padding: 4px 0;
}

.tab-item .tab-bar {
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #ff7a47 0%, #ff5a3c 100%);
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.22s ease, opacity 0.22s ease;
    opacity: 0;
}

.tab-item.is-active {
    color: #ff5a3c;
    font-weight: 600;
}

.tab-item.is-active .tab-bar {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
}

.tab-item:active {
    background: #f7f8fa;
}

/* ========== Tab 面板 ========== */
.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
    animation: tabFadeIn 0.22s ease;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== 顶部 Banner ========== */
.banner {
    position: relative;
    width: 100%;
    line-height: 0;
    background: linear-gradient(135deg, #5b8def 0%, #4a7bf0 100%);
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* ========== 问答主体区 ========== */
.qa-main {
    padding: 12px 12px 0;
}

/* ========== 问答列表 ========== */
.qa-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qa-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 14px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* Q 图标 */
.qa-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qa-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 内容主体 */
.qa-body {
    flex: 1;
    min-width: 0;
}

.qa-question {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.5;
    margin-bottom: 8px;
    word-break: break-word;
}

.qa-answer {
    font-size: 17px;
    color: #555;
    line-height: 1.65;
    margin-bottom: 10px;
    word-break: break-word;
    text-align: justify;
}

/* ========== 空状态 ========== */
.list-empty {
    padding: 80px 0;
    text-align: center;
}

.empty-text {
    color: #999;
    font-size: 18px;
}

/* ========== 底部说明 ========== */
.qa-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 24px 12px 4px;
    color: #b0b0b0;
    font-size: 14px;
}

.qa-footer-icon {
    display: inline-flex;
    align-items: center;
}

/* ========== 反馈 Tab：顶部介绍 ========== */
.intro {
    position: relative;
    width: 100%;
    line-height: 0;
    background: linear-gradient(180deg, #eef3ff 0%, #f5f7ff 60%, #f8f9ff 100%);
}

.intro-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* ========== 反馈 Tab：表单卡片 ========== */
.form-card {
    padding: 24px 20px 0;
    background: #ffffff;
}

.form-label {
    font-size: 17px;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 14px;
}

.form-label .required {
    color: #ff3b30;
    margin-left: 2px;
    font-weight: 400;
}

/* ========== 文本框 ========== */
.textarea-wrap {
    position: relative;
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 14px 14px 30px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea-wrap:focus-within {
    border-color: #3b6ef0;
    box-shadow: 0 0 0 3px rgba(59, 110, 240, 0.08);
}

.textarea {
    display: block;
    width: 100%;
    min-height: 150px;
    resize: none;
    font-size: 17px;
    color: #1c1c1e;
    line-height: 1.6;
    background: transparent;
    border: none;
    outline: none;
}

.textarea::placeholder {
    color: #b8bcc4;
    font-size: 17px;
}

.counter {
    position: absolute;
    right: 14px;
    bottom: 10px;
    font-size: 14px;
    color: #b8bcc4;
    user-select: none;
}

/* ========== 隐私提示 ========== */
.tip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: #9b9b9b;
    font-size: 17px;
    line-height: 1.5;
}

.tip-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ========== 提交按钮 ========== */
.submit-btn {
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 32px;
    background: #3b6ef0;
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 26px;
    box-shadow: 0 6px 18px rgba(59, 110, 240, 0.25);
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.submit-btn:active {
    opacity: 0.92;
    transform: scale(0.99);
}

.submit-btn:disabled,
.submit-btn.is-disabled {
    background: #b8c6f3;
    box-shadow: none;
    cursor: not-allowed;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 15px;
    padding: 10px 18px;
    border-radius: 8px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    max-width: 80%;
    text-align: center;
}

.toast.show { opacity: 1; }

[hidden] { display: none !important; }

/* ========== 回到顶部 ========== */
.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 80px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b8def 0%, #4a7bf0 100%);
    box-shadow: 0 4px 14px rgba(59, 110, 240, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:active {
    transform: scale(0.92);
    opacity: 0.85;
}

/* ========== 响应式调整 ========== */
@media (max-width: 360px) {
    .nav-title { font-size: 19px; }
    .tabs { height: 40px; }
    .tab-item { font-size: 18px; }
    .qa-item { padding: 14px 12px; gap: 10px; }
    .qa-icon { width: 32px; height: 32px; }
    .qa-question { font-size: 18px; }
    .qa-answer { font-size: 15px; }
    .form-card { padding: 20px 16px 0; }
    .textarea { min-height: 132px; font-size: 16px; }
    .textarea::placeholder { font-size: 16px; }
    .form-label { font-size: 16px; }
    .tip { font-size: 16px; }
    .submit-btn { height: 44px; font-size: 17px; }
}

@media (min-width: 750px) {
    .page { box-shadow: 0 0 30px rgba(0, 0, 0, 0.06); }
    .tabs { height: 48px; }
    .tab-item { font-size: 21px; }
    .qa-main { padding: 16px 16px 0; }
    .qa-item { padding: 18px 16px; gap: 14px; }
    .qa-icon { width: 40px; height: 40px; }
    .qa-question { font-size: 22px; }
    .qa-answer { font-size: 19px; }
    .form-card { padding: 28px 28px 0; }
    .textarea { min-height: 170px; font-size: 18px; }
    .textarea::placeholder { font-size: 18px; }
    .form-label { font-size: 19px; }
    .tip { font-size: 18px; }
    .submit-btn { height: 52px; font-size: 20px; }
}

/* ========== Loading 转圈遮罩 ========== */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-box {
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    padding: 20px 24px;
    border-radius: 10px;
    text-align: center;
    min-width: 110px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    margin: 0 auto 10px;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页面进入/刷新加载遮罩淡出 */
.page-loading-mask {
    transition: opacity 0.35s ease;
}

.page-loading-mask.is-hidden {
    opacity: 0;
    pointer-events: none;
}

body.is-loading {
    overflow: hidden;
}
