/* ============================
   靖农优品-农户端 公共样式
   主题色：绿色（农业）
   ============================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f7fa;
}

/* ---- 登录页 ---- */
.login-page {
    background: linear-gradient(135deg, #2d8a3e 0%, #1a6b2a 50%, #0d4e1c 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 380px;
    padding: 20px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-logo h1 {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.login-logo p {
    color: rgba(255,255,255,0.75);
    font-size: 16px;
    margin-top: 4px;
}

.login-form {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 30px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    height: 46px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 16px;
    transition: all 0.3s;
    outline: none;
    -webkit-appearance: none;
}

.form-group input:focus {
    border-color: #2d8a3e;
    box-shadow: 0 0 0 3px rgba(45,138,62,0.15);
}

.toggle-pwd {
    position: absolute;
    right: 12px;
    top: 38px;
    cursor: pointer;
    font-size: 18px;
    user-select: none;
}

.btn-login {
    height: 48px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 4px;
    margin-top: 10px;
}

.login-hint {
    text-align: center;
    margin-top: 16px;
    color: #999;
    font-size: 13px;
}

.login-footer {
    text-align: center;
    margin-top: 40px;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
}

/* ---- 顶部导航 ---- */
.header {
    background: linear-gradient(135deg, #2d8a3e, #238034);
    color: #fff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-title {
    font-size: 17px;
    font-weight: bold;
}

.header-user {
    font-size: 13px;
    opacity: 0.9;
}

.btn-back {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

/* ---- 内容区 ---- */
.container {
    padding: 12px 16px;
    padding-bottom: 80px; /* 为底部导航留空间 */
}

/* ---- 卡片 ---- */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.more-link {
    font-size: 13px;
    color: #2d8a3e;
    font-weight: normal;
    cursor: pointer;
}

/* ---- 统计卡片 ---- */
.stats-grid {
    display: grid;
    gap: 12px;
}
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }

.stats-item {
    text-align: center;
    padding: 12px 8px;
    border-radius: 10px;
    background: #f8faf9;
    cursor: pointer;
    transition: transform 0.2s;
}

.stats-item:active { transform: scale(0.96); }

.stats-num {
    font-size: 22px;
    font-weight: bold;
    color: #333;
}

.stats-num .unit {
    font-size: 12px;
    font-weight: normal;
    color: #888;
}

.stats-label {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.highlight-green { color: #2d8a3e !important; }
.highlight-orange { color: #e67e22 !important; }
.highlight-red { color: #e74c3c !important; }
.highlight-blue { color: #3498db !important; }

/* ---- 快捷操作 ---- */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-item {
    text-align: center;
    padding: 14px 8px;
    border-radius: 12px;
    background: #f8faf9;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.quick-item:active { 
    transform: scale(0.95);
    background: #e8f5eb;
}

.quick-icon {
    font-size: 32px;
    margin-bottom: 6px;
}

.quick-text {
    font-size: 13px;
    color: #555;
}

.quick-badge {
    position: absolute;
    top: 6px;
    right: 12px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    display: none;
}

.quick-badge.show { display: inline-block; }

/* ---- 通知列表 ---- */
.notice-list, .notice-list-full {
    max-height: 300px;
    overflow-y: auto;
}

.notice-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
    cursor: pointer;
}

.notice-item:last-child { border-bottom: none; }

.notice-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notice-icon.delivery { background: #e8f5e9; }
.notice-icon.storage { background: #e3f2fd; }
.notice-icon.sorting { background: #fff3e0; }
.notice-icon.settlement { background: #fce4ec; }

.notice-content {
    flex: 1;
    min-width: 0;
}

.notice-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.notice-desc {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    line-height: 1.4;
}

.notice-time {
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
}

.notice-unread .notice-title {
    font-weight: bold;
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.empty-hint {
    text-align: center;
    padding: 40px 20px;
    color: #ccc;
    font-size: 14px;
}

/* ---- 记录列表 ---- */
.record-list { max-height: 280px; overflow-y: auto; }
.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.record-item:last-child { border-bottom: none; }
.record-info { flex: 1; }
.record-name { font-size: 14px; color: #333; font-weight: 500; }
.record-detail { font-size: 12px; color: #999; margin-top: 2px; }
.record-amount { font-size: 16px; font-weight: bold; color: #2d8a3e; }

/* ---- 过滤栏 ---- */
.filter-bar {
    display: flex;
    background: #fff;
    padding: 10px 16px;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #eee;
}

.filter-item {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.filter-item.active {
    background: #2d8a3e;
    color: #fff;
}

.filter-item:active { transform: scale(0.95); }

/* ---- 个人中心 ---- */
.profile-header {
    background: linear-gradient(135deg, #2d8a3e, #238034);
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}

.profile-avatar {
    font-size: 52px;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
}

.profile-info h2 {
    font-size: 20px;
    font-weight: bold;
}

.profile-info p {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 2px;
}

.menu-card { padding: 0; }
.menu-list {}
.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
}
.menu-item:active { background: #f9f9f9; }
.menu-item.divider { height: 8px; background: #f5f5f5; padding: 0; border: none; }
.menu-icon { font-size: 20px; margin-right: 12px; }
.menu-text { flex: 1; font-size: 15px; color: #333; }
.menu-arrow { color: #ccc; font-size: 14px; }
.menu-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    margin-right: 8px;
    display: none;
}
.menu-badge.show { display: inline-block; }

/* ---- 底部Tab栏 ---- */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    display: flex;
    border-top: 1px solid #eee;
    z-index: 200;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    position: relative;
    padding-top: 6px;
    transition: color 0.2s;
}

.tab-item.active { color: #2d8a3e; }
.tab-icon { font-size: 22px; }
.tab-text { font-size: 11px; margin-top: 2px; }
.tab-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    margin-right: -22px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 8px;
    padding: 0 4px;
}

/* ---- 按钮 ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary { background: linear-gradient(135deg, #2d8a3e, #258036); color: #fff; }
.btn-secondary { background: #f0f0f0; color: #555; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-outline { background: transparent; border: 1px solid #ddd; color: #666; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 20px; font-size: 16px; border-radius: 10px; }
.btn-block { display: block; width: 100%; }

/* ---- 加载提示 ---- */
.loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-content {
    background: #fff;
    padding: 24px 36px;
    border-radius: 12px;
    text-align: center;
}
.loading-spinner {
    width: 36px; height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #2d8a3e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: #666; }

/* ---- Toast提示 ---- */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0,0,0,0.78);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: all 0.25s;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ---- 表单元素 ---- */
.form-select {
    width: 100%;
    height: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 15px;
    outline: none;
    background: #fff;
}
.form-select:focus { border-color: #2d8a3e; }

/* ---- 滚动条美化 ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* ---- 动画 ---- */
.fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
