/* style.css - 三坪垂钓园管理系统样式 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
}

/* 导航栏 */
.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    gap: 4px;
}

.nav-item {
    padding: 8px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-700);
    font-size: 14px;
    transition: all 0.2s;
}

.nav-item:hover { background: var(--gray-100); color: var(--primary); }
.nav-item.active { background: var(--primary); color: white; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--gray-500);
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

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

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
}

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

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #b45309; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 150px;
}

.search-bar input:focus,
.search-bar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: 13px; color: var(--gray-500); }

/* 快捷操作 */
.quick-actions {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.quick-actions h3 { margin-bottom: 16px; font-size: 16px; }

.action-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* 表格 */
.table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.table tr:hover { background: var(--gray-50); }

.table .status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-tag.在场 { background: #dcfce7; color: #166534; }
.status-tag.已离场 { background: var(--gray-200); color: var(--gray-700); }

/* 分页 */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 模态框 */
.modal {
    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: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-lg { max-width: 800px; }

.modal-content h3 { margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 28px; margin-bottom: 8px; }
.login-header p { color: var(--gray-500); }
.login-tip { text-align: center; margin-top: 16px; font-size: 13px; color: var(--gray-500); }

/* 统计页 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stats-section {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.stats-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.chart-container {
    min-height: 300px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 20px 0;
    border-bottom: 2px solid var(--gray-200);
    overflow-x: auto;
}

.chart-bar {
    flex: 1;
    min-width: 30px;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.3s;
    cursor: pointer;
}

.chart-bar:hover { opacity: 0.8; }

.chart-bar .bar-value {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
}

.chart-bar .bar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--gray-500);
    white-space: nowrap;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; height: auto; padding: 12px; }
    .nav-menu { flex-wrap: wrap; }
    .container { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .search-bar { flex-direction: column; }
    .search-bar input, .search-bar select { width: 100%; }
}

/* ========== 商品管理 ========== */
.products-page { }

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

.header-actions { display: flex; gap: 8px; }

.low-stock-alert {
    background: #fff3cd;
    border: 1px solid #ffa500;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.low-stock-alert h4 { margin: 0 0 8px 0; color: #856404; }

.low-stock-tag {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px;
}

.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar input[type="text"], .toolbar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.toolbar input[type="text"] { min-width: 200px; }

.checkbox-label { display: flex; align-items: center; gap: 4px; font-size: 14px; }

.product-table .stock-empty { color: #e74c3c; font-weight: bold; }
.product-table .stock-low { color: #f39c12; font-weight: bold; }
.product-table .stock-normal { color: #27ae60; }

.low-stock-row { background: #fff3cd; }

.category-tag {
    background: #e8e8e8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

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

.status-success { background: #d4edda; color: #155724; }
.status-warning { background: #fff3cd; color: #856404; }
.status-danger { background: #f8d7da; color: #721c24; }

/* 销售出库 */
.sell-items {
    margin: 16px 0;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
}

.sell-items h4 { margin: 0 0 8px 0; }

.sell-item-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.sell-item-row select { flex: 2; }
.sell-item-row input { width: 80px; }
.sell-price-display { min-width: 80px; text-align: right; font-weight: bold; color: #e74c3c; }

.sell-total {
    text-align: right;
    font-size: 20px;
    padding: 12px 0;
    border-top: 2px solid #eee;
    margin-top: 8px;
}

.modal-lg { max-width: 700px; }

.recent-sales {
    margin-top: 24px;
}

.recent-sales h3 { margin-bottom: 12px; }

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

/* ========== 进鱼管理 ========== */
.fish-purchase-page { }

.species-stats {
    margin-bottom: 16px;
}

.species-stats h3 {
    margin-bottom: 12px;
    color: #2c3e50;
}

.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.species-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.species-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
}

.species-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    opacity: 0.95;
}

.species-cost {
    font-weight: bold;
    font-size: 15px;
}

.species-avg {
    font-size: 12px;
    opacity: 0.85;
}

.fish-table .note-cell {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-species {
    color: #999;
    font-style: italic;
    padding: 12px;
}

.fish-purchase-page .toolbar input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.fish-purchase-page .toolbar label {
    margin-right: 4px;
    color: #666;
}

/* ========== 投资建设 ========== */
.investment-page { }

.investment-page .highlight {
    background: linear-gradient(136deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.investment-page .highlight .stat-value,
.investment-page .highlight .stat-label {
    color: white;
}

.category-stats, .month-stats {
    margin-bottom: 20px;
}

.category-stats h3, .month-stats h3 {
    margin-bottom: 12px;
    color: #2c3e50;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.category-stat-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 14px;
    border-left: 4px solid #667eea;
}

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

.category-name {
    font-weight: bold;
    font-size: 15px;
}

.category-amount {
    color: #e74c3c;
    font-weight: bold;
    font-size: 16px;
}

.category-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.category-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s;
}

.category-detail {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

/* 按月统计 */
.month-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.month-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.month-label {
    width: 70px;
    font-size: 13px;
    color: #666;
    text-align: right;
}

.month-bar-track {
    flex: 1;
    height: 22px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.month-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #11998e, #38ef7d);
    border-radius: 4px;
    transition: width 0.3s;
}

.month-amount {
    width: 100px;
    font-size: 13px;
    font-weight: bold;
    color: #2c3e50;
}

/* 分类标签 */
.cat-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.cat-基建 { background: #e3f2fd; color: #1565c0; }
.cat-设备 { background: #f3e5f5; color: #7b1fa2; }
.cat-渔具 { background: #e8f5e9; color: #2e7d32; }
.cat-装修 { background: #fff3e0; color: #e65100; }
.cat-其他 { background: #eceff1; color: #546e7a; }

.invest-table .note-cell {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.investment-page .toolbar input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.investment-page .toolbar label {
    margin-right: 4px;
    color: #666;
}
