/* ==================== 全局变量 ==================== */
:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --info-color: #3B82F6;
    
    --bg-primary: #F9FAFB;
    --bg-secondary: #FFFFFF;
    --bg-dark: #1F2937;
    
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --sidebar-width: 250px;
    --header-height: 60px;
    
    --transition: all 0.3s ease;
}

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ==================== 表格样式 ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--bg-primary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.data-table tr:hover {
    background-color: var(--bg-primary);
}

.data-table .actions {
    display: flex;
    gap: 8px;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box input {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 250px;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-group select {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
}

/* ==================== 分页样式 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active,
.pagination button.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-info {
    color: #666;
    font-size: 14px;
    margin-right: 10px;
}

.pagination-ellipsis {
    color: #999;
    padding: 0 5px;
}

/* ==================== 导航栏 ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    background: var(--primary-color);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 18px;
}

.brand-text {
    font-size: 18px;
    font-weight: 600;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* ==================== 首页样式 ==================== */
.landing-page {
    padding-top: 70px;
}

.hero {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px 80px;
    background: linear-gradient(135deg, #F0F4FF 0%, #FDF4FF 100%);
}

.hero-content {
    max-width: 600px;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-illustration {
    flex-shrink: 0;
}

.dashboard-preview {
    width: 500px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.preview-header {
    padding: 12px 16px;
    background: #F3F4F6;
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #EF4444; }
.dot.yellow { background: #F59E0B; }
.dot.green { background: #10B981; }

.preview-content {
    display: flex;
    padding: 16px;
    gap: 16px;
    height: 300px;
}

.preview-sidebar {
    width: 60px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
}

.preview-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-card {
    height: 60px;
    background: linear-gradient(135deg, #E0E7FF 0%, #FCE7F3 100%);
    border-radius: var(--radius-md);
}

.preview-card.wide {
    flex: 1;
}

/* ==================== 功能区样式 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 50px;
    color: var(--text-primary);
}

.features-section {
    padding: 100px 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    padding: 40px 30px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== 模块区样式 ==================== */
.modules-section {
    padding: 100px 0;
    background: var(--bg-primary);
}

.modules-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.module-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.module-item:hover {
    background: var(--primary-color);
    color: white;
}

.module-icon {
    font-size: 20px;
}

/* ==================== 关于区样式 ==================== */
.about-section {
    padding: 100px 0;
    background: white;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 16px;
}

.about-features {
    list-style: none;
    margin-top: 30px;
}

.about-features li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: var(--text-secondary);
}

.about-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.about-stats {
    display: flex;
    justify-content: space-between;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
}

/* ==================== 页脚样式 ==================== */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 40px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-brand .logo {
    background: rgba(255,255,255,0.1);
}

.copyright {
    color: var(--text-light);
}

/* ==================== 登录页样式 ==================== */
.login-page {
    min-height: 100vh;
}

.login-container {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
    color: white;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand {
    margin-bottom: 60px;
}

.logo-large {
    font-size: 48px;
    font-weight: 700;
    background: rgba(255,255,255,0.2);
    padding: 20px 30px;
    border-radius: var(--radius-lg);
    display: inline-block;
}

.login-brand h1 {
    font-size: 32px;
    margin-top: 20px;
}

.login-brand p {
    opacity: 0.8;
    margin-top: 10px;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
}

.check-icon {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-primary);
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.login-box h2 {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.forgot-link {
    font-size: 14px;
    color: var(--primary-color);
}

.error-message {
    background: #FEE2E2;
    color: var(--danger-color);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== 系统页样式 ==================== */
.system-page {
    min-height: 100vh;
}

.system-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.sidebar-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.system-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.system-brand .logo {
    padding: 6px 10px;
    font-size: 14px;
}

.system-brand .brand-text {
    font-size: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 0 12px;
}

.header-search input {
    border: none;
    background: none;
    padding: 8px;
    width: 200px;
    outline: none;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.header-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.user-btn:hover {
    background: var(--bg-primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
}

.dropdown-icon {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    transition: var(--transition);
}

.user-dropdown a:hover {
    background: var(--bg-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ==================== 侧边栏样式 ==================== */
.system-container {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
    transition: var(--transition);
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-icon {
    font-size: 18px;
}

.nav-text {
    font-size: 14px;
}

/* ==================== 主内容区样式 ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    background: var(--bg-primary);
    min-height: calc(100vh - var(--header-height));
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ==================== 统计卡片样式 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.1); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.1); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.1); }

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== 仪表盘网格 ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-grid .card.wide {
    grid-column: span 2;
}

.finance-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.finance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.finance-item:last-child {
    border-bottom: none;
}

.finance-label {
    color: var(--text-secondary);
}

.finance-value {
    font-weight: 600;
    font-size: 18px;
}

.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.inventory-alert {
    padding: 20px;
    text-align: center;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--warning-color);
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.activity-icon.sales { background: rgba(16, 185, 129, 0.1); }
.activity-icon.purchase { background: rgba(59, 130, 246, 0.1); }

.activity-info {
    flex: 1;
}

.activity-desc {
    font-weight: 500;
}

.activity-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.empty-text {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 0;
}

/* ==================== 设置页面 ==================== */
.settings-grid {
    max-width: 600px;
}

/* ==================== 模态框样式 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.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;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

/* ==================== Toast消息 ==================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.warning { border-left: 4px solid var(--warning-color); }
.toast.info { border-left: 4px solid var(--info-color); }

/* ==================== 状态标签 ==================== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.draft { background: #F3F4F6; color: #374151; }
.status-badge.pending { background: #FEF3C7; color: #92400E; }
.status-badge.confirmed { background: #DBEAFE; color: #1E40AF; }
.status-badge.processing { background: #E0E7FF; color: #3730A3; }
.status-badge.shipped { background: #C7D2FE; color: #4338CA; }
.status-badge.delivered { background: #D1FAE5; color: #065F46; }
.status-badge.sent { background: #DBEAFE; color: #1E40AF; }
.status-badge.completed { background: #D1FAE5; color: #065F46; }
.status-badge.cancelled { background: #FEE2E2; color: #991B1B; }
.status-badge.active { background: #D1FAE5; color: #065F46; }
.status-badge.inactive { background: #FEE2E2; color: #991B1B; }
.status-badge.received { background: #E0E7FF; color: #3730A3; }
.status-badge.unpaid { background: #FEF3C7; color: #92400E; }
.status-badge.partial { background: #DBEAFE; color: #1E40AF; }
.status-badge.paid { background: #D1FAE5; color: #065F46; }
.status-badge.overdue { background: #FEE2E2; color: #991B1B; }
.status-badge.low { background: #FEE2E2; color: #991B1B; }
.status-badge.normal { background: #D1FAE5; color: #065F46; }

/* ==================== 加载动画 ==================== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }
    
    .hero-content {
        margin-bottom: 40px;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .dashboard-preview {
        width: 100%;
        max-width: 500px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        margin-top: 40px;
    }
    
    .login-left {
        display: none;
    }
    
    .login-right {
        padding: 20px;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid .card.wide {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .header-search {
        display: none;
    }
}

/* ==================== 可搜索选择器样式 ==================== */
.search-select-wrapper {
    position: relative;
}

.search-select-input {
    width: 100%;
    padding: 10px 14px;
    padding-right: 80px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.search-select-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-select-input.has-value {
    background-color: #F0F4FF;
}

.search-select-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
}

.search-select-clear,
.search-select-toggle {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.search-select-clear:hover,
.search-select-toggle:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

.search-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.search-select-dropdown.show {
    display: block;
}

.search-select-search {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: white;
}

.search-select-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.search-select-search input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-select-options {
    padding: 4px 0;
}

.search-select-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-select-option:hover {
    background: var(--bg-primary);
}

.search-select-option.selected {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.search-select-option-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.search-select-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.search-select-create {
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
    background: #F0F4FF;
}

.search-select-create-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.search-select-create-btn:hover {
    background: var(--primary-hover);
}

/* ==================== 产品选择弹窗样式 ==================== */
.product-selector-modal {
    width: 100%;
}

.modal:has(.product-selector-modal) .modal-content {
    max-width: 800px;
}

.product-selector-header {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.product-selector-search {
    flex: 1;
}

.product-selector-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.product-selector-search input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.product-selector-filter select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 150px;
    font-size: 14px;
}

.product-selector-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.product-selector-item {
    display: grid;
    grid-template-columns: 40px 1fr 100px 100px 80px;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.product-selector-item:last-child {
    border-bottom: none;
}

.product-selector-item:hover {
    background: var(--bg-primary);
}

.product-selector-item.selected {
    background: rgba(79, 70, 229, 0.1);
}

.product-selector-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    justify-self: center;
}

.product-selector-info {
    min-width: 0;
}

.product-selector-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-selector-spec {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.product-selector-stock {
    text-align: center;
}

.product-selector-price {
    text-align: right;
    font-weight: 500;
    color: var(--primary-color);
}

.product-selector-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.product-selector-selected-count {
    font-weight: 500;
    color: var(--primary-color);
}

.product-selector-pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.product-selector-pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.product-selector-pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.product-selector-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 快速创建客户弹窗样式 ==================== */
.quick-create-form {
    display: grid;
    gap: 12px;
}

.quick-create-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ==================== 打印样式 ==================== */
@media print {
    .sidebar,
    .system-header,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
}
