* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #27ae60;
    --primary-dark: #1e8449;
    --primary-light: #d5f5e3;
    --success: #2ecc71;
    --warning: #f39c12;
    --bg: #f0f5f0;
    --card-bg: #fff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #d5ddd5;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --header-height: 50px;
    --bottom-nav-height: 64px;
}
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: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
input, textarea, button { font-family: inherit; font-size: inherit; }

/* Navigation */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--primary);
    color: #fff;
    z-index: 100;
    display: flex;
    align-items: center;
}
.nav-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 12px;
}
.nav-left, .nav-right { flex: 1; }
.nav-right { text-align: right; }
.nav-title {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    flex: 2;
}
.nav-back, .nav-user {
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.nav-back:hover, .nav-user:hover { background: rgba(255,255,255,0.15); }

/* Main Content */
.main-content {
    max-width: 640px;
    margin: 0 auto;
    margin-top: var(--header-height);
    padding: 12px;
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    min-height: 100vh;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height);
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    z-index: 100;
    max-width: 640px;
    margin: 0 auto;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px 0 6px;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s;
}
.nav-item.active { color: var(--primary); }
.nav-icon { font-size: 22px; margin-bottom: 2px; }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.need-card { cursor: pointer; transition: transform 0.15s; }
.need-card:active { transform: scale(0.98); }
.need-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.need-user { font-weight: 600; font-size: 14px; }
.need-status { font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.status-pending { background: #ffeaa7; color: #d68910; }
.status-claimed { background: #dff9fb; color: #2980b9; }
.status-completed { background: #d5f5e3; color: #1e8449; }
.status-cancelled { background: #f2f3f4; color: #95a5a6; }
.need-body { margin-bottom: 8px; }
.need-quantity { font-size: 24px; font-weight: 700; color: var(--primary); }
.need-quantity small { font-size: 14px; font-weight: 400; color: var(--text-light); }
.need-desc { color: var(--text); font-size: 14px; margin-top: 4px; }
.need-location { color: var(--text-light); font-size: 13px; margin-top: 4px; }
.need-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    padding-top: 8px;
}
.my-claim-tag { color: var(--success); font-weight: 600; cursor: pointer; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: #fafafa;
}
.form-input:focus {
    border-color: var(--primary);
    background: #fff;
}
textarea.form-input { resize: vertical; min-height: 60px; }
select.form-input { appearance: auto; }
.form-row { display: flex; gap: 10px; }
.form-half { flex: 1; }
.radio-group {
    display: flex;
    gap: 10px;
}
.radio-item {
    flex: 1;
    text-align: center;
    padding: 8px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
}
.radio-item input { display: none; }
.radio-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #219a52; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 6px; }
.btn-cancel { background: #f2f3f4; color: var(--text); }
.btn.active {
    background: var(--primary);
    color: #fff;
}

/* Auth */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}
.auth-card {
    width: 100%;
    max-width: 360px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow);
}
.auth-logo { text-align: center; font-size: 48px; margin-bottom: 8px; }
.auth-title { text-align: center; margin-bottom: 24px; font-size: 20px; }
.auth-link { text-align: center; margin-top: 14px; font-size: 14px; color: var(--text-light); }
.auth-error { text-align: center; margin-top: 10px; color: var(--primary); font-size: 13px; }

/* Detail */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.detail-header h3 { font-size: 18px; }
.detail-row {
    display: flex;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}
.detail-label {
    width: 80px;
    flex-shrink: 0;
    color: var(--text-light);
    font-size: 14px;
}
.detail-action { margin-top: 16px; }
.claim-form { margin-top: 12px; }
.claims-section { margin-top: 16px; padding-top: 12px; border-top: 2px solid var(--border); }
.claims-section h4 { margin-bottom: 10px; font-size: 16px; }
.claim-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.claim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.claim-info { font-size: 13px; color: var(--text); margin-bottom: 3px; }
.tip-text { text-align: center; color: var(--success); font-size: 14px; font-weight: 500; }

/* Page tools */
.page-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state p { font-size: 16px; margin-bottom: 16px; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.modal-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal-card h3 { margin-bottom: 16px; font-size: 18px; }

/* Toast */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 300;
    max-width: 80%;
    text-align: center;
    animation: toastIn 0.3s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Load more */
.load-more { padding: 8px 0; }

/* Responsive for desktop */
@media (min-width: 768px) {
    .main-content { padding: 20px; }
    .need-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
}

/* ========== Guide Page ========== */
.hero-section {
    text-align: center;
    padding: 32px 12px 24px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 50%, #eafaf1 100%);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.hero-icon { font-size: 56px; margin-bottom: 8px; }
.hero-title { font-size: 26px; color: var(--primary); margin-bottom: 8px; }
.hero-desc { font-size: 14px; color: var(--text-light); line-height: 1.6; margin-bottom: 20px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { min-width: 140px; }

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 12px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

/* ===== 使用指引面板（我需要 / 我提供） ===== */
.guide-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}
.guide-panel-header {
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}
.guide-panel-icon { font-size: 22px; }
.need-header-color { background: linear-gradient(135deg, #229954, #1e8449); }
.give-header-color { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.guide-panel-body { padding: 16px 18px; }
.guide-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.guide-step-num {
    flex-shrink: 0;
    width: 26px; height: 26px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
}
.guide-step-content { flex: 1; min-width: 0; }
.guide-step-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.guide-step-desc { font-size: 13px; color: var(--text-light); line-height: 1.6; margin-bottom: 6px; }
.guide-step-example {
    font-size: 12px; color: #7f8c8d;
    background: #f5f6fa; border-radius: 6px; padding: 5px 10px;
}
.claim-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* 复选框 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 16px; height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}
.checkbox-label a {
    color: var(--primary);
    text-decoration: underline;
}

/* 用户协议弹窗 */
.agreement-card {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.agreement-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 4px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 12px;
}
.agreement-content p { margin: 0; }

/* 我的页面 */
.mine-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
}
.mine-avatar {
    width: 50px; height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    flex-shrink: 0;
}
.mine-info { flex: 1; }
.mine-name { font-size: 17px; font-weight: 700; }
.mine-phone { font-size: 13px; color: var(--text-light); margin-top: 2px; }

.guide-step-connector {
    width: 2px; height: 20px;
    background: #ddd;
    margin: 4px 0 4px 12px;
}

.rules-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.rule-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}
.rule-item:last-child { border-bottom: none; }
.rule-item span { line-height: 1.5; }

.stats-row {
    display: flex; gap: 10px;
}
.stat-item {
    flex: 1;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 8px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-num {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}
.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Desktop */
@media (min-width: 640px) {
    .guide-panels-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .guide-panel { margin-bottom: 0; }
}
