/* ================================================================
   qyzc 公共布局样式 — header + sidebar + main 基础结构
   所有业务页面 link 此文件，保证顶部导航和侧边菜单完全一致。
   ================================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
[v-cloak] { display: none; }
body {
    background: #f5f6fb;
    font-family: var(--el-font-family);
    font-size: 13px; font-weight: 400; color: #23262f;
    -webkit-font-smoothing: antialiased;
}

/* ====== 顶部导航栏（高 68px） ====== */
.app-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    height: 68px; display: flex; align-items: stretch;
    background: #fff; border-bottom: 1px solid #eef0f5;
    box-shadow: 0 4px 18px rgba(20, 23, 35, 0.04);
    font-family: var(--el-font-family);
}

/* Brand：菜单按钮 + Logo */
.brand { display: flex; width: 296px; flex-shrink: 0; background: #fff; }
.menu-btn {
    width: 60px; flex-shrink: 0; border: none; cursor: pointer;
    background: var(--qyzc-primary); color: #fff;
    display: grid; place-items: center; transition: background .15s;
}
.menu-btn:hover { background: #c42823; }
.menu-btn .grid-icon { display: grid; grid-template-columns: repeat(3, 4px); gap: 5px; }
.menu-btn .grid-icon span {
    width: 4px; height: 4px; border-radius: 50%; background: currentColor; display: block;
}
.brand .logo-wrap { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 18px; overflow: hidden; }
.brand .logo-wrap img { width: 176px; height: auto; object-fit: contain; object-position: left; }

/* TopToolbar：搜索 + 图标 + 角色 */
.top-toolbar {
    flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end;
    gap: 16px; padding: 0 28px; color: #ff7d84;
    font-family: var(--el-font-family);
}
.search-box { position: relative; width: 260px; height: 36px; display: flex; align-items: center; }
.search-box i.ph {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    font-size: 16px; font-weight: normal; pointer-events: none; color: #ff7d84;
}
.search-box input {
    width: 100%; height: 100%; border: none; border-bottom: 1px solid #ffd4d7;
    background: transparent; padding: 0 8px 0 28px;
    font-family: var(--el-font-family); font-size: 13px; font-weight: 400; color: #475569;
    outline: none;
}
.search-box input::placeholder { color: #ffb0b4; font-weight: 400; }
.search-box input:focus { border-bottom-color: var(--qyzc-primary); }

.icon-btn {
    position: relative; width: 36px; height: 36px; border: none; cursor: pointer;
    background: transparent; color: #ff7d84; border-radius: 50%;
    display: grid; place-items: center; transition: background .15s, color .15s;
    padding: 0; flex-shrink: 0;
}
.icon-btn:hover { background: #fff2f2; color: var(--qyzc-primary); }
.icon-btn i.ph { font-size: 20px; font-weight: normal; line-height: 1; }
.icon-btn .badge {
    position: absolute; right: -1px; top: -1px; min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--qyzc-primary); color: #fff; font-size: 10px; font-weight: 600;
    border-radius: 8px; display: grid; place-items: center;
    font-family: var(--el-font-family);
}
.divider-v { width: 1px; height: 24px; background: #ffd8da; flex-shrink: 0; }

/* 角色切换器 */
.role-switcher { position: relative; flex-shrink: 0; }
.role-trigger {
    display: flex; align-items: center; gap: 12px; border: none; cursor: pointer;
    background: transparent; padding: 4px 8px; border-radius: 999px; transition: background .15s;
    font-family: var(--el-font-family);
}
.role-trigger:hover { background: #fff2f2; }
.role-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: #ffe3e5; color: var(--qyzc-primary);
    display: grid; place-items: center; font-size: 13px; font-weight: 600;
    font-family: var(--el-font-family); flex-shrink: 0;
}
.role-info { line-height: 1.25; text-align: left; }
.role-info .name { font-size: 13px; font-weight: 600; color: var(--qyzc-primary); }
.role-info .role { font-size: 12px; font-weight: 400; color: var(--qyzc-primary); margin-top: 1px; }
.role-trigger i.ph-caret-down {
    font-size: 16px; color: var(--qyzc-primary); transition: transform .2s; font-weight: normal;
}
.role-trigger.open i.ph-caret-down { transform: rotate(180deg); }
.role-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 224px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 4px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}
.role-menu button {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    border: none; background: transparent; cursor: pointer; padding: 8px 12px;
    font-size: 13px; font-weight: 400; color: #475569; border-radius: 6px; text-align: left;
    transition: background .15s; font-family: var(--el-font-family);
}
.role-menu button:hover { background: #fff5f5; color: var(--qyzc-primary); }
.role-menu button.active { background: var(--el-color-primary-light-9); color: var(--qyzc-primary); font-weight: 600; }
.role-menu button i.ph-check-circle { font-size: 16px; color: var(--qyzc-primary); font-weight: normal; }

/* ====== 主体布局 ====== */
.app-body { display: flex; padding-top: 68px; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: 296px; background: #f8f9fc; border-right: 1px solid #edf0f5;
    flex-shrink: 0; position: sticky; top: 68px; height: calc(100vh - 68px);
    padding: 16px 18px; display: flex; flex-direction: column;
    font-family: var(--el-font-family);
    transition: width .2s ease, padding .2s ease;
}
.sidebar.collapsed { width: 68px; padding: 16px 8px; }
.sidebar.collapsed .sidebar-menu { margin-top: 12px; }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 8px 0; }
.sidebar.collapsed .sidebar-footer { justify-content: center; }
.collapse-btn i.ph { transition: transform .2s ease; }
.sidebar.collapsed .collapse-btn i.ph { transform: rotate(180deg); }

.sidebar-search { position: relative; width: 100%; height: 40px; flex-shrink: 0; }
.sidebar-search i.ph {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 16px; color: #cbd5e1; pointer-events: none; font-weight: normal;
}
.sidebar-search input {
    width: 100%; height: 40px; border: 1px solid #e8ebf1; background: #fff; border-radius: 8px;
    padding: 0 12px 0 36px; font-size: 13px; font-weight: 400;
    font-family: var(--el-font-family); color: #334155; outline: none; box-shadow: none;
}
.sidebar-search input::placeholder { color: #cbd5e1; }
.sidebar-search input:focus { border-color: var(--qyzc-primary); }
.sidebar-role-title { margin-top: 20px; font-size: 13px; font-weight: 500; color: #64748b; flex-shrink: 0; }
.sidebar-menu { margin-top: 16px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-bottom: 16px; }
.sidebar-item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 8px; border: none; background: transparent; cursor: pointer;
    border-radius: 8px; text-align: left; font-size: 13px; font-weight: 500; color: #334155;
    transition: background .15s, color .15s; font-family: var(--el-font-family);
}
.sidebar-item:hover { background: #fff; color: var(--qyzc-primary); }
.sidebar-item.active { background: #fff; color: var(--qyzc-primary); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.sidebar-item .icon-box {
    width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
    background: var(--el-color-primary-light-9); color: var(--qyzc-primary);
    display: grid; place-items: center; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.sidebar-item .icon-box i.ph-fill { font-size: 16px; font-weight: normal; line-height: 1; }
.sidebar-item .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 12px; border-top: 1px solid #edf0f5; flex-shrink: 0;
}
.sidebar-footer button {
    width: 32px; height: 32px; border: none; background: transparent; cursor: pointer;
    border-radius: 6px; color: #94a3b8; display: grid; place-items: center; transition: background .15s;
}
.sidebar-footer button:hover { background: #fff; }
.sidebar-footer button i.ph { font-size: 20px; font-weight: normal; }

/* 主内容区 */
.main-area { flex: 1; min-width: 0; padding: 20px 24px; }
.main-area.with-work-nav { padding: 20px 24px 20px 12px; }

/* ====== 工作环节面板（左侧，可选） ====== */
.work-nav {
    width: 240px; flex-shrink: 0; position: sticky; top: 68px; height: calc(100vh - 68px);
    background: #fff; border-right: 1px solid #edf0f5;
    display: flex; flex-direction: column; overflow-y: auto;
    font-family: var(--el-font-family);
}
.work-nav-header { padding: 16px 16px 8px; font-size: 13px; font-weight: 700; color: #64748b; border-bottom: 1px solid #eef1f6; flex-shrink: 0; }
.work-nav-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.work-nav-group { margin-bottom: 4px; }
.work-nav-group-label {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; font-size: 14px; font-weight: 700; color: #334155; line-height: 20px;
}
.work-nav-group.active .work-nav-group-label { color: var(--qyzc-primary); }
.work-nav-item {
    display: flex; align-items: center; gap: 8px;
    height: 32px; padding: 0 16px 0 28px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: #475569;
    border-left: 3px solid transparent; transition: all .12s;
}
.work-nav-item:hover { background: var(--el-color-primary-light-9); color: var(--qyzc-primary); }
.work-nav-item.current { background: var(--el-color-primary-light-9); color: var(--qyzc-primary); border-left-color: var(--qyzc-primary); font-weight: 600; }
.work-nav-dot {
    width: 8px; height: 8px; border-radius: 50%; border: 2px solid #cbd5e1;
    background: #fff; flex: none; box-sizing: border-box;
}
.work-nav-dot.done { border-color: var(--qyzc-primary); background: var(--qyzc-primary); }
.work-nav-dot.active { border-color: var(--qyzc-primary); box-shadow: 0 0 0 3px var(--el-color-primary-light-9); }
.work-nav-dot.pending { border-color: #cbd5e1; background: #fff; }
.work-nav-footer {
    padding: 10px 16px; border-top: 1px solid #eef1f6;
    font-size: 12px; color: #94a3b8; flex-shrink: 0;
}
.work-nav-footer b { color: var(--qyzc-primary); font-weight: 600; }

@media (max-width: 1280px) {
    .work-nav { width: 200px; }
    .main-area.with-work-nav { padding: 20px 16px 20px 8px; }
}
