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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.logo h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.logo p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: #3498db;
    color: white;
}

.nav-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-text {
    flex: 1;
}

.nav-badge {
    background: #e74c3c;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    display: none;
}

.nav-badge.active {
    display: block;
}

/* 日期选择器样式 */
.date-picker-wrapper {
    display: flex;
    gap: 8px;
}

.date-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.date-input:focus {
    outline: none;
    border-color: #3498db;
}

.date-picker-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.date-picker-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 饲料价格选择器样式 */
.feed-selection-wrapper {
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
}

.feed-price-list {
    max-height: 400px;
    overflow-y: auto;
}

.feed-price-item {
    transition: all 0.3s;
}

.feed-price-item:hover {
    background: #e9ecef;
}

.agreement-price-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.agreement-price-input {
    transition: all 0.3s;
}

.agreement-price-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-add-feed {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-add-feed:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.feed-price-empty {
    transition: all 0.3s;
}

.feed-price-empty:hover {
    border-color: #667eea;
    color: #667eea;
}

/* 合同信息确认样式 */
.contract-info {
    margin-bottom: 16px;
}

.contract-info label {
    font-size: 13px;
}

.contract-info div[style*="grid"] {
    font-size: 14px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 250px;
}

/* 测试数据页面样式 */
.stats-container {
    margin: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stats-container h2 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

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

.data-container {
    margin: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-container h2 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.data-count {
    color: #666;
    margin-bottom: 15px;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

.action-bar {
    margin: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
    margin-left: 10px;
}
    padding: 30px;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
}

.user-role {
    font-size: 12px;
    color: #7f8c8d;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
}

.btn-logout {
    background: #e74c3c;
    color: white;
}

.btn-logout:hover {
    background: #c0392b;
}

.current-time {
    color: #7f8c8d;
    font-size: 14px;
}

/* 页面显示 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 按钮 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-refresh {
    background: white;
    color: #3498db;
    border: 1px solid #3498db;
}

.btn-refresh:hover {
    background: #3498db;
    color: white;
}

/* 页面 */
.page {
    display: none;
}

.page.active {
    display: block;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card.warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-card.warning .stat-icon {
    background: rgba(255, 255, 255, 0.2);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.stat-card.warning .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.stat-card.warning .stat-value {
    color: white;
}

.amount-positive {
    color: #27ae60;
}

.amount-negative {
    color: #e74c3c;
}

/* 区块 */
.section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    color: #2c3e50;
}

/* 快捷操作 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.quick-action-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.action-icon {
    font-size: 32px;
}

.action-text {
    font-size: 14px;
    font-weight: 500;
}

/* 表格 */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    font-size: 14px;
    color: #7f8c8d;
}

.summary-value {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

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

/* 空状态 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #95a5a6;
    font-size: 14px;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #f39c12;
    color: white;
}

.status-approved {
    background: #27ae60;
    color: white;
}

.status-rejected {
    background: #e74c3c;
    color: white;
}

.status-signed {
    background: #27ae60;
    color: white;
}

/* 操作按钮 */
.action-btn {
    padding: 4px 12px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-confirm {
    background: #27ae60;
    color: white;
}

.btn-view {
    background: #9b59b6;
    color: white;
}

/* 养殖户看板样式 */
.info-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #2c3e50;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item label {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
}

.info-item span {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 600;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-mini-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-mini-label {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.stat-mini-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-mini-value.stock {
    color: #3498db;
}

.stat-mini-value.loss {
    color: #e74c3c;
}

.stat-mini-value.feed {
    color: #27ae60;
}

.stat-mini-unit {
    font-size: 12px;
    color: #95a5a6;
}

.tabs {
    display: flex;
    background: white;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab-item {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    color: #7f8c8d;
    transition: all 0.3s;
    user-select: none;
}

.tab-item:hover {
    background: #f8f9fa;
}

.tab-item.active {
    background: #3498db;
    color: white;
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

.content-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.content-section h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #2c3e50;
    border-left: 4px solid #3498db;
    padding-left: 12px;
}

.stats-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-box-label {
    display: block;
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.stat-box-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.chart-placeholder {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    min-height: 200px;
}

.chart-container {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    justify-content: center;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 40px;
}

.chart-bar {
    width: 40px;
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
    min-height: 4px;
}

.chart-bar.feed-bar {
    background: linear-gradient(180deg, #27ae60 0%, #229954 100%);
}

.chart-label {
    font-size: 11px;
    color: #7f8c8d;
}

.chart-value {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    font-size: 14px;
}


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

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

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
    margin: auto; /* 确保在flexbox中居中 */
}

/* 大屏幕上的模态框宽度更大 */
@media (min-width: 1200px) {
    .modal-content {
        max-width: 700px;
    }
}

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

/* 模态框滚动条样式 */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    font-size: 18px;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #95a5a6;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #e74c3c;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group label.required::after {
    content: ' *';
    color: #e74c3c;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* 响应式 */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .modal-content {
        width: 95%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .modal-content {
        width: 98%;
        max-width: none;
        margin: 10px;
        max-height: 95vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 15px 20px;
    }
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 审批按钮样式 */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
    transition: all 0.3s;
}

.btn-view {
    background: #3498db;
    color: white;
}

.btn-view:hover {
    background: #2980b9;
}

.btn-edit {
    background: #f39c12;
    color: white;
}

.btn-edit:hover {
    background: #e67e22;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-approve {
    background: #27ae60;
    color: white;
}

.btn-approve:hover {
    background: #229954;
}

.btn-reject {
    background: #c0392b;
    color: white;
}

.btn-reject:hover {
    background: #a93226;
}

.btn-export {
    background: #16a085;
    color: white;
}

.btn-export:hover {
    background: #138d75;
}

/* 协议价标记样式 */
.agreement-tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* 协议价配置区域样式 */
.agreement-price-section {
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.agreement-price-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 16px;
}

.agreement-price-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.agreement-price-item:last-child {
    margin-bottom: 0;
}

.agreement-price-label {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
}

.agreement-price-input {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
}

.agreement-price-input:focus {
    outline: none;
    border-color: #667eea;
}

.agreement-price-unit {
    color: #7f8c8d;
    font-size: 14px;
}
