/* YJ 生产管理系统 - 深色科技风 v2.0 */
/* 暗色主题 | 霓虹蓝点缀 | 专业高效 */

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

/* ===== 主题切换平滑过渡 ===== */
.yjsm-theme-transitioning,
.yjsm-theme-transitioning *,
.yjsm-theme-transitioning *::before,
.yjsm-theme-transitioning *::after {
    transition: background-color 0.35s ease,
                color 0.35s ease,
                border-color 0.35s ease,
                box-shadow 0.35s ease,
                fill 0.35s ease,
                stroke 0.35s ease !important;
}

:root {
    /* ===== 深色科技风设计系统 ===== */

    /* 主色 - 霓虹蓝 */
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.12);
    --primary-glow: rgba(59, 130, 246, 0.25);
    --primary-text: #93bbfc;

    /* 语义色（深色适配） */
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);

    /* 深色灰阶 */
    --gray-50: #1e2233;
    --gray-100: #181c2b;
    --gray-200: #2a3042;
    --gray-300: #363d53;
    --gray-400: #4a5268;
    --gray-500: #6b7280;
    --gray-600: #94a3b8;
    --gray-700: #cbd5e1;
    --gray-800: #e2e8f0;
    --gray-900: #f1f5f9;

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* 布局 */
    --sidebar-w: 240px;
    --sidebar-collapsed: 56px;

    /* 圆角 */
    --radius: 10px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    /* 阴影 - 暗色模式发光 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);

    /* 表面颜色 */
    --surface: #11141e;
    --surface-raised: #181c2b;
    --surface-overlay: #1a1f30;

    /* 状态标签色 */
    --state-producing: #a78bfa;  /* 生产中-紫色 */
    --state-shipped: #22d3ee;    /* 已发货-青色 */

    /* 语义别名 */
    --gray-background: var(--surface);
    --gray-foreground: var(--gray-800);
    --gray-card: var(--surface-raised);
    --gray-border: var(--gray-200);
    --gray-muted: var(--gray-600);
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: #0b0e14;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 登录页 - 深色科技风 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 40%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 60%, rgba(34, 211, 238, 0.05) 0%, transparent 50%),
                linear-gradient(135deg, #0b0e14 0%, #0f1420 50%, #0b111e 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), rgba(34, 211, 238, 0.3), transparent);
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: var(--spacing-xl);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xl);
    position: relative;
}

.login-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-logo {
    font-size: 40px;
    margin-bottom: var(--spacing-sm);
}

.login-header h1 {
    font-size: 24px;
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-hover), #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    font-size: 14px;
    color: var(--gray-600);
}

/* 表单 */
.form-group {
    margin-bottom: var(--spacing-md);
}

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

.form-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    background: var(--gray-100);
    color: var(--gray-800);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder {
    color: var(--gray-500);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: var(--spacing-md);
    min-height: 20px;
}

/* 按钮 */
.btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:active {
    background: var(--primary-hover);
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--gray-700);
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { background: var(--gray-200); color: var(--gray-800); border-color: var(--gray-400); }

.btn-danger {
    padding: 8px 16px;
    font-size: 14px;
    color: white;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover { box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }

/* 底部链接 */
.login-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
}

.login-footer a {
    color: var(--primary-text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.login-footer a:hover { color: var(--primary-hover); text-decoration: underline; }

/* ========== 管理后台布局 ========== */
.yjsm-app {
    min-height: 100vh;
    background: #0b0e14;
}

.yjsm-layout {
    display: flex;
    padding-left: var(--sidebar-collapsed);
    min-height: 100vh;
}

/* ===== 侧边栏 - 自动缩回设计 ===== */
.yjsm-sidebar {
    width: var(--sidebar-collapsed);
    background: linear-gradient(180deg, #070a11 0%, #0a0e18 50%, #0d1220 100%);
    color: var(--gray-700);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: 2px 0 20px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.04);
}
.yjsm-sidebar:hover {
    width: var(--sidebar-w);
}

/* sidebar fixed 后，主内容区联动 */
.yjsm-sidebar:hover ~ .yjsm-main {
    padding-left: calc(var(--sidebar-w) - var(--sidebar-collapsed));
}

/* Logo 区域 */
.yjsm-sidebar__logo {
    padding: 20px 12px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
    position: relative;
}
/* 收起时 logo 区 */
.yjsm-sidebar:not(:hover) .yjsm-sidebar__logo {
    padding-left: 12px;
    padding-right: 0;
    gap: 0;
}
/* hover 展开时恢复 */
.yjsm-sidebar:hover .yjsm-sidebar__logo {
    padding-left: 12px;
    padding-right: 12px;
    gap: 10px;
}

.yjsm-sidebar__logo::before {
    content: "🏭";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 18px;
    flex-shrink: 0;
}

.yjsm-sidebar__logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, rgba(59,130,246,0.4), rgba(34,211,238,0.2), transparent);
}

/* 导航容器 */
.yjsm-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}
/* 收起时减少 nav padding */
.yjsm-sidebar:not(:hover) .yjsm-nav {
    padding-left: 0;
    padding-right: 0;
}

/* 导航项 */
.yjsm-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 44px;
    color: rgba(148, 163, 184, 0.6);
    text-decoration: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    position: relative;
    transition: all 0.2s ease;
    font-size: 14px;
}
/* 收起时导航项只显示图标 */
.yjsm-sidebar:not(:hover) .yjsm-nav__item {
    padding: 0;
    justify-content: center;
    width: var(--sidebar-collapsed);
    height: 44px;
    border-radius: 0;
}

/* 外部链接指示图标 */
.yjsm-nav__ext {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.yjsm-nav__item:hover .yjsm-nav__ext {
    opacity: 1;
}

.yjsm-nav__item:hover {
    color: var(--gray-700);
    background: rgba(59, 130, 246, 0.08);
}

/* 激活态 */
.yjsm-nav__item--active {
    color: var(--primary-hover);
    background: rgba(59, 130, 246, 0.12);
    border-left: 2px solid var(--primary);
    padding-left: 14px;
}
.yjsm-nav__item--active:hover {
    background: rgba(59, 130, 246, 0.18);
}
/* 收起时 active 项左边框适配 */
.yjsm-sidebar:not(:hover) .yjsm-nav__item--active {
    margin-left: 0;
    border-left-width: 2px;
    padding-left: 0;
    height: 44px;
}

/* 导航图标 */
.yjsm-nav__icon {
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    font-size: 16px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}
.yjsm-sidebar:not(:hover) .yjsm-nav__icon {
    padding-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--sidebar-collapsed);
    margin: 0;
}

/* 导航标签 */
.yjsm-nav__label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 收起时隐藏标签 */
.yjsm-sidebar:not(:hover) .yjsm-nav__label {
    display: none;
}
/* hover 展开时恢复 */
.yjsm-sidebar:hover .yjsm-nav__label {
    display: inline;
}

/* 滚动条美化 - 侧边栏专用 */
.yjsm-nav::-webkit-scrollbar {
    width: 4px;
}
.yjsm-nav::-webkit-scrollbar-track {
    background: transparent;
}
.yjsm-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
}
.yjsm-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.1);
}

/* 主内容区 */
.yjsm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: padding-left 0.2s ease;
}

/* 顶部栏 */
.yjsm-topbar {
    height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.yjsm-topbar__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.yjsm-topbar__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.yjsm-topbar__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.yjsm-topbar__user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}

.yjsm-topbar__user:hover {
    background: var(--gray-50);
}

/* 主内容区 */
.yjsm-content,
.content-area {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

/* 页面标题 */
.page-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--gray-900);
}

/* ========== 通用组件 ========== */

/* 表格 */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

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

th, td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

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

tr:hover { background: rgba(59, 130, 246, 0.04); }

/* 卡片 */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

/* 标签（状态） */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.tag-pending { background: var(--warning-light); color: var(--warning); }
.tag-accepted { background: var(--primary-light); color: var(--primary-hover); }
.tag-producing { background: rgba(139, 92, 246, 0.15); color: var(--state-producing); }
.tag-produced { background: var(--success-light); color: var(--success); }
.tag-shipped { background: rgba(34, 211, 238, 0.15); color: var(--state-shipped); }
.tag-completed { background: rgba(148, 163, 184, 0.15); color: var(--gray-600); }

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.search-bar input, .search-bar select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--gray-100);
    color: var(--gray-800);
}

.search-bar input::placeholder { color: var(--gray-500); }

.search-bar input[type="text"] { width: 200px; }
.search-bar select { width: 150px; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-lg);
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}
.pagination button:hover { background: var(--gray-200); color: var(--gray-800); }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 弹窗 */
.yjsm-modal-overlay,
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.yjsm-modal-overlay--show,
.modal-overlay--show {
    display: flex !important;
}

.modal-box {
    background: var(--surface-raised);
    border-radius: var(--radius-lg);
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--gray-900); }

.modal-close {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--gray-700); }

.modal-body { padding: var(--spacing-lg); }
.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* 提示信息 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--surface-raised);
    color: var(--gray-800);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    z-index: 2000;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.success { 
    background: var(--success-light); 
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--success); 
}
.toast.error { 
    background: var(--danger-light); 
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--danger); 
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--gray-600);
}

.loading::before {
    content: "";
    width: 20px; height: 20px;
    border: 2px solid var(--gray-400);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: var(--spacing-sm);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--gray-600);
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: var(--spacing-xs);
}

.action-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn.accept { background: rgba(59, 130, 246, 0.15); color: var(--primary-hover); }
.action-btn.accept:hover { background: rgba(59, 130, 246, 0.25); }
.action-btn.produce { background: rgba(139, 92, 246, 0.15); color: var(--state-producing); }
.action-btn.produce:hover { background: rgba(139, 92, 246, 0.25); }
.action-btn.complete { background: var(--success-light); color: var(--success); }
.action-btn.complete:hover { background: rgba(52, 211, 153, 0.25); }
.action-btn.ship { background: rgba(34, 211, 238, 0.15); color: var(--state-shipped); }
.action-btn.ship:hover { background: rgba(34, 211, 238, 0.25); }
.action-btn.edit { background: rgba(148, 163, 184, 0.12); color: var(--gray-600); }
.action-btn.edit:hover { background: rgba(148, 163, 184, 0.2); }
.action-btn.delete { background: var(--danger-light); color: var(--danger); }
.action-btn.delete:hover { background: rgba(248, 113, 113, 0.25); }
.action-btn.approve { background: var(--success-light); color: var(--success); }
.action-btn.approve:hover { background: rgba(52, 211, 153, 0.25); }
.action-btn.reject { background: var(--danger-light); color: var(--danger); }
.action-btn.reject:hover { background: rgba(248, 113, 113, 0.25); }
.action-btn.danger { background: var(--danger-light); color: var(--danger); }
.action-btn.danger:hover { background: rgba(248, 113, 113, 0.25); }
.action-btn.perm-btn { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.action-btn.perm-btn:hover { background: rgba(139, 92, 246, 0.25); }

/* 复选框 */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

input[type="checkbox"] {
    width: 16px; height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* 隐藏 */
.hidden { display: none !important; }

/* ===== Tab 切换 ===== */
.yjsm-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-lg);
}

.yjsm-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.yjsm-tab:hover { color: var(--gray-700); }

.yjsm-tab.active {
    color: var(--primary-hover);
    border-bottom-color: var(--primary);
}

/* ===== 面板 ===== */
.yjsm-panel { display: none; }
.yjsm-panel.active { display: block; }

.stat-panel { display: none; }
.stat-panel.active { display: block; }

/* ===== 页面容器 ===== */
.yjsm-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ===== 卡片 ===== */
.yjsm-card {
    background: var(--surface-raised);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== 工具栏 ===== */
.yjsm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255,255,255,0.01);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.yjsm-toolbar__info {
    font-size: 13px;
    color: var(--gray-600);
}

.yjsm-toolbar__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.yjsm-toolbar__actions .yjsm-btn {
    white-space: nowrap;
}

/* ===== 表格 ===== */
.yjsm-table-wrap {
    overflow-x: auto;
}

.yjsm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.yjsm-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.yjsm-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.yjsm-table tbody tr:hover td {
    background: rgba(59, 130, 246, 0.04);
}

/* ===== 分页 ===== */
.yjsm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
}

.yjsm-pagination .page-btn {
    padding: 5px 10px;
    font-size: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s;
    min-width: 30px;
    text-align: center;
}

.yjsm-pagination .page-btn:hover { border-color: var(--gray-400); color: var(--gray-700); }
.yjsm-pagination .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.yjsm-pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 表单输入 ===== */
.yjsm-input {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 32px;
    outline: none;
    transition: border-color 0.15s;
}

.yjsm-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ===== 徽章 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    background: var(--danger);
    border-radius: var(--radius-full);
}

/* ===== 加载态 ===== */
.loading { color: var(--gray-500); text-align: center; padding: var(--spacing-lg); }
.empty-state { color: var(--gray-500); text-align: center; padding: var(--spacing-lg); }

/* ===== 加载遮罩 ===== */
.yjsm-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius);
    backdrop-filter: blur(2px);
}
.yjsm-loading-overlay::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-400);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .yjsm-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 900;
        width: var(--sidebar-w) !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .yjsm-sidebar:hover {
        width: var(--sidebar-w) !important;
    }
    .yjsm-sidebar.yjsm-sidebar--open {
        transform: translateX(0);
    }
    /* 移动端禁用 hover 展开 */
    .yjsm-sidebar:not(:hover) .yjsm-sidebar__logo {
        padding-left: 12px;
        padding-right: 12px;
        gap: 10px;
    }
    .yjsm-sidebar:not(:hover) .yjsm-nav {
        padding-left: 12px;
        padding-right: 12px;
    }
    .yjsm-sidebar:not(:hover) .yjsm-nav__item {
        padding: 0 16px;
        justify-content: flex-start;
        width: auto;
        height: 44px;
        border-radius: var(--radius-sm);
    }
    .yjsm-sidebar:not(:hover) .yjsm-nav__icon {
        width: 24px;
        margin: 0;
        padding-left: 0;
    }
    .yjsm-sidebar:not(:hover) .yjsm-nav__label {
        display: inline;
    }
    .yjsm-sidebar:not(:hover) .yjsm-nav__item--active {
        padding-left: 14px;
        height: 44px;
    }
    .yjsm-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 899;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .yjsm-sidebar-overlay.yjsm-sidebar-overlay--show {
        opacity: 1;
        pointer-events: auto;
    }
    .yjsm-hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        background: transparent;
        border-radius: var(--radius-sm);
        cursor: pointer;
        color: var(--gray-600);
        font-size: 20px;
        flex-shrink: 0;
    }
    .yjsm-hamburger:hover {
        background: rgba(255,255,255,0.08);
    }
    .yjsm-content {
        padding: var(--spacing-md) !important;
    }
}
@media (min-width: 769px) {
    .yjsm-hamburger {
        display: none;
    }
}

/* 卡片网格加载态 */
.yjsm-card-grid.loading-active {
    position: relative;
    min-height: 120px;
}
.yjsm-card-grid.loading-active::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 5;
    border-radius: var(--radius);
}
.yjsm-card-grid.loading-active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid var(--gray-400);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: 6;
}

/* ===== 选中态高亮 ===== */
.order-card.selected {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: rgba(59, 130, 246, 0.08);
}
.order-card .card-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ===== 批次操作栏 ===== */
.batch-bar {
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform: translateY(0);
    opacity: 1;
}
.batch-bar.hidden {
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
}

/* ===== 筛选标签指示 ===== */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: 12px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-hover);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
}
.filter-chip:hover {
    background: rgba(59, 130, 246, 0.2);
}
.filter-chip .chip-close {
    font-size: 14px;
    line-height: 1;
    margin-left: 2px;
}
.filter-chip .chip-close:hover {
    color: var(--danger);
}

/* ===== 搜索输入框加载 ===== */
.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-input-wrap.loading::after {
    content: '';
    position: absolute;
    right: 8px;
    width: 14px;
    height: 14px;
    border: 2px solid var(--gray-400);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== 按钮加载态 ===== */
.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 分组视图头（已接单） ===== */
.order-group__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 14px;
    cursor: pointer;
    background: rgba(59, 130, 246, 0.04);
    transition: background 0.15s;
    font-size: 13px;
    user-select: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 2px;
}
.order-group__header:hover {
    background: rgba(59, 130, 246, 0.08);
}
.order-group__checkbox {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary);
}
.order-group__batch {
    font-weight: 600;
    color: var(--primary-text);
    min-width: 100px;
}
.order-group__mapping {
    flex: 1;
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.order-group__stat {
    text-align: right;
    min-width: 50px;
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
}
.btn-primary.loading,
.btn-secondary.loading {
    position: relative;
    color: transparent;
}
.btn-primary.loading::after,
.btn-secondary.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===================================================
   亮色主题 - 通过 [data-theme="light"] 属性切换
   设置 <html data-theme="light"> 即可启用
   =================================================== */
[data-theme="light"] {
    /* 主色（无需变） */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --primary-glow: rgba(59, 130, 246, 0.15);
    --primary-text: #2563eb;

    /* 语义色（亮色模式） */
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fef2f2;

    /* 亮色灰阶 */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;

    /* 亮色阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px -5px rgba(0,0,0,0.13);

    /* 表面颜色 */
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-overlay: #ffffff;

    /* 状态标签色（亮色） */
    --state-producing: #7c3aed;
    --state-shipped: #0891b2;
}

[data-theme="light"] body {
    background: #f0f2f5;
    color: var(--gray-800);
}

/* 亮色 - 滚动条 */
[data-theme="light"] ::-webkit-scrollbar-track { background: transparent; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--gray-300); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* 亮色 - 登录页 */
[data-theme="light"] .login-page {
    background: linear-gradient(135deg, #e8edf5 0%, #f0f4fa 50%, #eaf0f7 100%);
}
[data-theme="light"] .login-page::before {
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.25), rgba(59,130,246,0.15), transparent);
}
[data-theme="light"] .login-box {
    background: white;
    border-color: var(--gray-200);
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}
[data-theme="light"] .login-box::before {
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* 亮色 - 侧边栏 */
[data-theme="light"] .yjsm-sidebar {
    background: white;
    border-right-color: var(--gray-200);
    box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}
[data-theme="light"] .yjsm-sidebar__logo {
    border-bottom-color: var(--gray-200);
    color: var(--gray-900);
}
[data-theme="light"] .yjsm-sidebar__logo::after {
    background: linear-gradient(90deg, rgba(59,130,246,0.3), rgba(59,130,246,0.1), transparent);
}
[data-theme="light"] .yjsm-nav__item {
    color: var(--gray-500);
}
[data-theme="light"] .yjsm-nav__item:hover {
    color: var(--gray-700);
    background: rgba(59,130,246,0.06);
}
[data-theme="light"] .yjsm-nav__item--active {
    color: var(--primary);
    background: rgba(59,130,246,0.08);
}

/* 亮色 - 顶部栏 */
[data-theme="light"] .yjsm-topbar {
    background: white;
    border-bottom-color: var(--gray-200);
}
[data-theme="light"] .yjsm-topbar__user:hover {
    background: var(--gray-50);
}

/* 亮色 - 主区域 */
[data-theme="light"] .yjsm-app {
    background: #f0f2f5;
}
[data-theme="light"] .yjsm-content,
[data-theme="light"] .content-area {
    background: #f0f2f5;
}

/* 亮色 - 表格 */
[data-theme="light"] .table-container {
    background: white;
}
[data-theme="light"] th {
    background: #f9fafb;
    color: #374151;
}
[data-theme="light"] tr:hover {
    background: #f9fafb;
}

/* 亮色 - 卡片 */
[data-theme="light"] .card {
    background: white;
}

/* 亮色 - 弹窗 */
[data-theme="light"] .modal-box {
    background: white;
}
[data-theme="light"] .modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* 亮色 - Toast */
[data-theme="light"] .toast {
    background: white;
}

/* 亮色 - 搜索栏 */
[data-theme="light"] .search-bar input,
[data-theme="light"] .search-bar select {
    background: white;
}
[data-theme="light"] .yjsm-toolbar {
    background: #f9fafb;
}

/* 亮色 - 分页 */
[data-theme="light"] .pagination button {
    background: white;
}

/* 亮色 - 表单 */
[data-theme="light"] .form-group input {
    background: white;
}

/* 亮色 - 订单卡片 */
[data-theme="light"] .order-card {
    background: white;
}
[data-theme="light"] .order-card:hover {
    border-color: var(--gray-300);
}
[data-theme="light"] .yjsm-card {
    background: white;
}
[data-theme="light"] .yjsm-stats__card {
    background: white;
}

/* 亮色 - 统计卡片 */
[data-theme="light"] .stat-card {
    background: white;
}

/* 亮色 - 图表卡片 */
[data-theme="light"] .chart-card {
    background: white;
}

/* 亮色 - 区块 / 列表 */
[data-theme="light"] .section-card {
    background: white;
}
[data-theme="light"] .order-list li:hover {
    background: #f9fafb;
}

/* 亮色 - 图片预览 */
[data-theme="light"] .image-preview-container {
    background: white;
}
[data-theme="light"] .image-preview-header {
    background: #f9fafb;
}
[data-theme="light"] .image-preview-content {
    background: #e5e7eb;
}

/* 亮色 - 选中态高亮 */
[data-theme="light"] .order-card.selected {
    background: #eff6ff;
}

/* 亮色 - 批量操作栏 */
[data-theme="light"] .yjsm-batch {
    background: #eff6ff;
    border-bottom-color: #bfdbfe;
}

/* 亮色 - 分组头 */
[data-theme="light"] .order-group__header {
    background: #f9fafb;
}
[data-theme="light"] .order-group__header:hover {
    background: #f3f4f6;
}

/* 亮色 - 弹窗覆盖 */
[data-theme="light"] .yjsm-modal {
    background: white;
}

/* 亮色 - 加载遮罩 */
[data-theme="light"] .yjsm-loading-overlay {
    background: rgba(255,255,255,0.7);
}

/* 亮色 - 产品卡片 */
[data-theme="light"] #productSelectCardList .product-card {
    background: white;
}
[data-theme="light"] #productSelectCardList .product-card__table th {
    background: #f9fafb;
}

/* 亮色 - 弹窗 body 背景覆盖 */
[data-theme="light"] .yjsm-modal__body,
[data-theme="light"] .modal-body {
    background: white;
}

/* 亮色 - 空状态区内联背景覆盖 */
[data-theme="light"] .yjsm-empty,
[data-theme="light"] .empty-state {
    background: transparent;
}

/* 亮色 - 导入区域 */
[data-theme="light"] .yjsm-upload {
    background: #f9fafb;
}

/* 亮色 - 产品选择弹窗 */
[data-theme="light"] .product-select-craft-tab {
    background: white;
}

/* ===== 主题切换按钮 ===== */
.yjsm-theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-300);
    background: var(--gray-50);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--gray-600);
    transition: all 0.2s;
    flex-shrink: 0;
}

.yjsm-theme-toggle:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

/* ===== yjsm 模态弹窗别名（兼容页面内联 .yjsm-modal 类名） ===== */
.yjsm-modal { background: var(--surface-raised); border-radius: var(--radius-lg); width: 500px; max-width: 90%; max-height: 90vh; overflow-y: auto; border: 1px solid var(--gray-200); box-shadow: var(--shadow-xl); }
.yjsm-modal--iframe { width: 85vw; max-width: 1200px; height: 85vh; display: flex; flex-direction: column; }
.yjsm-modal__header { padding: var(--spacing-lg); border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.yjsm-modal__title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.yjsm-modal__close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); cursor: pointer; color: var(--gray-500); transition: all 0.15s; }
.yjsm-modal__close:hover { background: rgba(255,255,255,0.08); color: var(--gray-700); }
.yjsm-modal__body { padding: var(--spacing-lg); }
.yjsm-modal__footer { padding: var(--spacing-lg); border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: var(--spacing-md); }

/* ===== 图片预览弹窗 (orders 页面) ===== */
.image-preview-container {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: 450px;
    height: 500px;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--surface-raised);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
}
.image-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.image-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}
.image-preview-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}
.image-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.12s;
    line-height: 1;
}
.image-btn:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
}
.image-zoom-display {
    min-width: 44px;
    text-align: center;
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}
.image-preview-close {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-500);
    font-size: 16px;
    transition: all 0.15s;
}
.image-preview-close:hover {
    background: rgba(255,255,255,0.08);
    color: var(--gray-700);
}
.image-preview-content {
    width: 450px;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
    background: var(--gray-900);
    position: relative;
}
.image-preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}
[data-theme="light"] .yjsm-modal { background: white; }
[data-theme="light"] .yjsm-modal__close:hover { background: var(--gray-100); color: var(--gray-800); }

/* ===== db-btn 按钮体系 ===== */
.db-btn {
    padding: 6px 14px; font-size: 13px; font-weight: 500;
    border-radius: var(--radius-sm); border: 1px solid var(--gray-300);
    background: var(--gray-100); color: var(--gray-700);
    cursor: pointer; transition: all 0.2s;
    white-space: nowrap; display: inline-flex; align-items: center;
    gap: 4px; flex-shrink: 0;
}
.db-btn:hover { background: var(--gray-200); border-color: var(--gray-400); }

.db-btn--primary { color: white; background: var(--primary); border-color: var(--primary); }
.db-btn--primary:hover { background: var(--primary-hover); box-shadow: 0 2px 8px var(--primary-glow); }

.db-btn--secondary { background: var(--gray-200); color: var(--gray-600); }
.db-btn--secondary:hover { background: var(--gray-300); color: var(--gray-700); }

.db-btn--reset { background: transparent; color: var(--gray-600); }
.db-btn--reset:hover { background: var(--gray-200); color: var(--gray-700); }

.db-btn--outline { background: transparent; color: var(--gray-600); }
.db-btn--outline:hover { background: var(--gray-100); border-color: var(--gray-400); }

/* 筛选栏内的按钮 */
.db-filter .db-btn { padding: 6px 14px; }

/* ===== yjsm 按钮别名 ===== */
.yjsm-btn--primary { padding: 8px 16px; font-size: 14px; font-weight: 600; color: white; background: linear-gradient(135deg, var(--primary), #2563eb); border: none; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.yjsm-btn--primary:hover { background: linear-gradient(135deg, var(--primary-hover), var(--primary)); transform: translateY(-1px); box-shadow: 0 4px 15px var(--primary-glow); }
.yjsm-btn--secondary { padding: 8px 16px; font-size: 14px; color: var(--gray-700); background: var(--gray-100); border: 1px solid var(--gray-300); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.yjsm-btn--secondary:hover { background: var(--gray-200); color: var(--gray-800); }
[data-theme="light"] .yjsm-btn--secondary { background: white; }

/* ===== yjsm 表单别名 ===== */
.yjsm-form__group { margin-bottom: var(--spacing-md); }
.yjsm-form__label { display: block; font-size: 14px; font-weight: 500; color: var(--gray-700); margin-bottom: var(--spacing-xs); }
.yjsm-form__input { width: 100%; padding: 10px 14px; font-size: 14px; background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--gray-300); border-radius: var(--radius-sm); outline: none; transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box; }
.yjsm-form__input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.yjsm-form__select { width: 100%; padding: 10px 14px; font-size: 14px; background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--gray-300); border-radius: var(--radius-sm); outline: none; transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box; }
.yjsm-form__select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.yjsm-form__error { color: var(--danger); font-size: 13px; margin-bottom: var(--spacing-md); min-height: 20px; }
.yjsm-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); }
@media (max-width: 600px) { .yjsm-form__row { grid-template-columns: 1fr; } }
.required { color: var(--danger); }
[data-theme="light"] .yjsm-form__input { background: white; }
[data-theme="light"] .yjsm-form__select { background: white; }

/* ===== yjsm 亮色适配别名 ===== */
[data-theme="light"] .yjsm-sidebar { background: white; border-right-color: var(--gray-200); box-shadow: 2px 0 12px rgba(0,0,0,0.04); }
[data-theme="light"] .yjsm-sidebar__logo { border-bottom-color: var(--gray-200); color: var(--gray-900); }
[data-theme="light"] .yjsm-nav__item { color: var(--gray-500); }
[data-theme="light"] .yjsm-nav__item:hover { color: var(--gray-700); background: rgba(59,130,246,0.06); }
[data-theme="light"] .yjsm-nav__item--active { color: var(--primary); background: rgba(59,130,246,0.08); }
[data-theme="light"] .yjsm-topbar { background: white; border-bottom-color: var(--gray-200); }
[data-theme="light"] .yjsm-topbar__user:hover { background: var(--gray-50); }
[data-theme="light"] .yjsm-app { background: #f0f2f5; }
[data-theme="light"] .yjsm-content { background: #f0f2f5; }
[data-theme="light"] body { background: #f0f2f5; }

/* ===== 分页（db-pagination / db-page-btn 别名） ===== */
.db-pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--gray-200); flex-wrap: wrap; gap: 8px; }
.db-pagination__info { font-size: 13px; color: var(--gray-600); }
.db-pagination__controls { display: flex; gap: 4px; align-items: center; }
.db-page-btn { padding: 5px 10px; font-size: 13px; border: 1px solid var(--gray-300); background: var(--gray-50); color: var(--gray-700); border-radius: var(--radius-sm); cursor: pointer; min-width: 32px; text-align: center; }
.db-page-btn:hover { background: var(--gray-200); border-color: var(--gray-400); }
.db-page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.db-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== db 组件别名 ===== */
.db-table-wrap { overflow-x: auto; padding: 0; }
.db-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.db-table th { padding: 10px 12px; text-align: left; font-weight: 600; color: var(--gray-700); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
.db-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-200); color: var(--gray-700); }
.db-table tbody tr:hover td { background: rgba(59,130,246,0.04); }

.db-tabs { display: flex; align-items: center; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--gray-200); background: var(--surface); overflow-x: auto; position: sticky; top: 60px; z-index: 60; }
.db-tab { padding: 10px 14px; font-size: 13px; color: var(--gray-600); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.2s; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.db-tab:hover { color: var(--gray-700); background: rgba(255,255,255,0.03); }
.db-tab.active { color: var(--primary-hover); border-bottom-color: var(--primary); font-weight: 500; }
.db-panel { display: none; }
.db-panel.active { display: block; }

.db-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 20px; background: rgba(255,255,255,0.01); border-bottom: 1px solid var(--gray-200); }
.db-filter input, .db-filter select { padding: 6px 10px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font-size: 13px; background: var(--gray-100); color: var(--gray-800); min-height: 32px; outline: none; transition: border-color 0.15s; }
.db-filter input:focus, .db-filter select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }

.db-status-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.db-status-btn { padding: 4px 12px; font-size: 12px; border-radius: var(--radius-full); border: 1px solid var(--gray-300); background: transparent; color: var(--gray-600); cursor: pointer; transition: all 0.15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.db-status-btn:hover { border-color: var(--gray-400); color: var(--gray-700); }
.db-status-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; font-weight: 600; border-radius: var(--radius-full); background: rgba(255,255,255,0.15); }

.db-batch-bar { display: flex; align-items: center; gap: 8px; padding: 8px 20px; background: rgba(59,130,246,0.06); border-bottom: 1px solid rgba(59,130,246,0.15); flex-wrap: wrap; font-size: 13px; }
.db-batch-bar__info { color: var(--gray-600); }
.db-batch-bar__info strong { color: var(--primary); }

/* ===== 操作按钮组（action-btns 别名） ===== */
.action-btns { display: flex; gap: 3px; }
.action-btns button { padding: 3px 8px; font-size: 11px; border: none; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; }
.action-btns .edit-btn { background: rgba(148,163,184,0.12); color: var(--gray-600); }
.action-btns .edit-btn:hover { background: rgba(148,163,184,0.2); }
.action-btns .delete-btn { background: rgba(248,113,113,0.15); color: #f87171; }
.action-btns .delete-btn:hover { background: rgba(248,113,113,0.25); }
.action-btns .recharge-btn { background: rgba(52,211,153,0.15); color: var(--success); }
.action-btns .recharge-btn:hover { background: rgba(52,211,153,0.25); }
.action-btns .deduct-btn { background: rgba(251,191,36,0.15); color: var(--warning); }
.action-btns .deduct-btn:hover { background: rgba(251,191,36,0.25); }

/* ===== db-stat 概览卡片 ===== */
.db-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 1200px) { .db-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .db-stats { grid-template-columns: repeat(2, 1fr); } }
.db-stat { background: var(--surface); border-radius: var(--radius-md); padding: 16px 18px; border: 1px solid var(--gray-200); transition: transform 0.2s, box-shadow 0.2s; position: relative; overflow: hidden; }
.db-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.db-stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; border-radius: var(--radius-md) var(--radius-md) 0 0; opacity: 0.7; }
.db-stat--blue::before { background: #3b82f6; }
.db-stat--orange::before { background: #f59e0b; }
.db-stat--green::before { background: #34d399; }
.db-stat--yellow::before { background: #fbbf24; }
.db-stat--red::before { background: #ef4444; }
.db-stat--purple::before { background: #8b5cf6; }
.db-stat__label { font-size: 12px; color: var(--gray-600); margin-bottom: 6px; }
.db-stat__value { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.db-stat__sub { font-size: 11px; color: var(--gray-500); margin-top: 4px; }

/* ===== 状态标签（status-tag） ===== */
.status-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; font-size: 11px; font-weight: 500; border-radius: var(--radius-full); white-space: nowrap; }
.status-tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.status-tag--pending { background: rgba(251,191,36,0.12); color: #fbbf24; }
.status-tag--pending::before { background: #fbbf24; }
.status-tag--accepted { background: rgba(59,130,246,0.12); color: #60a5fa; }
.status-tag--accepted::before { background: #60a5fa; }
.status-tag--producing { background: rgba(139,92,246,0.12); color: #a78bfa; }
.status-tag--producing::before { background: #a78bfa; }
.status-tag--produced { background: rgba(52,211,153,0.12); color: #34d399; }
.status-tag--produced::before { background: #34d399; }
.status-tag--shipped { background: rgba(34,211,238,0.12); color: #22d3ee; }
.status-tag--shipped::before { background: #22d3ee; }
.status-tag--completed { background: rgba(148,163,184,0.12); color: #94a3b8; }
.status-tag--completed::before { background: #94a3b8; }

/* 账号状态 */
.status-tag.active { background: var(--success-light); color: var(--success); }
.status-tag.active::before { background: var(--success); }
.status-tag.inactive { background: var(--danger-light); color: var(--danger); }
.status-tag.inactive::before { background: var(--danger); }

/* 角色标签（账号管理） */
.role-tag {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}
.role-tag.admin, .role-tag.super_admin, .role-tag.超级管理员 { background: rgba(59,130,246,0.15); color: var(--primary-text); }
.role-tag.operator { background: rgba(52,211,153,0.15); color: var(--success); }
.role-tag.finance { background: rgba(251,191,36,0.15); color: var(--warning); }
.role-tag.normal { background: rgba(148,163,184,0.15); color: var(--gray-600); }

/* ===== 操作标签（op-tag / action-tag） ===== */
.op-tag, .action-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 500; }
.op-tag--accept, .action-tag--accept { background: rgba(52,211,153,0.15); color: var(--success); }
.op-tag--produce, .action-tag--produce { background: rgba(59,130,246,0.15); color: var(--primary-text); }
.op-tag--ship, .action-tag--ship { background: rgba(251,191,36,0.15); color: var(--warning); }
.op-tag--complete, .action-tag--complete { background: rgba(139,92,246,0.15); color: #a78bfa; }
.op-tag--delete, .action-tag--delete { background: rgba(248,113,113,0.15); color: var(--danger); }

/* ===== 产品卡片网格 ===== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.product-card { background: var(--surface-raised); border-radius: var(--radius-md); border: 1px solid var(--gray-200); overflow: hidden; transition: all 0.2s; }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-glow); }
.product-card__thumb { aspect-ratio: 1 / 1; width: 100%; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--gray-200); position: relative; }
.product-card__actions-overlay { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 4px; opacity: 0; transform: translateX(4px); transition: all 0.2s; }
.product-card:hover .product-card__actions-overlay { opacity: 1; transform: translateX(0); }
.product-card__icon-btn { width: 28px; height: 28px; background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,0.15); color: white; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.product-card__icon-btn:hover { background: rgba(59,130,246,0.9); transform: scale(1.08); }
.product-card__body { padding: 12px; }
.product-card__name { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.product-card__price { font-size: 15px; font-weight: 700; color: var(--success); }
.product-card__icon-btn--danger:hover { background: rgba(239,68,68,0.9); }

/* ===== 订单卡片网格 ===== */
.order-grid { display: flex; flex-direction: column; gap: 8px; padding: 12px 20px; }
.order-card { background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 14px 16px; display: grid; grid-template-columns: 32px 120px 1fr 1fr 1fr 132px; gap: 16px; align-items: center; transition: all 0.2s; }
.order-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }
.order-card__row { display: grid; grid-template-columns: 60px 1fr; gap: 8px; align-items: baseline; font-size: 13px; }
.order-card__row-label { color: var(--gray-500); font-size: 12px; text-align: right; white-space: nowrap; }
.order-card__row-value { color: var(--gray-800); font-weight: 500; }
.order-card__row-value--primary { color: var(--primary-hover); font-weight: 600; cursor: pointer; }
.order-card__row-value--code { font-family: 'SF Mono', Menlo, Consolas, monospace; color: var(--primary-hover); font-weight: 600; }

/* ===== 角色卡片网格 ===== */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--spacing-md); }
.role-card { background: var(--surface-raised); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: var(--spacing-md); transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s; }
.role-card:hover { box-shadow: var(--shadow-md); border-color: rgba(59,130,246,0.3); transform: translateY(-2px); }
.role-card__header { display: flex; align-items: flex-start; gap: var(--spacing-md); margin-bottom: var(--spacing-md); }
.role-card__icon { width: 42px; height: 42px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.role-card__name { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.role-card__stat-value { display: block; font-size: 18px; font-weight: 700; color: var(--gray-800); }
.role-card__stat-label { display: block; font-size: 11px; color: var(--gray-500); }

/* ===== 导航分组 ===== */
.yjsm-nav__group { margin-bottom: 14px; }
.yjsm-nav__group-title { font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.6px; padding: 6px 16px 4px; }
.yjsm-sidebar:not(:hover) .yjsm-nav__group-title { font-size: 0; padding: 4px 0; text-align: center; }
.yjsm-sidebar:not(:hover) .yjsm-nav__group-title::before { content: "·"; font-size: 16px; color: var(--gray-500); }

