/* public/css/app.css - Shopee 跨境电商综合工作台现代化极速样式系统 (纯原生零外部依赖版) */

/* -------------------------------------------------------------
   1. CSS 变量与设计令牌 (Design Tokens)
   ------------------------------------------------------------- */
:root {
    --primary: #ee4d2d;
    --primary-hover: #d73211;
    --primary-active: #b92508;
    --primary-light: #fff5f2;
    --primary-border: #ffd8cc;
    --primary-glow: rgba(238, 77, 45, 0.35);

    --dark-900: #0f172a;
    --dark-800: #1e293b;
    --dark-700: #334155;
    --dark-600: #475569;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #065f46;
    --success: #10b981;
    --success-hover: #059669;

    --info-bg: #eff6ff;
    --info-border: #bfdbfe;
    --info-text: #1e40af;
    --info: #2563eb;
    --info-hover: #1d4ed8;

    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;
    --warning: #f59e0b;

    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;
    --danger: #ef4444;

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* -------------------------------------------------------------
   2. 基础重置与全局排版 (Reset & Typography)
   ------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* 滚动条定制 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* -------------------------------------------------------------
   3. 核心布局与 Utility CSS 工具库 (自包含无需外部 Tailwind)
   ------------------------------------------------------------- */
.hidden { display: none !important; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.items-stretch { align-items: stretch; }

.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
    .md\:justify-between { justify-content: space-between; }
    .md\:items-center { align-items: center; }
    .md\:mt-0 { margin-top: 0; }
}

.w-full { width: 100%; }
.h-full { height: 100%; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-14 { width: 3.5rem; }
.max-w-sm { max-width: 24rem; }
.min-w-0 { min-width: 0; }
.min-h-64 { min-height: 16rem; }
.max-h-36 { max-height: 9rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pb-1\.5 { padding-bottom: 0.375rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pr-1 { padding-right: 0.25rem; }

.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mr-2 { margin-right: 0.5rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-4 { margin-left: 1rem; }
.ml-5 { margin-left: 1.25rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-2\.5 { margin-top: 0.625rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-2\.5 { margin-bottom: 0.625rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.space-y-0\.5 > * + * { margin-top: 0.125rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-5xl { font-size: 3rem; line-height: 1; }

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-extrabold { font-weight: 800; }
.font-mono { font-family: var(--font-mono); }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-white { color: #ffffff; }
.text-gray-300 { color: var(--gray-300); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-800 { color: var(--gray-800); }
.text-red-500 { color: var(--primary); }
.text-red-600 { color: var(--primary-hover); }
.text-blue-600 { color: var(--info); }
.text-green-400 { color: #4ade80; }
.text-green-600 { color: var(--success); }

.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-800 { background-color: var(--gray-800); }
.bg-red-50 { background-color: var(--primary-light); }
.bg-blue-50 { background-color: var(--info-bg); }
.bg-green-50 { background-color: var(--success-bg); }

.border { border: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }
.border-t { border-top: 1px solid var(--gray-200); }
.border-gray-200 { border-color: var(--gray-200); }
.border-gray-300 { border-color: var(--gray-300); }
.border-red-100 { border-color: var(--primary-border); }
.border-red-300 { border-color: #fca5a5; }
.border-blue-100 { border-color: var(--info-border); }

.rounded { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-md); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-disc { list-style-type: disc; }
.select-all { user-select: all; }
.cursor-pointer { cursor: pointer; }
.leading-relaxed { line-height: 1.625; }
.leading-none { line-height: 1; }
.object-cover { object-fit: cover; }
.block { display: block; }
.border-collapse { border-collapse: collapse; }

/* -------------------------------------------------------------
   4. 顶部导航栏 (Navbar)
   ------------------------------------------------------------- */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-xs);
}

.nav-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--dark-900);
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.brand-logo:hover { opacity: 0.9; }
.brand-logo span { color: var(--primary); }

.brand-badge {
    font-size: 0.65rem;
    background: linear-gradient(135deg, var(--primary-light), #ffe8e0);
    color: var(--primary);
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-weight: 800;
    border: 1px solid var(--primary-border);
    letter-spacing: 0.02em;
}

.nav-tabs {
    display: flex;
    gap: 0.25rem;
    height: 100%;
    overflow-x: auto;
}

.nav-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-500);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 60px;
    white-space: nowrap;
    outline: none;
}

.nav-tab-btn:hover {
    color: var(--dark-900);
    background: rgba(0, 0, 0, 0.02);
}

.nav-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-light);
    font-weight: 700;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* -------------------------------------------------------------
   5. 主工作区与页面容器
   ------------------------------------------------------------- */
.main-wrapper {
    max-width: 1480px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    flex: 1;
    width: 100%;
}

.tab-view-content {
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------
   6. 按钮系统 (Button System)
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1.3;
    user-select: none;
    outline: none;
}

.btn:active { transform: scale(0.98); }

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

.btn-outline {
    background: #ffffff;
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--dark-900);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
    border-color: var(--success);
}
.btn-success:hover { background: var(--success-hover); }

.btn-info {
    background: var(--info);
    color: #ffffff;
    border-color: var(--info);
}
.btn-info:hover { background: var(--info-hover); }

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn:disabled, .btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* -------------------------------------------------------------
   7. 子选项卡 (Sub Tabs - e.g. 订单状态切换)
   ------------------------------------------------------------- */
.sub-tabs-bar {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.sub-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    outline: none;
}

.sub-tab-btn:hover {
    background: #ffffff;
    color: var(--dark-900);
    border-color: var(--gray-300);
}

.sub-tab-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-border);
    font-weight: 700;
}

/* -------------------------------------------------------------
   8. 通用卡片组件 (Cards)
   ------------------------------------------------------------- */
.card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark-900);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* -------------------------------------------------------------
   9. AI 智能铺货工作台 (AI Studio)
   ------------------------------------------------------------- */
.ai-studio-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 1.25rem;
    height: calc(100vh - 110px);
    min-height: 680px;
}

@media (max-width: 1080px) {
    .ai-studio-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: unset;
    }
}

.chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--gray-50);
}

.chat-bubble {
    max-width: 88%;
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.65;
    word-break: break-word;
    box-shadow: var(--shadow-xs);
}

.chat-bubble.ai {
    align-self: flex-start;
    background: #ffffff;
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 2px;
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary) 0%, #ff5722 100%);
    color: #ffffff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.chat-bubble code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.chat-bubble.user code {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* AI 思考指示胶囊 */
.ai-step-indicator {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    border: 1px solid var(--gray-200);
}

.step-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--gray-600);
    font-weight: 600;
}
.step-item.done { color: var(--success); }

/* 聊天气泡内嵌商品快照卡片 */
.chat-product-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-top: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    box-shadow: var(--shadow-xs);
}

.chat-product-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    flex-shrink: 0;
}

.chat-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.chat-quick-presets {
    padding: 0.6rem 0.85rem;
    background: #ffffff;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    white-space: nowrap;
}

.preset-tag {
    font-size: 0.76rem;
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    border: 1px solid var(--gray-200);
    transition: all 0.15s ease;
    font-weight: 600;
    user-select: none;
}

.preset-tag:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-border);
    transform: translateY(-1px);
}

.chat-input-area {
    padding: 0.85rem;
    background: #ffffff;
    border-top: 1px solid var(--gray-200);
}

.chat-textarea {
    width: 100%;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
    font-family: inherit;
    resize: none;
    height: 68px;
    outline: none;
    transition: all 0.15s ease;
    line-height: 1.4;
    background: #ffffff;
}

.chat-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* 铺货草稿控制台 (Draft Console) */
.draft-panel {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

/* 参数输入区 (采购价、克重、起订量、毛利率) */
.cost-weight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    width: 100%;
    padding: 0.5rem 2.2rem 0.5rem 0.65rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-xs);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--dark-900);
    outline: none;
    transition: all 0.15s ease;
    background: #ffffff;
}

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

.input-unit-suffix {
    position: absolute;
    right: 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-400);
    pointer-events: none;
}

/* 利润率动态滑块控制器 */
.margin-slider-box {
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.margin-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: #fed7aa;
    outline: none;
}

.margin-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

.margin-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.pricing-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.metric-box {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xs);
    padding: 0.5rem;
    text-align: center;
}

.metric-box .label { font-size: 0.7rem; color: var(--gray-500); font-weight: 600; }
.metric-box .val { font-size: 1.1rem; font-weight: 900; color: var(--primary); }

.image-preview-strip {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.35rem 0;
}

.image-preview-card {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
}

.image-preview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-watermark-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(238, 77, 45, 0.95);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    text-align: center;
    padding: 2px;
}

/* 店铺选择卡片组件 */
.shop-select-group {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
}

.shop-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: #ffffff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    transition: all 0.15s ease;
    user-select: none;
}

.shop-tag-item:hover {
    border-color: var(--gray-300);
    background: var(--gray-100);
}

.shop-tag-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.shop-tag-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* -------------------------------------------------------------
   10. 订单卡片与履约打单
   ------------------------------------------------------------- */
.order-group-card {
    margin-bottom: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.order-group-header {
    background: var(--dark-800);
    color: #ffffff;
    padding: 0.85rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.order-item-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.order-item-row:last-child { border-bottom: none; }

.order-item-img {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    border: 1px solid var(--gray-200);
    background: #ffffff;
    flex-shrink: 0;
}

/* 状态 Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-ready { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge-processed { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border); }
.badge-shipped { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-default { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }

/* 实时终端日志框 */
.terminal-box {
    background: var(--dark-900);
    color: #38bdf8;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    max-height: 220px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.45;
    border: 1px solid var(--dark-800);
}

/* 加载动画 Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

.spinner-primary {
    border-color: rgba(238, 77, 45, 0.2);
    border-top-color: var(--primary);
}

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

/* -------------------------------------------------------------
   11. 全局悬浮教程按钮 (Floating Action Button - FAB)
   ------------------------------------------------------------- */
.floating-tutorial-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, #ff6b4a 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: var(--radius-full);
    border: 2px solid #ffffff;
    box-shadow: 0 10px 25px -5px rgba(238, 77, 45, 0.5), 0 8px 10px -6px rgba(238, 77, 45, 0.3);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fab-glow 3s infinite;
    user-select: none;
    outline: none;
    width: auto;
    max-width: max-content;
}

.floating-tutorial-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 30px -5px rgba(238, 77, 45, 0.6), 0 10px 12px -6px rgba(238, 77, 45, 0.4);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
}

.floating-tutorial-btn .fab-badge {
    background: #ffffff;
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

@keyframes fab-glow {
    0%, 100% { box-shadow: 0 10px 25px -5px rgba(238, 77, 45, 0.4); }
    50% { box-shadow: 0 15px 35px -2px rgba(238, 77, 45, 0.7); }
}

/* -------------------------------------------------------------
   12. 教程与指南全屏模态窗口 (Tutorial Modal - 严密隔离彻底杜绝点击拦截)
   ------------------------------------------------------------- */
.tutorial-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.tutorial-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tutorial-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96) translateY(8px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tutorial-modal-overlay.active .tutorial-modal-container {
    transform: scale(1) translateY(0);
}

.tutorial-modal-header {
    background: linear-gradient(135deg, var(--dark-800) 0%, var(--dark-900) 100%);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-modal-nav {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
}

.tutorial-nav-btn {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    outline: none;
}

.tutorial-nav-btn:hover {
    color: var(--dark-900);
    background: var(--gray-100);
}

.tutorial-nav-btn.active {
    color: var(--primary);
    background: var(--primary-light);
    border-color: var(--primary-border);
    font-weight: 700;
}

.tutorial-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #ffffff;
}

.tutorial-step-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.tutorial-step-card:hover {
    background: #ffffff;
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.tutorial-step-number {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 900;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.prompt-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all 0.2s ease;
}

.prompt-card:hover {
    border-color: var(--primary);
    background: #fffdfd;
}

.prompt-text-box {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--gray-700);
    margin: 0.5rem 0;
    line-height: 1.5;
}
