/* =============================================
   微爱创想 - 科技风格主样式
   主题色: 网信蓝 #1E88E5 (科技蓝)
   ============================================= */

/* ---------- CSS变量 ---------- */
:root {
    --primary: #1E88E5;
    --primary-light: #42A5F5;
    --primary-dark: #1565C0;
    --primary-bg: #E3F2FD;
    --secondary: #00BCD4;
    --success: #00C853;
    --warning: #FFB300;
    --danger: #FF5252;
    --info: #00BCD4;
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A68;
    --text-muted: #8E8EA0;
    --bg-white: #FFFFFF;
    --bg-light: #F5F7FA;
    --bg-gray: #E8ECF0;
    --border-color: #E0E4E8;
    --shadow: 0 2px 12px rgba(30,136,229,0.08);
    --shadow-hover: 0 4px 20px rgba(30,136,229,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --max-width: 1200px;
    --header-height: 60px;
    --nav-height: 56px;
}

/* ---------- 重置与基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text-primary);
    background: var(--bg-gray);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
}

/* ---------- 通用工具类 ---------- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    gap: 6px;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,136,229,0.4); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-gray { background: #E0E0E0; color: var(--text-secondary); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 36px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-wechat { background: #07C160; color: #fff; }
.btn-wechat:hover { background: #06AD56; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--bg-white);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,136,229,0.1); }
.form-control::placeholder { color: #ccc; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-body { padding: 16px; }
.card-header { padding: 16px; border-bottom: 1px solid var(--border-color); font-weight: 600; }
.card-footer { padding: 12px 16px; border-top: 1px solid var(--border-color); background: var(--bg-light); }

/* ---------- 标签 ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-success { background: #E8F5E9; color: var(--success); }
.tag-warning { background: #FFF3E0; color: var(--warning); }
.tag-danger { background: #FFEBEE; color: var(--danger); }
.tag-info { background: #E0F7FA; color: var(--info); }
.tag-vip { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; }

/* ---------- 头部导航 ---------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    z-index: 1000;
    display: flex;
    align-items: center;
}
.header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.header-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--primary); }
.header-logo img { height: 36px; }
.header-nav { display: flex; align-items: center; gap: 32px; }
.header-nav a { color: var(--text-secondary); font-size: 15px; font-weight: 500; position: relative; padding: 4px 0; }
.header-nav a:hover, .header-nav a.active { color: var(--primary); }
.header-nav a.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--primary); border-radius: 1px; }
.header-actions { background: transparent !important; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 2px solid var(--border-color); }
.header-menu-btn { display: none; font-size: 24px; cursor: pointer; color: var(--text-primary); background: none; border: none; }

/* ---------- 底部导航（移动端） ---------- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-white);
    box-shadow: 0 -1px 4px rgba(0,0,0,0.06);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 12px;
    transition: color 0.2s;
    text-decoration: none;
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item .nav-icon { font-size: 22px; }
.bottom-nav-item .nav-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.bottom-nav-item .nav-icon-wrap { position: relative; }
.bottom-nav-publish {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
    box-shadow: 0 2px 12px rgba(30,136,229,0.4);
}
.bottom-nav-publish .nav-icon { color: #fff; font-size: 26px; }

/* ---------- 主内容区 ---------- */
.main-content {
    padding-top: calc(var(--header-height) + 16px);
    padding-bottom: 32px;
    min-height: 100vh;
}

/* ---------- Banner/轮播 ---------- */
.banner-section { margin-bottom: 20px; }
.banner-slider {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 3/1;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.banner-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

/* ---------- 分类筛选 ---------- */
.category-section { margin-bottom: 20px; }
.category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 64px;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-secondary);
}
.category-item:hover, .category-item.active { background: var(--primary-bg); color: var(--primary); }
.category-icon { font-size: 28px; }
.category-name { font-size: 12px; white-space: nowrap; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    flex-wrap: wrap;
}
.filter-item {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.filter-item:hover, .filter-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 搜索栏 ---------- */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border-radius: 24px;
    padding: 8px 16px;
    box-shadow: var(--shadow);
    gap: 8px;
    margin-bottom: 16px;
}
.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    padding: 4px 0;
}
.search-bar button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 13px;
    cursor: pointer;
}

/* ---------- 通告卡片 ---------- */
.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    gap: 12px;
}
.notice-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.notice-card-image {
    width: 110px;
    height: 110px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-light);
}
.notice-card-content { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.notice-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.notice-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.notice-card-info { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.notice-card-reward { font-size: 18px; font-weight: 700; color: var(--primary); }
.notice-card-reward small { font-size: 12px; font-weight: 400; }
.notice-card-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; }
.notice-card-merchant { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.notice-card-merchant img { width: 20px; height: 20px; border-radius: 50%; }
.notice-card-merchant span { font-size: 12px; color: var(--text-muted); }
.notice-urgent { border-left: 3px solid var(--danger); }
.notice-top { border-left: 3px solid var(--secondary); }

/* ---------- 通告详情页 ---------- */
.detail-header {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.detail-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; line-height: 1.4; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}
.detail-info-item { display: flex; flex-direction: column; gap: 4px; }
.detail-info-label { font-size: 12px; color: var(--text-muted); }
.detail-info-value { font-size: 14px; font-weight: 500; }
.detail-content { background: var(--bg-white); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.detail-content h3 { font-size: 16px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.detail-content p { font-size: 14px; line-height: 1.8; color: var(--text-secondary); white-space: pre-wrap; }
.detail-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.detail-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; }
.detail-merchant { background: var(--bg-white); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.detail-merchant-info { display: flex; align-items: center; gap: 12px; }
.detail-merchant-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.detail-apply-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    padding: 12px 16px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    padding-bottom: calc(24px + constant(safe-area-inset-bottom));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.detail-apply-price { font-size: 22px; font-weight: 700; color: var(--primary); }
.detail-apply-price small { font-size: 13px; font-weight: 400; color: var(--text-muted); }

/* ---------- 个人中心 ---------- */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 32px 20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    color: #fff;
    text-align: center;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.5);
    margin-bottom: 12px;
    object-fit: cover;
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-role { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}
.profile-stat { text-align: center; }
.profile-stat-num { font-size: 22px; font-weight: 700; }
.profile-stat-label { font-size: 12px; opacity: 0.8; }
.profile-menu { padding: 16px; }
.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}
.profile-menu-item:hover { background: var(--bg-light); }
.profile-menu-item .menu-left { display: flex; align-items: center; gap: 12px; }
.profile-menu-item .menu-icon { font-size: 20px; width: 24px; text-align: center; }
.profile-menu-item .menu-arrow { color: var(--text-muted); font-size: 14px; }

/* ---------- 登录/注册页 ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-bg), #fff);
    padding: 20px;
}
.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 28px; color: var(--primary); margin-top: 12px; }
.auth-logo p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.auth-tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.auth-tab { flex: 1; text-align: center; padding: 12px; cursor: pointer; font-size: 15px; color: var(--text-muted); border-bottom: 2px solid transparent; transition: all 0.2s; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; color: var(--text-muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.role-selector { display: flex; gap: 12px; margin-bottom: 20px; }
.role-option {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.role-option.active { border-color: var(--primary); background: var(--primary-bg); }
.role-option .role-icon { font-size: 32px; margin-bottom: 8px; }
.role-option .role-name { font-size: 14px; font-weight: 600; }
.role-option .role-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state .empty-text { font-size: 14px; margin-bottom: 16px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 20px 0; }
.pagination .page-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.pagination .page-item:hover, .pagination .page-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 弹窗/模态框 ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 16px; }
.modal-close { font-size: 24px; cursor: pointer; color: var(--text-muted); background: none; border: none; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; }

/* ---------- Toast提示 ---------- */
.toast-container { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 3000; }
.toast {
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    margin-bottom: 8px;
    animation: toastIn 0.3s ease;
    white-space: nowrap;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 加载动画 ---------- */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   响应式布局
   ============================================= */

/* 平板 */
@media (max-width: 768px) {
    :root { --header-height: 52px; }
    .header-nav { display: none; }
    .header-menu-btn { display: block; }
    .bottom-nav { display: flex; }
    .main-content { padding-bottom: calc(var(--nav-height) + 16px); }
    .notice-card-image { width: 90px; height: 90px; }
    .notice-card-title { font-size: 14px; }
    .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-card { padding: 24px; }
    .container { padding: 0 12px; }
    .profile-stats { gap: 24px; }
    .banner-slider { aspect-ratio: 2/1; }
}

/* 手机 */
@media (max-width: 480px) {
    .notice-card { padding: 12px; }
    .notice-card-image { width: 80px; height: 80px; }
    .detail-info-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .detail-title { font-size: 18px; }
    .filter-bar { gap: 8px; }
    .filter-item { padding: 5px 12px; font-size: 12px; }
    .category-item { min-width: 56px; padding: 8px 6px; }
    .category-icon { font-size: 24px; }
}

/* PC大屏 */
@media (min-width: 1024px) {
    .notice-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .notice-card { flex-direction: row; }
}

/* 详情页底部留白 */
#detailPage {
    padding-bottom: 100px;
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
}
