* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1890ff;
    --primary-dark: #096dd9;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg: #f5f5f5;
    --bg-white: #fff;
    --border: #e8e8e8;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-white);
}

/* 顶部导航 */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
}

.navbar .back-btn {
    position: absolute;
    left: 12px;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.navbar .title {
    text-align: center;
}

/* 页面容器 */
.page {
    display: none;
    padding: 16px;
    padding-bottom: 80px;
}

.page.active {
    display: block;
}

/* 卡片 */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.5;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tag-blue { background: #e6f7ff; color: #1890ff; }
.tag-green { background: #f6ffed; color: #52c41a; }
.tag-orange { background: #fff7e6; color: #fa8c16; }
.tag-red { background: #fff2f0; color: #ff4d4f; }
.tag-gray { background: #f5f5f5; color: #999; }

/* 活动列表 */
.activity-item {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.activity-item:active {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.activity-item .activity-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.activity-item .activity-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.activity-item .activity-status {
    margin-top: 8px;
}

/* 发票列表 */
.invoice-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.invoice-item:last-child {
    border-bottom: none;
}

.invoice-item .invoice-info {
    flex: 1;
}

.invoice-item .invoice-amount {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.invoice-item .invoice-type {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 16px;
}

.upload-area:hover {
    border-color: var(--primary);
}

.upload-area .upload-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.upload-area .upload-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state .empty-text {
    font-size: 14px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

/* 底部TabBar */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
}

.tabbar .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    color: var(--text-light);
    font-size: 12px;
    transition: color 0.2s;
    text-decoration: none;
}

.tabbar .tab-item.active {
    color: var(--primary);
}

.tabbar .tab-item .tab-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

/* 确认页面 */
.confirm-card {
    background: #f0f9ff;
    border: 1px solid #bae7ff;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.confirm-card .amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin: 12px 0;
}

.confirm-card .label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 表单字段 */
.dynamic-field {
    margin-bottom: 16px;
}

.dynamic-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.dynamic-field label .required {
    color: var(--danger);
    margin-left: 2px;
}

.dynamic-field .field-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 历史记录 */
.history-item {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item .history-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.history-item .history-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 分割线 */
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* 提示文字 */
.hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
}

.overlay.show {
    display: block;
}

/* 底部弹出面板 */
.sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-white);
    border-radius: 16px 16px 0 0;
    z-index: 300;
    padding: 20px;
    display: none;
}

.sheet.show {
    display: block;
}

.sheet .sheet-title {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
}

/* 辅助类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* 登录页特殊样式 */
.login-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 24px;
}

.login-page .logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-page .logo h1 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-page .logo p {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-page .form-group input {
    height: 44px;
}

.login-page .btn-lg {
    height: 44px;
    font-size: 16px;
}

.login-page .switch-link {
    text-align: center;
    margin-top: 16px;
}

.login-page .switch-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

/* 详情页信息块 */
.info-block {
    background: #fafafa;
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.info-row .label {
    color: var(--text-secondary);
}

.info-row .value {
    color: var(--text);
    font-weight: 500;
}

/* 选择卡片 */
.choice-cards {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.choice-card {
    flex: 1;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.choice-card.selected {
    border-color: var(--primary);
    background: #e6f7ff;
}

.choice-card .choice-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.choice-card .choice-label {
    font-size: 14px;
    font-weight: 500;
}

/* 进度条 */
.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar .progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s;
}

/* 文件预览 */
.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.file-preview .file-icon {
    font-size: 32px;
}

.file-preview .file-name {
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
}

.file-preview .file-size {
    font-size: 12px;
    color: var(--text-light);
}

/* 上传按钮图标 */
.btn-upload-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    line-height: 1;
}

/* 已提交信息展示 */
.submitted-info {
    background: #fafafa;
    border-radius: var(--radius);
    padding: 12px;
}

.submitted-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.submitted-row:last-of-type {
    border-bottom: none;
}

.submitted-label {
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-right: 12px;
}

.submitted-value {
    color: var(--text);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.submitted-tip {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

/* 发票报销细则 */
.guidelines {
    font-size: 13px;
    line-height: 1.8;
}

.guidelines-section {
    margin-bottom: 16px;
}

.guidelines-section:last-child {
    margin-bottom: 0;
}

.guidelines-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 14px;
}

.guidelines-item {
    color: var(--text-secondary);
    padding: 2px 0;
}

.invoice-info-box {
    background: #f6f6f6;
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 发票示例 */
.example-section {
    margin-bottom: 16px;
}

.example-section:last-child {
    margin-bottom: 0;
}

.example-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.example-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.example-list {
    display: flex;
    gap: 12px;
    padding-bottom: 8px;
}

.example-item {
    flex-shrink: 0;
    width: 120px;
    text-align: center;
}

.example-img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}

.example-img:hover {
    transform: scale(1.05);
}

.example-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    display: block;
}

/* 图片预览 */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.preview-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

/* 定位按钮 */
.btn-locate {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: #e6f7ff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-locate:active {
    background: #bae7ff;
    transform: scale(0.96);
}

.btn-locate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-locate .locate-icon {
    font-size: 14px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-locate .locate-icon.spinning {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* 定位信息 */
.location-info {
    display: none;
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    background: #fafafa;
    color: var(--text-secondary);
}

.location-info.show {
    display: block;
}

.location-info.success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
}

.location-info.error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: var(--danger);
}

.location-info .location-addr {
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
}

.location-info .location-coord {
    color: var(--text-light);
    font-size: 11px;
}

/* 响应式 */
@media (max-width: 360px) {
    .container {
        padding: 0;
    }
    .page {
        padding: 12px;
    }
    .example-item {
        width: 100px;
    }
    .example-img {
        width: 100px;
        height: 133px;
    }
}

/* 多文件上传识别动画 spinner */
.upload-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto;
    border: 4px solid #e6f7ff;
    border-top-color: var(--primary, #1890ff);
    border-radius: 50%;
    animation: upload-spin 0.8s linear infinite;
}

@keyframes upload-spin {
    to { transform: rotate(360deg); }
}
