/* 微信小店订单管理系统 - 主样式表 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #07c160;
    --primary-dark: #06ad56;
    --primary-light: #e8f8ee;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --success: #27ae60;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e5e5e5;
    --bg-color: #f5f7fa;
    --sidebar-width: 240px;
    --header-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-color);
}

/* 登录页面 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #07c160 0%, #1aad19 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 12px;
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

/* 按钮样式 */
.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-primary);
}

.btn-small:hover {
    background: #f5f5f5;
}

.btn-small.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group .required {
    color: var(--danger);
}

.form-error {
    padding: 10px;
    background: #fee;
    color: var(--danger);
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* 布局 */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 16px;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.logout-link {
    font-size: 13px;
    color: var(--danger);
    text-decoration: none;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.content-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-actions select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 12px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-growth {
    font-size: 12px;
    margin-top: 4px;
}

.stat-growth .positive {
    color: var(--success);
}

.stat-growth .negative {
    color: var(--danger);
}

.stats-mini {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-mini-item {
    background: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-mini-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

.stat-mini-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* 内容区块 */
.dashboard-section,
.content-body {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.link-more {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .actions {
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-mono {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.text-price {
    color: var(--danger);
    font-weight: 500;
}

.product-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remark-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-muted {
    color: var(--text-muted);
}

.text-error {
    color: var(--danger);
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-10,
.status-pending {
    background: #fff3e0;
    color: #f39c12;
}

.status-12 {
    background: #f3e5f5;
    color: #9b59b6;
}

.status-13 {
    background: #e3f2fd;
    color: #3498db;
}

.status-20,
.status-ship {
    background: #ffebee;
    color: #e74c3c;
}

.status-21 {
    background: #fff3e0;
    color: #e67e22;
}

.status-30,
.status-deliver {
    background: #fff8e1;
    color: #f39c12;
}

.status-100,
.status-complete {
    background: #e8f5e9;
    color: #27ae60;
}

.status-200,
.status-250,
.status-cancel {
    background: #f5f5f5;
    color: #95a5a6;
}

.status-active {
    background: #e8f5e9;
    color: #27ae60;
}

.status-inactive {
    background: #f5f5f5;
    color: #95a5a6;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.status-pending { background: #f39c12; }
.status-dot.status-ship { background: #e74c3c; }
.status-dot.status-deliver { background: #f39c12; }
.status-dot.status-complete { background: #27ae60; }
.status-dot.status-cancel { background: #95a5a6; }

/* 订单状态网格 */
.status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-label {
    color: var(--text-secondary);
}

.status-count {
    font-weight: 600;
    color: var(--text-primary);
}

/* 筛选区域 */
.filter-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-item label {
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-item input,
.filter-item select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 150px;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 13px;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-buttons button {
    padding: 8px 12px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header h2,
    .nav-item span,
    .sidebar-footer .user-name {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        flex-direction: column;
    }

    .filter-item input,
    .filter-item select {
        width: 100%;
    }

    .product-cell {
        max-width: 120px;
    }

    .form-row {
        flex-direction: column;
    }
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* 工具类 */
.hidden {
    display: none !important;
}
