/* === 基础重置与变量 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1677ff;
    --primary-dark: #0958d9;
    --primary-light: #e6f4ff;
    --danger: #ff4d4f;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-hint: #999;
    --border: #e8e8e8;
    --bg: #f5f7fa;
    --bg-white: #fff;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* === 全局 === */
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: var(--bg);
}

/* === 头部 === */
.header {
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    padding: 18px 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.25);
}

.header h1 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* === 表单 === */
.feedback-form {
    padding: 16px;
}

.form-group {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.required {
    color: var(--danger);
    font-weight: 400;
}

.optional {
    color: var(--text-hint);
    font-weight: 400;
    font-size: 12px;
}

/* === 输入框 === */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #bbb;
}

/* === 下拉选择器 === */
.select-wrapper {
    position: relative;
}

.form-select {
    padding-right: 36px;
    cursor: pointer;
    background: #fafafa;
    color: var(--text-primary);
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-hint);
    font-size: 12px;
    pointer-events: none;
}

/* === 文本域 === */
.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.char-count {
    font-size: 12px;
    color: var(--text-hint);
    text-align: right;
}

/* === 错误提示 === */
.error-tip {
    display: block;
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    min-height: 16px;
}

.hint-tip {
    display: block;
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 4px;
}

/* === 图片上传 === */
.image-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 1.5px solid var(--border);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    border: none;
    transition: background 0.2s;
}

.image-preview-item .remove-btn:active {
    background: rgba(0, 0, 0, 0.8);
}

/* 上传框 */
.upload-box {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 1.5px dashed var(--border);
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.upload-box:active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.upload-text {
    font-size: 11px;
    color: var(--text-hint);
}

.file-input-hidden {
    display: none;
}

/* === 提交按钮 === */
.submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
    margin-top: 8px;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.3);
}

.submit-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.submit-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.submit-btn.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Toast 弹窗 === */
.toast {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

.toast-content {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px;
    text-align: center;
    max-width: 300px;
    width: 80%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.toast-icon {
    margin-bottom: 12px;
}

.toast-content p {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.toast-content span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========================================
   一级页面：投诉领域选择
   ======================================== */

/* 页面容器 */
.page {
    width: 100%;
    min-height: 100vh;
}

/* 一级页面头部 */
.header-category {
    padding: 14px 20px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header-category h1 {
    font-size: 17px;
    color: var(--text-primary);
}

/* 分类内容区 */
.category-content {
    padding: 0 16px 30px;
}

.category-banner {
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    border-radius: 0;
    padding: 18px 20px;
    margin: 0 -16px 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(22, 119, 255, 0.3);
}

.category-prompt {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
}

/* 分类网格 */
.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

/* 分类卡片 */
.category-card {
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.category-card:active {
    transform: scale(0.97);
}

/* 选中状态 */
.category-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.15);
}

.category-card.selected .category-icon {
    color: var(--primary);
}

.category-card.selected .category-name {
    color: var(--primary);
    font-weight: 600;
}

/* 分类图标 */
.category-icon {
    width: 44px;
    height: 44px;
    color: #5b8def;
    transition: color 0.25s ease;
}

.category-icon svg {
    width: 100%;
    height: 100%;
}

/* 汉字图标样式 */
.category-icon-char {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.25);
}

.category-icon-char svg {
    width: 26px;
    height: 26px;
    color: #fff;
    stroke: #fff;
}

.icon-char {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.category-card.selected .category-icon-char {
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.45);
    transform: scale(1.05);
}

/* 分类名称 */
.category-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.25s ease;
}

/* 进入按钮 */
.enter-btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.3);
    margin-top: 4px;
}

.enter-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.enter-btn:disabled {
    background: #c5d4e8;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ========================================
   三级页面：提交成功页
   ======================================== */

.success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 24px 30px;
    text-align: center;
}

.success-icon-wrapper {
    margin-bottom: 24px;
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes successPop {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-check {
    width: 80px;
    height: 80px;
}

.success-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.success-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.5;
}

.success-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 通用按钮 */
.btn-outline {
    display: block;
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    background: #fff;
    border: 1.5px solid var(--primary);
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-outline:active {
    background: var(--primary-light);
    transform: scale(0.98);
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* ========================================
   四级页面：我的反馈列表
   ======================================== */

.feedback-list-content {
    padding: 16px;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #ccc;
}

.empty-state p {
    margin-top: 16px;
    font-size: 15px;
    color: var(--text-hint);
}

.empty-state.hidden {
    display: none;
}

/* 反馈条目 */
.feedback-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-item {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.feedback-item:active {
    transform: scale(0.98);
    background: #fafafa;
}

.feedback-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.feedback-item-category {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
}

.feedback-item-status {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
}

.feedback-item-status.pending {
    color: #faad14;
    background: #fffbe6;
}

.feedback-item-status.resolved {
    color: #52c41a;
    background: #f6ffed;
}

.feedback-item-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.feedback-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-hint);
}

.feedback-item-arrow {
    color: #ccc;
    font-size: 14px;
}

/* 反馈详情弹窗 */
.feedback-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.feedback-detail-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.feedback-detail-panel {
    background: #fff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px 20px 30px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.feedback-detail-overlay.show .feedback-detail-panel {
    transform: translateY(0);
}

.detail-handle {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.detail-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    -webkit-tap-highlight-color: transparent;
}

.detail-row {
    display: flex;
    margin-bottom: 12px;
    font-size: 14px;
}

.detail-label {
    color: var(--text-hint);
    min-width: 60px;
    flex-shrink: 0;
}

.detail-value {
    color: var(--text-primary);
    flex: 1;
    word-break: break-all;
}

.content-block,
.detail-content-block {
    background: #fafafa;
    border-radius: 8px;
    padding: 14px;
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ========================================
   二级页面：表单页
   ======================================== */

/* 返回按钮 */
.back-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.back-btn:active {
    opacity: 0.7;
}

/* Header 保持相对定位以容纳返回按钮，同时保留 sticky 头部效果 */
.header {
    position: sticky;
}

/* 已选领域展示 */
.category-display-group {
    border-left: 3px solid var(--primary);
}

.category-display {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--primary-light);
    border-radius: 8px;
    gap: 8px;
}

.category-display-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

/* 页面切换动画 */
.page {
    animation: pageIn 0.3s ease;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-category {
    animation: pageInFromLeft 0.3s ease;
}

@keyframes pageInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === 响应式适配 === */
@media screen and (min-width: 481px) {
    .container {
        margin-top: 20px;
        min-height: auto;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
    }
    
    .header {
        border-radius: 14px 14px 0 0;
    }
}
