/* ================= 全局与变量 ================= */
:root {
    --separator: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --accent: #0a84ff;
    --green: #30d158;
    --radius-md: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
body {
    background: #000;
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}
#app-container { flex: 1; position: relative; width: 100%; height: 100%; overflow: hidden; }

/* ================= 背景图 ================= */
.bg-layer {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    background-image: url('bg.jpg');
    background-size: cover; background-position: center; background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ================= 隐藏滚动条 ================= */
.main-grid::-webkit-scrollbar, .brand-grid::-webkit-scrollbar,
.model-container::-webkit-scrollbar, .list-container::-webkit-scrollbar,
.fn-grid::-webkit-scrollbar { display: none; }
.main-grid, .brand-grid, .model-container, .list-container, .fn-grid { -ms-overflow-style: none; scrollbar-width: none; }

/* ================= 加载动画 ================= */
#loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: transparent;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 9999; opacity: 1; visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.spinner {
    width: 48px; height: 48px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    animation: spin 0.9s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.loader-text { color: #fff; font-size: 13px; letter-spacing: 2px; font-weight: 500; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }

/* ================= 整理工单加载动画 ================= */
#organizeLoader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 9998;
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
#organizeLoader.show { opacity: 1; visibility: visible; }
#organizeLoader .spinner {
    border: 3px solid rgba(48, 209, 88, 0.2);
    border-top-color: var(--green);
    animation: spin 0.9s linear infinite;
    width: 56px; height: 56px;
    box-shadow: 0 0 30px rgba(48, 209, 88, 0.4);
}
#organizeLoader .loader-text {
    color: #fff; font-size: 14px; letter-spacing: 3px;
    font-weight: 500; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

/* ================= 界面通用 ================= */
.screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    padding: 40px 60px 30px 60px; display: none; flex-direction: column;
    z-index: 2; background: transparent;
}
.screen.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.screen.active { animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 4px 20px 4px; flex-shrink: 0;
}
.header h2 { color: #fff; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9); }
.back-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff; padding: 9px 20px; border-radius: 100px;
    cursor: pointer; font-size: 14px; font-weight: 600; transition: all 0.2s ease;
}
.back-btn:hover { background: rgba(255, 255, 255, 0.25); }
.back-btn:active { transform: scale(0.96); }

/* ================= 分页 ================= */
.pagination-wrapper { position: relative; width: 100%; height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.pagination-track { display: flex; width: 200%; height: 100%; transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.page { width: 50%; height: 100%; padding: 0 12px; display: flex; flex-direction: column; flex-shrink: 0; }
.page-indicator { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 16px 0 4px 0; }
.page-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); transition: all 0.3s ease; }
.page-dot.active { background: #fff; width: 20px; border-radius: 100px; }

/* ================= 主界面标题 ================= */
.main-title-wrap { text-align: center; padding: 30px 20px 20px 20px; flex-shrink: 0; }
.main-title-wrap h1 {
    font-size: clamp(20px, 2.4vw, 34px); font-weight: 800; color: #fff; letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(120, 180, 255, 0.5), 0 4px 24px rgba(0, 0, 0, 0.9);
    background: linear-gradient(90deg, #a0c4ff 0%, #ffffff 50%, #a0c4ff 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 12px rgba(10, 132, 255, 0.3));
}

/* ================= 主界面网格 ================= */
.main-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: 30px; flex: 1; align-content: stretch; justify-content: stretch; padding: 10px 0; }
.menu-card { display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); padding: 10px; }
.menu-card:active { transform: scale(0.92); }
.menu-icon-wrap {
    width: clamp(80px, 9vw, 120px); height: clamp(80px, 9vw, 120px);
    border-radius: 22%; display: flex; justify-content: center; align-items: center;
    margin-bottom: 14px; position: relative;
    box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.4), inset 0 -2px 3px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.5);
    transition: all 0.25s ease; overflow: hidden;
}
.menu-icon-wrap::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 22% 22% 50% 50%; pointer-events: none;
}
.menu-card:hover .menu-icon-wrap {
    transform: translateY(-4px);
    box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.5), inset 0 -2px 3px rgba(0, 0, 0, 0.2), 0 14px 32px rgba(0, 0, 0, 0.6);
}
.bg-green { background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%); }
.bg-red { background: linear-gradient(180deg, #f87171 0%, #ef4444 100%); }
.bg-blue { background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%); }
.bg-teal { background: linear-gradient(180deg, #5eead4 0%, #14b8a6 100%); }
.bg-orange { background: linear-gradient(180deg, #fdba74 0%, #f97316 100%); }
.bg-yellow { background: linear-gradient(180deg, #fde047 0%, #eab308 100%); }
.bg-purple { background: linear-gradient(180deg, #c084fc 0%, #a855f7 100%); }
.bg-pink { background: linear-gradient(180deg, #f472b6 0%, #ec4899 100%); }
.bg-sky { background: linear-gradient(180deg, #7dd3fc 0%, #0ea5e9 100%); }
.bg-indigo { background: linear-gradient(180deg, #818cf8 0%, #6366f1 100%); }
.bg-emerald { background: linear-gradient(180deg, #34d399 0%, #10b981 100%); }
.bg-rose { background: linear-gradient(180deg, #fb7185 0%, #f43f5e 100%); }
.menu-card .svg-icon { width: 44%; height: 44%; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; position: relative; z-index: 2; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)); }
.menu-card span { font-size: clamp(12px, 1.1vw, 15px); font-weight: 500; color: #fff; text-align: center; letter-spacing: -0.01em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); }

/* ================= 品牌网格 ================= */
.brand-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr);
    gap: 18px; overflow-y: auto; padding: 10px 0; align-content: stretch; height: 100%;
}
.brand-box {
    background: rgba(20, 25, 35, 0.55);
    backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.25s ease;
    padding: 14px 8px; position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.brand-box:hover {
    transform: translateY(-3px);
    background: rgba(25, 40, 70, 0.7);
    border-color: rgba(100, 180, 255, 0.9);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(10, 132, 255, 0.7), 0 0 60px rgba(10, 132, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.brand-box:active { transform: scale(0.97); }
.brand-logo {
    width: clamp(70px, 7vw, 95px); height: clamp(70px, 7vw, 95px);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #3a3a3c 0%, #000 100%);
    display: flex; justify-content: center; align-items: center;
    margin-bottom: 10px; color: #fff;
    font-weight: 700; font-size: clamp(12px, 1.1vw, 15px);
    letter-spacing: 0.5px; text-transform: uppercase;
    box-shadow: 0 0 0 2px rgba(232, 235, 239, 0.9), 0 0 0 3px rgba(200, 205, 212, 0.7), 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.1);
}
.brand-cn { font-size: clamp(12px, 1.1vw, 15px); font-weight: 600; color: #fff; text-align: center; letter-spacing: 0.5px; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }

/* ================= 车型列表 ================= */
.model-container { flex: 1; overflow-y: auto; padding: 0 4px 20px 4px; }
.model-category { margin-bottom: 26px; }
.model-category h3 { color: rgba(255, 255, 255, 0.9); font-size: 13px; font-weight: 600; margin-bottom: 10px; padding: 0 12px; letter-spacing: -0.01em; text-transform: uppercase; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9); }
.model-grid { display: flex; flex-direction: column; gap: 4px; }
.model-box {
    background: rgba(20, 25, 35, 0.55);
    backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
    padding: 16px 20px; border-radius: var(--radius-md);
    text-align: left; font-size: 15px; font-weight: 500;
    color: #fff; cursor: pointer; transition: all 0.25s ease;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; justify-content: space-between; align-items: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.model-box::after {
    content: ''; position: absolute; right: 20px;
    width: 8px; height: 8px;
    border-right: 1.5px solid rgba(255, 255, 255, 0.5);
    border-top: 1.5px solid rgba(255, 255, 255, 0.5);
    transform: rotate(45deg); opacity: 0.7;
}
.model-box:active { transform: scale(0.99); }
.model-box:hover { background: rgba(30, 40, 55, 0.65); border-color: rgba(255, 255, 255, 0.2); }

/* ================= 井字格功能菜单 ================= */
.fn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; flex: 1; align-content: center; padding: 30px 40px; }
.fn-card { display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.fn-card:active { transform: scale(0.92); }
.fn-icon-wrap {
    width: clamp(100px, 11vw, 140px); height: clamp(100px, 11vw, 140px);
    border-radius: 22%; display: flex; justify-content: center; align-items: center;
    margin-bottom: 16px; position: relative;
    box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.4), inset 0 -2px 3px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.5);
    transition: all 0.25s ease; overflow: hidden;
}
.fn-icon-wrap::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 22% 22% 50% 50%; pointer-events: none;
}
.fn-card:hover .fn-icon-wrap { transform: translateY(-4px); }
.fn-card .svg-icon { width: 44%; height: 44%; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; position: relative; z-index: 2; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)); }
.fn-card span { font-size: clamp(13px, 1.2vw, 16px); font-weight: 500; color: #fff; letter-spacing: -0.01em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); }
.fn-card.placeholder { visibility: hidden; pointer-events: none; }

/* ================= 工单界面 ================= */
#screen-work-order { padding: 0; }
.work-order-wrapper { display: flex; height: 100%; width: 100%; position: relative; overflow: hidden; }

.fullscreen-upload-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.fullscreen-upload-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.full-screen-upload {
    width: 80%; height: 70%;
    border-radius: 28px;
    background: rgba(20, 25, 35, 0.55);
    backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.full-screen-upload:hover { background: rgba(30, 40, 55, 0.65); border-color: rgba(10, 132, 255, 0.4); }
.upload-wrapper { position: relative; display: inline-block; }
.upload-icon { font-size: 56px; margin-bottom: 14px; opacity: 0.9; }
.upload-title { font-size: 22px; color: #fff; margin-bottom: 6px; font-weight: 600; letter-spacing: -0.02em; }
.upload-desc { font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 28px; }

.upload-action-btn {
    background: var(--accent); color: #fff; border: none;
    padding: 14px 48px; border-radius: 100px;
    font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.4);
}
.upload-action-btn:active { transform: scale(0.96); }
.upload-action-btn:hover { background: #1a8fff; }
.upload-action-btn.done { background: var(--green); box-shadow: 0 4px 16px rgba(48, 209, 88, 0.4); }
.upload-action-btn.done:hover { background: #3ddc63; }

#fileInputBefore { display: none; }

/* 上传成功提示 */
.upload-toast {
    position: absolute; top: 60px; right: 40px;
    background: rgba(30, 30, 34, 0.95);
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--separator);
    border-radius: 16px;
    padding: 18px 24px 0; min-width: 320px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    opacity: 0; visibility: hidden;
    transform: translateX(40px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 200;
}
.upload-toast.show { opacity: 1; visibility: visible; transform: translateX(0); }
.upload-toast-icon { font-size: 15px; color: var(--green); display: inline-block; margin-right: 10px; vertical-align: middle; }
.upload-toast-text { font-size: 14px; color: #fff; line-height: 1.5; word-break: break-all; display: inline-block; vertical-align: middle; max-width: 240px; font-weight: 500; }
.upload-toast-text b { color: var(--green); font-weight: 600; }
.upload-toast-bar { width: calc(100% + 48px); margin-left: -24px; height: 2px; background: rgba(48, 209, 88, 0.15); border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; overflow: hidden; margin-top: 14px; }
.upload-toast-bar-inner { height: 100%; width: 100%; background: var(--green); transform-origin: left; }
.upload-toast.show .upload-toast-bar-inner { animation: toastBarShrink 1.5s linear forwards; }
@keyframes toastBarShrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ================= 左右分栏 ================= */
.split-container { display: flex; width: 100%; height: 100%; position: relative; }
.left-panel, .right-panel {
    height: 100%; display: flex; flex-direction: column;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute; top: 0;
    background: rgba(15, 20, 30, 0.5);
    backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
}
.left-panel { left: 0; width: 100%; border-right: none; }
.right-panel { left: 100%; width: 50%; opacity: 0; pointer-events: none; }

.work-order-wrapper.slid-half .left-panel { width: 50%; border-right: 1px solid rgba(255, 255, 255, 0.08); }
.work-order-wrapper.slid-half .right-panel { left: 50%; width: 50%; opacity: 1; pointer-events: auto; }

.work-order-wrapper.slid-full .left-panel { width: 0%; overflow: hidden; opacity: 0; }
.work-order-wrapper.slid-full .right-panel { left: 0; width: 100%; opacity: 1; }

.wo-header {
    display: flex; justify-content: space-between; align-items: center;
    height: 64px; padding: 0 32px; flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}
.wo-header h2 { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.wo-header h2.green { color: var(--green); }

/* 全局返回按钮 */
.global-back-btn {
    position: fixed; top: 32px; right: 60px; z-index: 500;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 9px 22px; border-radius: 100px;
    cursor: pointer; font-size: 14px; font-weight: 600;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: all 0.2s ease; line-height: 1.2;
}
.global-back-btn.show { opacity: 1; visibility: visible; pointer-events: auto; }
.global-back-btn:hover { background: rgba(255, 255, 255, 0.25); }
.global-back-btn:active { transform: translateY(-50%) scale(0.96); }

/* 列表 */
.list-section { display: flex; flex-direction: column; flex: 1; overflow: hidden; padding: 0 32px 32px 32px; }
.list-container { flex: 1; overflow-y: auto; margin-top: 16px; position: relative; padding-right: 6px; }

.list-item {
    background: rgba(20, 25, 35, 0.55);
    backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 6px; padding: 16px 22px;
    color: #fff; line-height: 1.5; font-size: 14px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.list-item:hover { background: rgba(30, 40, 55, 0.65); border-color: rgba(255, 255, 255, 0.15); }
.right-panel .list-item.init-hidden { opacity: 0; }

/* 分类标题：绿色 */
.list-item.category {
    color: #4ade80;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
}
.list-item.category:hover { color: #6ee7a0; }
.flying-item.category {
    color: #4ade80;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
}

/* 飞行中的克隆体 */
.flying-item {
    position: fixed; margin: 0 !important; z-index: 9999;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    background: rgba(40, 50, 65, 0.9) !important;
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(10, 132, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    pointer-events: none;
    will-change: transform, width, height;
}

/* 按钮 */
.action-btn {
    background: var(--accent); border: none; color: #fff;
    padding: 14px 44px; border-radius: 100px;
    font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.4);
}
.action-btn:hover { background: #1a8fff; }
.action-btn:active { transform: scale(0.96); }
.organize-btn {
    position: absolute; right: 40px; bottom: 40px; z-index: 10;
    background: var(--green);
    box-shadow: 0 4px 16px rgba(48, 209, 88, 0.4);
}
.organize-btn:hover { background: #3ddc63; }