/* 农业研究院风格配色 - 简约精致 */
:root {
    --primary-green: #2d5016;
    --light-green: #5a7a3c;
    --bg-cream: #f5f3ed;
    --bg-white: #ffffff;
    --text-dark: #2c2c2c;
    --text-gray: #666666;
    --border-light: #d4cfc4;
    --accent-gold: #b8965f;
    --success: #4a7c59;
    --warning: #c9975b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 60px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: white;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.user-info {
    background: var(--bg-white);
    padding: 16px;
    margin: 20px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-info .name {
    font-size: 16px;
    color: var(--text-dark);
}

.user-info .logout-btn {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-gray);
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.user-info .logout-btn:hover {
    background: var(--bg-cream);
}

/* 卡片样式 */
.card {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-cream);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 16px;
    background: var(--bg-white);
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--light-green);
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--light-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.2);
}

.btn-primary:disabled {
    background: var(--text-gray);
    cursor: not-allowed;
    transform: none;
}

/* 商品列表 */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-cream);
    border-radius: 6px;
}

.product-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: var(--light-green);
    border-color: var(--light-green);
    color: white;
}

.quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quantity-btn:disabled:hover {
    background: var(--bg-white);
    border-color: var(--border-light);
    color: var(--text-dark);
}

.quantity-value {
    min-width: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-green);
}

/* 通知消息 */
.notice {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.notice-warning {
    background: #fff8e6;
    border-left: 4px solid var(--warning);
    color: #7a5b2f;
}

.notice-success {
    background: #e8f5e9;
    border-left: 4px solid var(--success);
    color: #2d5016;
}

.notice-info {
    background: #e3f2fd;
    border-left: 4px solid #5a7a3c;
    color: #2d5016;
}

/* 订单汇总 */
.order-summary {
    background: var(--bg-cream);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
}

.summary-item.total {
    border-top: 2px solid var(--border-light);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary-green);
}

/* 管理员表格 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th {
    background: var(--bg-cream);
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-green);
    border-bottom: 2px solid var(--border-light);
}

table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--bg-cream);
}

table tr:last-child td {
    border-bottom: none;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg-cream);
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-gray);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
    font-weight: 600;
}

.tab:hover {
    color: var(--primary-green);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
}

/* 选择器 */
.period-selector {
    margin-bottom: 20px;
}

.period-selector select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 15px;
    background: var(--bg-white);
    color: var(--text-dark);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
}

.loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

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

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

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 32px 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-icon.success {
    background-color: #e8f5e9;
    border: 3px solid var(--success);
}

.modal-icon.success::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 35px;
    border: solid var(--success);
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
    margin-top: -6px;
}

.modal-icon.info {
    background-color: #e3f2fd;
    border: 3px solid var(--light-green);
}

.modal-icon.info::before {
    content: 'i';
    font-size: 40px;
    font-weight: bold;
    color: var(--light-green);
    font-style: italic;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 12px;
}

.modal-message {
    font-size: 16px;
    color: var(--text-gray);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn:hover {
    background: var(--light-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.2);
}

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

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式 */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .header {
        padding: 20px 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 24px 20px;
    }
    
    .modal-icon {
        font-size: 48px;
    }
}

