/* 从 templates/base.html 原样外提的壳层样式。
   必须在 extra_css 之后加载，以保持原先「内联 style 压过页面 extra_css」的层叠。 */

:root {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --border-soft: #e2e8f0;
    --border-hover: #cbd5e1;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --primary: #2563eb;
    --primary-light: #eff6ff;
    --primary-hover: #1d4ed8;
    --primary-shadow: rgba(37, 99, 235, 0.25);

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);

    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

body {
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif);
    background-color: var(--bg-base);
    color: var(--text-main);
}

.app-header-light {
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft) !important;
}
@media (max-width: 768px) {
    .app-header-light {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: #ffffff !important;
    }
}

.btn-header-outline {
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
    background: transparent;
    border-radius: 8px;
    padding: 0.35rem 0.85rem;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
}

.btn-header-outline:hover {
    background: var(--bg-base);
    color: var(--primary);
    border-color: var(--primary);
}

.header-user-text {
    color: var(--text-main);
    font-weight: 500;
}

/* ===== 统一弹窗设计系统 · Bee Repair ===== */
/* 简约高级风格 — 纯白底、细线描边、柔和阴影 */

.modal { z-index: 1055 !important; }

.modal-dialog {
    margin: 1.75rem auto;
    max-width: 480px;
}

.modal-dialog-centered {
    display: flex !important;
    align-items: center !important;
    min-height: calc(100% - 3.5rem);
}

/* 弹窗遮罩 — 半透明即可，避免全屏 blur 拖慢打开动画 */
.modal-backdrop {
    background-color: rgba(15, 23, 42, 0.48);
    z-index: 1050;
}
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: 1; }

/* 弹窗卡片 — 实底白卡 + 柔阴影，保留高级感且无持续滤镜 */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
}

/* 顶部彩色装饰线（默认隐藏，由 bee-accent-* 类启用） */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    z-index: 1;
}
.modal-content.bee-accent-success::before { background: linear-gradient(90deg, #10b981, #34d399); }
.modal-content.bee-accent-error::before   { background: linear-gradient(90deg, #ef4444, #f87171); }
.modal-content.bee-accent-warning::before  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.modal-content.bee-accent-info::before     { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.modal-content.bee-accent-primary::before  { background: linear-gradient(90deg, #2563eb, #60a5fa); }

/* 弹窗头部 — 纯白底 */
.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 20px 28px 16px;
    background: transparent;
}
/* 覆盖所有旧的 bg-* header 样式（除删除弹窗） */
.modal:not(#deleteOrderModal) .modal-header.bg-success,
.modal:not(#deleteOrderModal) .modal-header.bg-danger,
.modal:not(#deleteOrderModal) .modal-header.bg-warning,
.modal:not(#deleteOrderModal) .modal-header.bg-info,
.modal:not(#deleteOrderModal) .modal-header.bg-primary {
    background: transparent !important;
    color: #1e293b !important;
    border-bottom: 1px solid #f1f5f9;
}
.modal:not(#deleteOrderModal) .modal-header.bg-success .btn-close-white,
.modal:not(#deleteOrderModal) .modal-header.bg-danger .btn-close-white,
.modal:not(#deleteOrderModal) .modal-header.bg-warning .btn-close-white,
.modal:not(#deleteOrderModal) .modal-header.bg-info .btn-close-white,
.modal:not(#deleteOrderModal) .modal-header.bg-primary .btn-close-white {
    filter: none;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.01em;
}

/* 关闭按钮 */
.modal:not(#deleteOrderModal) .btn-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background-color: #f1f5f9;
    opacity: 0.8;
    transition: all 0.2s ease;
    padding: 0;
}
.modal:not(#deleteOrderModal) .btn-close:hover {
    opacity: 1;
    background-color: #e2e8f0;
    transform: rotate(90deg);
}

/* 弹窗内容 */
.modal-body {
    padding: 24px 28px;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.65;
}

/* 弹窗底部 */
.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 16px 28px;
    background: #fafbfc;
    border-radius: 0 0 20px 20px;
}

/* 弹窗按钮 — 统一圆润风格 */
.modal-footer .btn {
    min-width: 96px;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
    border: none;
}
.modal-footer .btn-secondary,
.modal-footer .btn-outline-secondary {
    background: #fff;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
}
.modal-footer .btn-secondary:hover,
.modal-footer .btn-outline-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}
.modal-footer .btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-shadow);
}
.modal-footer .btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 16px var(--primary-shadow);
    transform: translateY(-1px);
}
/* 删除弹窗中的 btn-danger 不变 */
#deleteOrderModal .modal-footer .btn-danger {
    /* 保留原始样式 */
}
.modal:not(#deleteOrderModal) .modal-footer .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.modal:not(#deleteOrderModal) .modal-footer .btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}
.modal-footer .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* 弹窗动画 — 柔和缩放+淡入
   注意：须用 .fade.show 提高优先级，避免仅遮罩可见、内容 opacity:0 */
.modal.fade .modal-dialog {
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
}
.modal.fade.show .modal-dialog,
.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ===== Alert Modal 图标区 ===== */
.bee-alert-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}
.bee-alert-icon.icon-success { background: #ecfdf5; color: #10b981; }
.bee-alert-icon.icon-error   { background: #fef2f2; color: #ef4444; }
.bee-alert-icon.icon-warning { background: #fffbeb; color: #f59e0b; }
.bee-alert-icon.icon-info    { background: #eff6ff; color: #3b82f6; }

.bee-alert-message {
    text-align: center;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.6;
    word-break: break-word;
}

/* ===== 统一弹窗辅助组件 ===== */

/* 弹窗内提示横幅 */
.bee-modal-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.5;
}
.bee-modal-banner i { font-size: 1.1rem; flex-shrink: 0; }
.bee-modal-banner.banner-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.bee-modal-banner.banner-warning i { color: #f59e0b; }
.bee-modal-banner.banner-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}
.bee-modal-banner.banner-info i { color: #3b82f6; }
.bee-modal-banner.banner-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.bee-modal-banner.banner-danger i { color: #ef4444; }
.bee-modal-banner.banner-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.bee-modal-banner.banner-success i { color: #10b981; }

/* 弹窗内表单标签 */
.bee-modal-label {
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* 弹窗内表单输入框 */
.bee-modal-input {
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
    color: #1e293b;
    background: #fff;
    transition: all 0.2s ease;
    width: 100%;
}
.bee-modal-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}
.bee-modal-input::placeholder { color: #94a3b8; }

/* 弹窗正文描述 */
.bee-modal-desc {
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
}

/* 弹窗辅助小字 */
.bee-modal-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* ===== Toast 通知 — 简约高级 ===== */
.bee-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 9999;
    min-width: 280px;
    max-width: 480px;
    padding: 14px 24px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1),
                transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: auto;
    border-left: 3px solid transparent;
}
.bee-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.bee-toast.bee-toast-success { border-left-color: #10b981; }
.bee-toast.bee-toast-error   { border-left-color: #ef4444; }
.bee-toast.bee-toast-warning { border-left-color: #f59e0b; }
.bee-toast.bee-toast-info    { border-left-color: #3b82f6; }

.bee-toast-icon {
    width: 32px; height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.bee-toast-success .bee-toast-icon { background: #ecfdf5; color: #10b981; }
.bee-toast-error   .bee-toast-icon { background: #fef2f2; color: #ef4444; }
.bee-toast-warning .bee-toast-icon { background: #fffbeb; color: #f59e0b; }
.bee-toast-info    .bee-toast-icon { background: #eff6ff; color: #3b82f6; }

.bee-toast-text {
    font-size: 0.9rem;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}
.bee-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.bee-toast-close:hover { color: #475569; background: #f1f5f9; }

/* ===== 页面顶部 Flash 提示（登录成功 / 改密引导等）===== */
.bee-flash-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    padding: 0.85rem 2.75rem 0.85rem 1rem;
    margin-bottom: 0.85rem;
    line-height: 1.5;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
}
.bee-flash-alert .bee-alert-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.55);
    margin: 0;
}
.bee-flash-alert .bee-flash-text {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 500;
}
.bee-flash-alert.alert-dismissible .btn-close {
    position: absolute;
    top: 50%;
    right: 0.7rem;
    transform: translateY(-50%);
    margin: 0;
    padding: 0.45rem;
    flex-shrink: 0;
}

/* ===== Elegant Success 全屏覆盖 ===== */
.bee-success-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.bee-success-overlay.show { opacity: 1; }
.bee-success-card {
    background: #fff;
    border-radius: 24px;
    padding: 48px 40px 36px;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,0.12);
    transform: scale(0.9);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    min-width: 260px;
}
.bee-success-overlay.show .bee-success-card {
    transform: scale(1);
}
.bee-success-check {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #34d399);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}
.bee-success-check i {
    color: #fff;
    font-size: 1.6rem;
}
.bee-success-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* 确认对话框样式（继承统一弹窗设计） */
.confirm-modal-dialog {
    max-width: 520px;
}

.confirm-modal-content {
    /* 继承统一 .modal-content 样式 */
}

.confirm-modal-header {
    /* 继承统一 .modal-header 样式 */
}

.confirm-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.confirm-modal-body {
    padding: 24px 28px;
}

.confirm-modal-message-wrapper {
    margin-bottom: 20px;
}

.confirm-modal-message {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}

/* 拆修状态选择区域 */
.disassembly-status-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 12px;
}

.disassembly-status-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 拆机状态卡片样式 */
.disassembly-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.disassembly-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.disassembly-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    transition: all 0.3s ease;
}

.disassembly-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.disassembly-card.active {
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.disassembly-card.active[data-value="1"] {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #10b981;
}
.disassembly-card.active[data-value="1"]::before { background: #10b981; }
.disassembly-card.active[data-value="1"] .card-icon { background: #10b981; color: #fff; }

.disassembly-card.active[data-value="2"] {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #f59e0b;
}
.disassembly-card.active[data-value="2"]::before { background: #f59e0b; }
.disassembly-card.active[data-value="2"] .card-icon { background: #f59e0b; color: #fff; }

.disassembly-card.active[data-value="3"] {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-color: #64748b;
}
.disassembly-card.active[data-value="3"]::before { background: #64748b; }
.disassembly-card.active[data-value="3"] .card-icon { background: #64748b; color: #fff; }

.disassembly-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 20px;
    transition: all 0.3s ease;
}

.disassembly-card .card-icon.success { background: #d1fae5; color: #10b981; }
.disassembly-card .card-icon.warning { background: #fef3c7; color: #f59e0b; }
.disassembly-card .card-icon.secondary { background: #e2e8f0; color: #64748b; }

.disassembly-card .card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.disassembly-card .card-desc {
    font-size: 11px;
    color: #94a3b8;
}

/* 拆机原因区域样式 */
#disassemblyReasonsSection {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border-radius: 16px;
    border: 1px solid #fde047;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.reasons-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #92400e;
    font-weight: 600;
    font-size: 14px;
}

.reasons-header i { font-size: 16px; }
.reasons-header small { font-weight: 400; color: #a16207; font-size: 12px; }

.reasons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.reason-chip {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.reason-chip input[type="checkbox"] {
    display: none;
}

.reason-chip span {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 12px;
    color: #374151;
    transition: all 0.2s ease;
}

.reason-chip span i {
    font-size: 12px;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.reason-chip:hover span {
    border-color: #f59e0b;
    background: #fffbeb;
}

.reason-chip input[type="checkbox"]:checked + span {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.reason-chip input[type="checkbox"]:checked + span i {
    color: #fff;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .disassembly-cards { grid-template-columns: 1fr; gap: 10px; }
    .reasons-grid { grid-template-columns: repeat(2, 1fr); }
    .confirm-modal-dialog { max-width: 95%; margin: 1rem auto; }
}

/* 兼容旧的按钮样式 */
.disassembly-status-btn {
    display: none;
}

/* 确认对话框底部（继承统一 .modal-footer） */
.confirm-modal-footer {
    gap: 12px;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
    }

    .modal-dialog-centered::before {
        height: calc(100vh - 1rem);
    }
}

/* 模块化布局基础样式 */
.app-container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.app-header {
    z-index: 1000;
}

.app-header-shell {
    position: sticky;
    top: 0;
    min-height: 64px;
    padding: 0.45rem 0;
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.86) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
}

.app-header-shell .container-fluid {
    min-height: 52px;
    gap: 0.75rem;
}

/* 优化的品牌标题样式 */
.brand-link {
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.35rem 0.5rem;
    border-radius: 14px;
}

.brand-link:hover {
    transform: translateX(2px);
    background: rgba(37, 99, 235, 0.05);
}

.brand-link:focus-visible,
.btn-header-outline:focus-visible,
.app-menu-button:focus-visible,
.sidebar .nav-link:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.24);
    outline-offset: 2px;
}

.brand-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    line-height: 1.2;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}

.brand-text-stack {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.brand-text-main {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
    display: inline-block;
    white-space: nowrap;
}

.brand-text-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: inline-block;
    letter-spacing: 0.04em;
}

.brand-link:hover .brand-text-main {
    color: var(--primary);
}

.brand-link:hover .brand-text-sub {
    color: var(--primary);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .brand-mark {
        width: 30px;
        height: 30px;
        border-radius: 7px;
    }

    .brand-text-main {
        font-size: 1rem;
        margin-left: 0;
    }

    .brand-text-sub {
        font-size: 0.62rem;
    }
}

/* 门店信息 — 简洁文字 */
.store-badge {
    align-items: center;
    gap: .4rem;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(241, 245, 249, 0.95));
    border: 1px solid rgba(191, 219, 254, 0.8);
    color: var(--text-main);
    padding: 7px 13px;
    font-size: 0.9rem;
    border-radius: 99px;
    white-space: nowrap;
    margin-right: auto;
    margin-left: .25rem;
    cursor: default;
    line-height: 1;
    font-weight: 500;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.store-badge-name {
    font-weight: 600;
    color: var(--primary);
    letter-spacing: .3px;
}
.store-badge-sep {
    opacity: .3;
    margin: 0 .2rem;
}
.store-badge-code {
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 400;
    letter-spacing: .5px;
}
@media (max-width: 992px) {
    .store-badge { font-size: .88rem; padding: 4px 10px; }
    .store-badge-code { font-size: .72rem; }
}

.app-header-actions {
    gap: 0.5rem;
}

.app-menu-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.app-menu-button:hover,
.app-menu-button[aria-expanded="true"] {
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.28);
    background: var(--primary-light);
}

/* 优化的时间显示样式 */
.time-display-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.time-display-container:hover {
    background: #ffffff;
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.time-icon {
    font-size: 18px;
    color: var(--primary);
}

.time-content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

/* 顶栏只显示日期：实时时钟在首页 hero 面板里，这里不再重复一份 */
.time-date {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .time-display-container {
        padding: 4px 10px;
        gap: 8px;
        border-radius: 8px;
    }

    .time-date {
        font-size: 11px;
    }

    .time-icon {
        font-size: 15px;
    }
}

.app-body {
    display: flex;
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 72px;
    min-width: 72px;
    background-color: transparent;
    border-right: none;
    position: sticky;
    top: var(--header-height, 56px);
    height: calc(100vh - var(--header-height, 56px));
    align-self: flex-start;
    flex-shrink: 0;
    z-index: 999;
    padding: 0.75rem 0 0.75rem 0.75rem;
}

.sidebar .p-3 {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 56px;
    height: calc(100% - 1.5rem);
    padding: 0.5rem !important;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
    transition: width 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.sidebar:hover .p-3,
.sidebar:focus-within .p-3 {
    width: 168px;
    border-color: rgba(191, 219, 254, 0.95);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.10);
}

.sidebar .p-3::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.sidebar .p-3::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .p-3::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

.sidebar .p-3::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* 导航容器：作为滑动指示条的定位上下文 */
.sidebar #sidebarNav {
    position: relative;
    min-width: 40px;
}

/* 滑动指示条：胶囊底 + 左侧主色竖条 */
.sidebar-indicator {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.04) 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.10), inset 0 0 0 1px rgba(37, 99, 235, 0.08);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transform: translateY(0);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
                height 0.25s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.2s ease;
}

.sidebar-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.35);
}

.sidebar .nav-link {
    position: relative;
    z-index: 1;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    min-height: 44px;
    border-radius: 14px !important;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
    color: var(--text-muted) !important;
    background: transparent !important;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus-visible {
    color: var(--primary) !important;
    background: rgba(37, 99, 235, 0.06) !important;
    transform: translateX(2px);
}

.sidebar .nav-link:hover .sidebar-icon,
.sidebar .nav-link:focus-visible .sidebar-icon {
    transform: scale(1.1);
    color: var(--primary);
}

/* 选中态：由滑动指示条承担高亮，链接本身仅改文字/图标色 */
.sidebar .nav-link.bg-primary {
    background: transparent !important;
    color: var(--primary) !important;
    font-weight: 600;
    box-shadow: none !important;
}

.sidebar .nav-link.bg-primary .sidebar-icon {
    color: var(--primary);
    transform: scale(1.12);
}

.sidebar:hover .nav-link,
.sidebar:focus-within .nav-link {
    justify-content: flex-start;
    padding-left: 0.75rem !important;
    padding-right: 0.65rem !important;
}

.sidebar-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    margin-right: 0;
    flex-shrink: 0;
    transition: margin-right 0.25s ease, transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), color 0.2s ease;
}

.sidebar:hover .sidebar-icon,
.sidebar:focus-within .sidebar-icon {
    margin-right: 0.55rem;
}

.sidebar .sidebar-text {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    font-size: 0.92rem;
    transition: max-width 0.2s ease, opacity 0.18s ease;
}

.sidebar:hover .sidebar-text,
.sidebar:focus-within .sidebar-text {
    max-width: 104px;
    opacity: 1;
}

/* 无障碍：尊重"减少动态效果"系统设置 */
@media (prefers-reduced-motion: reduce) {
    .sidebar-indicator {
        transition: opacity 0.15s ease !important;
    }
    .sidebar .sidebar-icon,
    .sidebar .nav-link.bg-primary .sidebar-icon {
        transition: color 0.15s ease !important;
        transform: none !important;
    }
}

.content-wrapper {
    flex: 1;
    /* flex 子项默认 min-width:auto，宽表格会把它顶开导致整页横向溢出、
       侧边栏与页头错位，同时让内部 .table-responsive 的横向滚动失效 */
    min-width: 0;
    max-width: 100%;
    padding: 1.5rem;
    background-color: var(--bg-base);
    overflow-y: auto;
}

.content-container {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    min-height: calc(100vh - 3rem - 48px);
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border-soft);
}

/* 宽表格统一交给 .table-responsive 横向滚动，并给出可见的滚动条提示，
   避免「操作」列被挤到可视区外、看起来像按钮消失 */
.content-wrapper .table-responsive {
    max-width: 100%;
    scrollbar-width: thin;
}

.content-wrapper .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.content-wrapper .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-radius: 999px;
}

.content-wrapper .table-responsive::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.14);
    border-radius: 999px;
}

/* 由脚本为「裸表格」补的横向滚动容器，样式对齐 .table-responsive */
.table-scroll-shim {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table-scroll-shim::-webkit-scrollbar {
    height: 8px;
}

.table-scroll-shim::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-radius: 999px;
}

.table-scroll-shim::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.14);
    border-radius: 999px;
}

/* 打印时不能有滚动容器，否则超出部分会整块丢失 */
@media print {
    .table-scroll-shim,
    .table-responsive {
        overflow: visible !important;
    }
}

/* 移动端布局覆盖 - 确保移动端样式优先级 */
@media screen and (max-width: 768px) {
    .app-body {
        display: block !important;
        flex: none !important;
    }

    .content-wrapper {
        display: block !important;
        flex: none !important;
        margin-left: 0 !important;
        padding: 1rem 0.75rem !important;
        width: 100% !important;
        background-color: transparent !important;
        overflow-y: visible !important;
        min-height: 0 !important;
    }

    .content-container {
        background-color: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 1rem !important;
        min-height: 0 !important;
        height: auto !important;
    }
}

.card {
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid #f1f3f5;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
}

.card-body {
    padding: 1.5rem;
}

.module-section {
    margin-bottom: 2rem;
}

/* 图标统一样式 - FA6 下让 all.min.css 管理 font-family/font-weight(FA4 强制 'FontAwesome' 会使图标变豆腐块)
   不在这里强制 display：all.min.css 已给出 inline-block 默认值，而这条规则的
   !important 会盖掉组件里「图标自带尺寸框 + inline-flex 居中」的写法
   （.metric-icon / 卡片标题图标等），令字形掉到方框左上角。 */
.fa, .fas, .far, .fab, [class^="fa-"], [class*=" fa-"] {
    font-style: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* 确保图标在加载前不显示占位符 */
.fa:before {
    display: inline-block;
}

/* 按钮图标间距 */
.btn i {
    margin-right: 0.5rem;
}

.btn i:last-child {
    margin-right: 0;
}

/* 登录页面渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    background-size: cover;
    background-position: center;
    min-height: 100vh;
}

.full-screen-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.login-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    padding: 2rem 1rem;
}

/* 响应式调整 - 移动端抽屉导航兜底，主样式在 mobile.css */
@media (max-width: 768px) {
    .sidebar {
        display: block;
        position: fixed;
        left: -252px;
        top: var(--header-height, 60px);
        width: min(78vw, 252px);
        height: calc(100dvh - var(--header-height, 60px));
    }

    .sidebar.show {
        display: block;
        left: 0;
    }

    .sidebar.show .p-3 {
        position: static;
        width: 100%;
    }

    .sidebar.show .nav-link {
        justify-content: flex-start;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .sidebar.show .sidebar-text {
        display: inline;
    }

    .sidebar.show .sidebar-icon {
        margin-right: 0.75rem;
    }
}

/* ===== 新预约提醒：侧边栏红点 + 顶栏铃铛 ===== */
.nav-dot {
    position: absolute;
    top: 7px;
    left: 26px;
    min-width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
    animation: navDotPulse 1.8s ease-in-out infinite;
}

.sidebar:hover .nav-dot,
.sidebar:focus-within .nav-dot,
.sidebar.show .nav-dot {
    top: 50%;
    left: auto;
    right: 12px;
    transform: translateY(-50%);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.66rem;
    font-weight: 700;
    color: #fff;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
}

@keyframes navDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.apt-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 0.5rem;
    border-radius: 11px;
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.2);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}
.apt-bell:hover { color: var(--primary); background: rgba(37, 99, 235, 0.12); }
.apt-bell.has-new { color: #ef4444; border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.1); }
.apt-bell.has-new i { animation: bellShake 2.4s ease-in-out infinite; }

.apt-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

@keyframes bellShake {
    0%, 88%, 100% { transform: rotate(0); }
    90% { transform: rotate(12deg); }
    93% { transform: rotate(-10deg); }
    96% { transform: rotate(6deg); }
}

/* 新预约浮层提醒（可点击跳转） */
.apt-alert {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 9998;
    width: min(320px, calc(100vw - 36px));
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(239, 68, 68, 0.22);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    text-decoration: none;
    color: inherit;
    transform: translateY(140%);
    transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.apt-alert.show { transform: translateY(0); }
.apt-alert-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #f87171);
}
.apt-alert-upcoming { border-color: rgba(37, 99, 235, 0.22); }
.apt-alert-upcoming .apt-alert-icon { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.apt-alert-body { flex: 1; min-width: 0; }
.apt-alert-title { font-size: 0.85rem; font-weight: 700; color: #0f172a; margin: 0 0 2px; }
.apt-alert-text { font-size: 0.76rem; color: #64748b; margin: 0; line-height: 1.45; }
.apt-alert-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
}

/* 直播工单被接单：建单客服端居中遮罩弹窗，需手动关闭或确认。
   挂在 body 上，避开内容区 transform 对 fixed 的干扰。
   层级：客户名最大，行动指令用色块，其余降噪。 */
.live-notice-root {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.live-notice-root[hidden] { display: none; }
.live-notice-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    transition: opacity 0.22s ease;
}
.live-notice-panel {
    position: relative;
    width: min(420px, 100%);
    padding: 22px 22px 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 28px 64px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.live-notice-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #2563eb;
}
.live-notice-root.is-open .live-notice-backdrop { opacity: 1; }
.live-notice-root.is-open .live-notice-panel {
    opacity: 1;
    transform: none;
}

.live-notice-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 28px 14px 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #2563eb;
    line-height: 1.3;
}
.live-notice-title i { font-size: 0.875rem; }
.live-notice-code {
    margin: -8px 28px 12px 0;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-notice-customer {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    letter-spacing: -0.02em;
    word-break: break-word;
}
.live-notice-device {
    margin: 6px 0 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    line-height: 1.5;
    word-break: break-word;
}

.live-notice-cta {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    word-break: break-word;
}
.live-notice-cta i { font-size: 1rem; flex-shrink: 0; }

.live-notice-meta {
    margin: 12px 0 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    line-height: 1.45;
}
.live-notice-more {
    margin: 8px 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.live-notice-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}
.live-notice-btn {
    border: 1px solid transparent;
    background: transparent;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}
.live-notice-btn:hover { background: #f1f5f9; color: #0f172a; }
.live-notice-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.live-notice-btn-confirm {
    margin-right: auto;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    padding: 8px 16px;
}
.live-notice-btn-confirm:hover { background: #1e293b; color: #fff; }
.live-notice-btn-confirm[disabled] { opacity: 0.6; cursor: default; }

.live-notice-panel.is-confirmed::before { background: #10b981; }
.live-notice-panel.is-confirmed .live-notice-cta {
    background: #ecfdf5;
    color: #047857;
}
.live-notice-panel.is-confirmed .live-notice-btn-confirm { background: #059669; }

.live-notice-close {
    position: absolute;
    top: 14px;
    right: 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.125rem;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.18s ease, background 0.18s ease;
}
.live-notice-close:hover { color: #0f172a; background: #f1f5f9; }
.live-notice-close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .live-notice-backdrop,
    .live-notice-panel { transition: none; }
}

@media (max-width: 576px) {
    .apt-alert { right: 12px; left: 12px; bottom: 14px; width: auto; }
    .apt-bell { width: 32px; height: 32px; margin-right: 0.35rem; }
    .live-notice-root { padding: 16px 12px; }
    .live-notice-panel { width: 100%; padding: 20px 18px 16px; }
    .live-notice-customer { font-size: 1.25rem; }
}
