/* ============================================================
   党费收费系统 - 全局样式
   移动端H5风格，红色党建主题
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #c41e3a;
    --primary-light: #e84545;
    --primary-dark: #8b0000;
    --primary-bg: #fff5f5;
    --gold: #d4af37;
    --text-main: #333;
    --text-sub: #666;
    --text-light: #999;
    --bg-page: #f5f5f5;
    --bg-white: #fff;
    --border: #eee;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-page);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body {
    max-width: 750px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: 70px;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ==================== 顶部导航 ==================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

.navbar .back-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
}

.navbar .title {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.navbar .right-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

/* ==================== 头部Banner区域 ==================== */
.header-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px 16px 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.header-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -30px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.header-banner .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.header-banner .logo {
    width: 48px;
    height: 48px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-dark);
}

.header-banner .site-title {
    font-size: 22px;
    font-weight: 700;
}

.header-banner .site-subtitle {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 2px;
}

/* ==================== 轮播图 ==================== */
.swiper-container {
    margin: -25px 16px 16px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    height: 160px;
    background: #ddd;
}

.swiper-slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swiper-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.swiper-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: all 0.3s;
}

.swiper-dot.active {
    width: 18px;
    border-radius: 3px;
    background: #fff;
}

/* ==================== 功能按钮网格 ==================== */
.menu-grid {
    background: var(--bg-white);
    margin: 0 16px 16px;
    border-radius: var(--radius);
    padding: 20px 12px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 8px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.menu-item:active {
    transform: scale(0.95);
}

.menu-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 8px;
    background: var(--primary-bg);
    color: var(--primary);
}

.menu-icon.blue { background: #e6f7ff; color: #1890ff; }
.menu-icon.green { background: #f6ffed; color: #52c41a; }
.menu-icon.orange { background: #fff7e6; color: #fa8c16; }
.menu-icon.purple { background: #f9f0ff; color: #722ed1; }
.menu-icon.cyan { background: #e6fffb; color: #13c2c2; }

.menu-label {
    font-size: 13px;
    color: var(--text-main);
    text-align: center;
}

/* ==================== 卡片 ==================== */
.card {
    background: var(--bg-white);
    margin: 0 16px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

.card-more {
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
}

.card-body {
    padding: 16px;
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: var(--bg-white);
    transition: border-color 0.3s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
}

.form-input::placeholder {
    color: var(--text-light);
}

textarea.form-input {
    height: auto;
    padding: 12px 14px;
    resize: vertical;
    min-height: 80px;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(196, 30, 58, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    background: var(--bg-white);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 6px;
}

/* ==================== 缴费记录列表 ==================== */
.pay-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.pay-item:last-child {
    border-bottom: none;
}

.pay-item:active {
    background: var(--primary-bg);
}

.pay-month {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--primary-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
}

.pay-month .month-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.pay-month .month-text {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 2px;
}

.pay-info {
    flex: 1;
    min-width: 0;
}

.pay-info .pay-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.pay-info .pay-detail {
    font-size: 12px;
    color: var(--text-light);
}

.pay-amount {
    text-align: right;
    flex-shrink: 0;
}

.pay-amount .amount {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
}

.pay-amount .status {
    font-size: 12px;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.status-paid {
    background: #f6ffed;
    color: var(--success);
}

.status-unpaid {
    background: #fff2f0;
    color: var(--danger);
}

/* ==================== 日历视图 ==================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px;
}

.calendar-month {
    aspect-ratio: 1;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid transparent;
}

.calendar-month:active {
    transform: scale(0.95);
}

.calendar-month.paid {
    background: linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%);
    border-color: #b7eb8f;
}

.calendar-month.unpaid {
    background: linear-gradient(135deg, #fff2f0 0%, #ffccc7 100%);
    border-color: #ffa39e;
}

.calendar-month .month-num {
    font-size: 22px;
    font-weight: 700;
}

.calendar-month.paid .month-num { color: var(--success); }
.calendar-month.unpaid .month-num { color: var(--danger); }

.calendar-month .month-status {
    font-size: 11px;
    margin-top: 4px;
}

.calendar-month.paid .month-status { color: var(--success); }
.calendar-month.unpaid .month-status { color: var(--danger); }

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-sub);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-dot.paid { background: #b7eb8f; }
.legend-dot.unpaid { background: #ffa39e; }

/* ==================== 个人资料 ==================== */
.profile-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 30px 16px 50px;
    color: #fff;
    text-align: center;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gold);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary-dark);
    border: 3px solid rgba(255,255,255,0.3);
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
}

.profile-branch {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
}

.profile-stats {
    display: flex;
    background: var(--bg-white);
    margin: -30px 16px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 0;
}

.profile-stat {
    flex: 1;
    text-align: center;
    border-right: 1px solid var(--border);
}

.profile-stat:last-child {
    border-right: none;
}

.profile-stat .num {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.profile-stat .label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.info-list {
    background: var(--bg-white);
    margin: 0 16px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.info-row {
    display: flex;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    width: 110px;
    color: var(--text-sub);
    flex-shrink: 0;
}

.info-row .value {
    flex: 1;
    color: var(--text-main);
    word-break: break-all;
}

/* ==================== 底部Tab栏 ==================== */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    height: 60px;
    background: var(--bg-white);
    display: flex;
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
}

.tabbar-item.active {
    color: var(--primary);
}

.tabbar-item .icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.tabbar-item .label {
    font-size: 11px;
}

/* ==================== 弹窗 ==================== */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-mask.show {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    width: 100%;
    max-width: 750px;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state .text {
    font-size: 14px;
}

/* ==================== 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: 8px;
    font-size: 14px;
    z-index: 2000;
    display: none;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    display: block;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== 加载中 ==================== */
.loading {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 计算器结果 ==================== */
.calc-result {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #fff 100%);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.calc-result .fee-label {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.calc-result .fee-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.calc-result .fee-amount .unit {
    font-size: 16px;
    font-weight: 400;
}

.calc-result .fee-yearly {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

/* ==================== 公告列表 ==================== */
.notice-item {
    display: flex;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.notice-item:last-child { border-bottom: none; }

.notice-tag {
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-right: 8px;
    height: fit-content;
    margin-top: 2px;
}

.notice-tag.notice { background: #e6f7ff; color: #1890ff; }
.notice-tag.announcement { background: #fff2f0; color: var(--danger); }
.notice-tag.top { background: var(--primary); color: #fff; }

.notice-content {
    flex: 1;
    min-width: 0;
}

.notice-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 12px;
}

/* ==================== 活动列表 ==================== */
.activity-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.activity-item:last-child { border-bottom: none; }

.activity-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.activity-meta {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.activity-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-top: 6px;
}

.activity-status.upcoming { background: #e6f7ff; color: #1890ff; }
.activity-status.ongoing { background: #f6ffed; color: var(--success); }
.activity-status.ended { background: #f5f5f5; color: var(--text-light); }

/* ==================== 支付页面 ==================== */
.pay-amount-box {
    text-align: center;
    padding: 30px 16px;
    background: linear-gradient(135deg, var(--primary-bg) 0%, #fff 100%);
}

.pay-amount-box .label {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.pay-amount-box .amount {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary);
}

.pay-amount-box .amount .symbol {
    font-size: 24px;
}

.pay-detail-list {
    background: var(--bg-white);
    margin: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.pay-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.pay-detail-item:last-child { border-bottom: none; }
.pay-detail-item .label { color: var(--text-sub); }
.pay-detail-item .value { color: var(--text-main); font-weight: 500; }

/* ==================== 选择月份 ==================== */
.month-select-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px;
}

.month-select-item {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-white);
}

.month-select-item.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.month-select-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
}

.month-select-item .num {
    font-size: 18px;
    font-weight: 600;
}

.month-select-item .amt {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.month-select-item.selected .num { color: var(--primary); }

/* ==================== 报到页面 ==================== */
.report-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
}

.report-circle:active {
    transform: scale(0.95);
}

.report-circle.reported {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    box-shadow: 0 8px 24px rgba(82, 196, 26, 0.4);
}

.report-circle .icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.report-circle .text {
    font-size: 20px;
    font-weight: 600;
}

.report-circle .time {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
}
