﻿/**
 * 法智AI - 基础样式
 */

:root {
    /* 主题色 */
    --primary: #FF6B35;
    --primary-light: #FF8F66;
    --primary-dark: #E55A2B;
    --success: #52C41A;
    --warning: #FAAD14;
    --error: #FF4D4F;
    --danger: #FF4D4F;
    --info: #1890FF;

    /* 文字色 */
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-disabled: #CCCCCC;

    /* 背景色 */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-hover: #FAFAFA;

    /* 文字颜色 */
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-tertiary: #999999;

    /* 边框 */
    --border-color: #E5E5E5;
    --border: #E5E5E5;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);

    /* 字体 */
    --font-size-xs: 10px;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-xxl: 24px;

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-xxl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--font-size-md);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    outline: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

#app {
    min-height: 100vh;
    background: var(--bg-secondary);
}

.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 60px;
}

/* 页面头部 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    padding: 0 var(--spacing-lg);
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header .header-back,
.page-header .header-action {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header .header-back svg,
.page-header .header-action svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.page-header .page-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.page-header .header-placeholder {
    width: 44px;
}

/* 通用返回按钮样式 */
.header-back {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
}

.header-back svg {
    width: 24px !important;
    height: 24px !important;
    fill: white !important;
}

/* 自定义header容器 */
.share-header,
.poster-nav-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.share-header-title,
.poster-nav-title {
    flex: 1 !important;
    text-align: center !important;
}

.page-content {
    flex: 1;
    padding: var(--spacing-lg);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 var(--spacing-xl);
    font-size: var(--font-size-md);
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    height: 36px;
    padding: 0 var(--spacing-lg);
    font-size: var(--font-size-sm);
}

.btn-lg {
    height: 50px;
    font-size: var(--font-size-lg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 表单 */
.form-input {
    width: 100%;
    height: 48px;
    padding: 0 var(--spacing-lg);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.form-input:focus {
    border-color: var(--primary);
}

.form-textarea {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    resize: none;
}

.form-select {
    width: 100%;
    height: 48px;
    padding: 0 var(--spacing-lg);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    appearance: none;
}

/* 卡片 */
.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

/* 页面加载 */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}
.page-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}
.page-loading p {
    color: white;
    font-size: 16px;
    margin: 0;
}
.page-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 加载 */
.spinner,
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--text-tertiary);
}

/* 空状态 */
.empty {
    text-align: center;
    padding: var(--spacing-xxl);
    color: var(--text-tertiary);
}

/* 底部导航 */
.bottom-nav {
    display: flex;
    height: 50px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
}

.nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
    fill: currentColor;
}

.nav-item.active {
    color: var(--primary);
}

/* 辅助 */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }

/* ========== 心理学优化版海报页面 - 紧凑版 ========== */
.poster-content-wrapper {
    padding: 50px 10px 85px;
    background: linear-gradient(180deg, #FFF8F5 0%, #FFFFFF 100%);
    min-height: 100vh;
}

/* 锚定价格区 - 损失厌恶 */
.poster-urgency-header {
    background: linear-gradient(135deg, #FF6B35, #FF8E53);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.poster-urgency-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.poster-price-anchor {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.poster-price-old {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: line-through;
}

.poster-price-current {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.poster-price-zero {
    font-size: 26px;
    font-weight: 800;
    color: white;
}

.poster-price-label {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
}

.poster-urgent-badge {
    display: inline-block;
    background: #FFD700;
    color: #333;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: pulse-urgent 1.5s infinite;
}

@keyframes pulse-urgent {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 用户信息区 - 真实姓名 + 故事 */
.poster-user-section {
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.poster-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.poster-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35, #FF8E53);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #FFF5F0;
}

.poster-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-user-details {
    flex: 1;
}

.poster-user-name {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.poster-user-story {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

.poster-user-story strong {
    color: #FF6B35;
}

.poster-help-request {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #FFF5F0;
    padding: 8px;
    border-radius: 20px;
    font-size: 13px;
    color: #FF6B35;
    font-weight: 600;
}

.poster-hand-icon {
    font-size: 16px;
}

/* 帮追进度 - 社会认同 */
.poster-progress-section {
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.poster-progress-bar {
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    margin-bottom: 8px;
    position: relative;
    overflow: visible;
}

.poster-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF6B35, #FF8E53);
    border-radius: 5px;
    position: relative;
    transition: width 0.5s ease;
}

.poster-progress-coin {
    position: absolute;
    right: -6px;
    top: -6px;
    font-size: 20px;
    animation: coin-bounce 1s infinite;
}

@keyframes coin-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.poster-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poster-help-count {
    font-size: 12px;
    color: #666;
}

.poster-help-count strong {
    color: #FF6B35;
    font-size: 16px;
}

.poster-need-count {
    font-size: 12px;
    color: #666;
}

.poster-need-count strong {
    color: #FF6B35;
}

.poster-need-count.urgent {
    color: #ff4444;
    animation: blink-urgent 1s infinite;
}

.poster-need-count.urgent strong {
    color: #ff4444;
}

@keyframes blink-urgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 核心行动区 - CTA */
.poster-cta-section {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    text-align: center;
}

.poster-scan-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
}

.poster-scan-arrow {
    font-size: 22px;
    animation: point-down 1s infinite;
}

@keyframes point-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

.poster-scan-text {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.poster-qrcode-box {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 10px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.poster-qrcode-inner {
    font-size: 40px;
}

.poster-reward-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: #333;
    font-weight: 600;
}

.poster-reward-icon {
    margin-right: 4px;
}

/* 积分价值 - 互惠 */
.poster-points-benefit {
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.poster-benefit-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-align: center;
}

.poster-benefit-items {
    display: flex;
    justify-content: space-around;
}

.poster-benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.poster-benefit-icon {
    font-size: 20px;
}

.poster-benefit-item span:last-child {
    font-size: 11px;
    color: #666;
}

/* 品牌 */
.poster-brand-footer {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 6px;
}

.poster-brand-sep {
    margin: 0 6px;
}

/* 底部操作区 */
.poster-bottom-actions {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    background: white;
    padding: 12px 15px calc(12px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.poster-btn-save,
.poster-btn-share {
    flex: 1;
    padding: 12px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.poster-btn-save {
    background: #f5f5f5;
    color: #666;
}

.poster-btn-share {
    background: linear-gradient(135deg, #FF6B35, #FF8E53);
    color: white;
}

.poster-my-link {
    font-size: 12px;
    color: #999;
    text-decoration: none;
    white-space: nowrap;
}

/* ========== 广告遮罩层 ========== */
.ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8E53 50%, #FFA07A 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.ad-overlay.hidden {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.ad-container {
    text-align: center;
    color: white;
}

.ad-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ad-logo img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.ad-logo span {
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.ad-slogan {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.ad-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ad-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.ad-loading span {
    font-size: 13px;
    opacity: 0.8;
}

/* 广告背景图 */
.ad-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.ad-bg-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 107, 53, 0.85);
}
