/**
 * 门店后台视觉（与总店 saas 青绿体系对齐，偏运营台）
 */
:root {
    --store-ink: #122c27;
    --store-ink-soft: #3d5650;
    --store-muted: #6b7f78;
    --store-accent: #1a8f73;
    --store-accent-2: #147a62;
    --store-accent-soft: rgba(26, 143, 115, 0.12);
    --store-bg: #e8f0ec;
    --store-bg-2: #f4f8f6;
    --store-line: #d5e2dc;
    --store-card: rgba(255, 255, 255, 0.92);
    --store-shadow: 0 10px 30px rgba(18, 44, 39, 0.06);
    --store-radius: 16px;
    --store-font: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body[data-app="store"] {
    margin: 0;
    background:
        radial-gradient(ellipse 80% 50% at 100% -10%, rgba(26, 143, 115, 0.14), transparent 55%),
        radial-gradient(ellipse 60% 40% at -10% 30%, rgba(18, 70, 58, 0.08), transparent 50%),
        linear-gradient(180deg, #e6efea 0%, var(--store-bg) 40%, #eef4f1 100%);
    color: var(--store-ink);
    font-family: var(--store-font);
    -webkit-font-smoothing: antialiased;
}

body[data-app="store"] #app[v-cloak] { display: none; }

/* —— 布局：一级深色 + 二级浅色，内容铺满 —— */
.store-layout {
    height: 100vh;
    max-height: 100vh;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    overflow: hidden;
}

.store-aside {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background: #fff;
    box-shadow: 4px 0 24px rgba(18, 44, 39, 0.06);
    z-index: 20;
}

/* 一级：窄轨 */
.store-side-first {
    width: 84px;
    display: flex;
    flex-direction: column;
    color: #edf5f2;
    background:
        radial-gradient(ellipse 120% 60% at 50% -10%, rgba(26, 143, 115, 0.35), transparent 55%),
        linear-gradient(180deg, #0e2520 0%, #12302a 55%, #0f2823 100%);
}

.store-aside-brand {
    padding: 14px 10px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.store-aside-brand .tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0;
    margin: 0 auto 8px;
    background: linear-gradient(145deg, rgba(126, 219, 188, 0.28), rgba(26, 143, 115, 0.35));
    color: #dff9ee;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.store-aside-brand .tag::before { display: none; }

.store-aside-brand strong {
    display: block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
    color: rgba(255, 255, 255, 0.88);
}

.store-aside-brand small { display: none; }

.store-nav-first {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 6px;
    flex: 1;
    overflow: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

.store-first-item {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    border-radius: 12px;
    padding: 10px 4px 9px;
    font-size: 11px;
    font-weight: 650;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.store-first-item .store-first-ico {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.78);
}

.store-first-item .store-first-ico svg {
    width: 15px;
    height: 15px;
    display: block;
}

.store-first-item span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-first-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.store-first-item:hover .store-first-ico {
    background: rgba(126, 219, 188, 0.18);
    color: #b8f0db;
}

.store-first-item.active {
    background: rgba(26, 143, 115, 0.32);
    color: #fff;
}

.store-first-item.active .store-first-ico {
    background: linear-gradient(145deg, #1a8f73, #147a62);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.store-aside-foot {
    padding: 8px 6px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.store-aside-foot select {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 7px 2px;
    font-size: 10px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.store-aside-foot select:focus {
    border-color: rgba(126, 219, 188, 0.45);
}

.store-aside-foot option { color: var(--store-ink); }

/* 二级：浅色面板 */
.store-side-second {
    width: 176px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #f7fbf9 0%, #eef5f1 100%);
    border-right: 1px solid var(--store-line);
    min-height: 0;
    color: var(--store-ink);
}

.store-side-second-title {
    padding: 16px 16px 8px;
    font-size: 12px;
    font-weight: 750;
    color: var(--store-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.store-nav-second {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 10px 16px;
    flex: 1;
    overflow: auto;
    min-height: 0;
    scrollbar-width: thin;
}

.store-second-link {
    position: relative;
    color: var(--store-ink-soft);
    text-decoration: none;
    padding: 10px 12px 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 550;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.store-second-link:hover {
    background: rgba(26, 143, 115, 0.08);
    color: var(--store-accent-2);
}

.store-second-link.active {
    background: #fff;
    color: var(--store-accent-2);
    font-weight: 700;
    box-shadow:
        0 1px 2px rgba(18, 44, 39, 0.04),
        0 6px 14px rgba(18, 44, 39, 0.05),
        inset 3px 0 0 var(--store-accent);
}

.store-second-section {
    margin: 12px 8px 4px;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.04em;
    color: var(--store-muted);
    text-transform: none;
}

.store-main-wrap {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background: transparent;
}

.store-topbar {
    height: 52px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(213, 226, 220, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
    z-index: 10;
}

.store-topbar-left {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.store-topbar h1 {
    margin: 0;
    font-size: 16px;
    color: var(--store-ink);
    font-weight: 750;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.store-topbar-sub {
    color: var(--store-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42vw;
}

.store-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--store-muted);
    flex-shrink: 0;
}

.store-user button,
.store-user a.btn-link {
    background: #fff;
    border: 1px solid var(--store-line);
    color: var(--store-ink);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.store-user a.btn-link:hover,
.store-user button:hover {
    border-color: var(--store-accent);
    color: var(--store-accent);
}

.store-user button#btn-store-logout:hover {
    border-color: #c45656;
    color: #c45656;
}

.store-main {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 12px 14px 16px;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

.store-app-fill {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.store-mobile-bar { display: none; }

/* 旧单栏 nav 兼容（若残留） */
.store-nav { display: none; }

/* —— 页面通用 —— */
body[data-app="store"] .page-card {
    background: var(--store-card);
    border: 1px solid rgba(213, 226, 220, 0.95);
    border-radius: var(--store-radius);
    padding: 16px 16px 18px;
    box-shadow: var(--store-shadow);
    backdrop-filter: blur(8px);
    flex: 1;
    min-height: calc(100vh - 52px - 28px);
    box-sizing: border-box;
}

body[data-app="store"] .page-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 750;
    color: var(--store-ink);
    letter-spacing: -0.01em;
}

body[data-app="store"] .page-desc,
body[data-app="store"] .store-muted {
    color: var(--store-muted);
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 18px;
}

body[data-app="store"] .page-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 4px;
}

body[data-app="store"] .store-section-title {
    margin: 8px 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--store-ink);
    padding-top: 8px;
    border-top: 1px dashed var(--store-line);
}

/* 主色按钮统一 */
body[data-app="store"] .el-button--primary {
    --el-button-bg-color: var(--store-accent);
    --el-button-border-color: var(--store-accent);
    --el-button-hover-bg-color: var(--store-accent-2);
    --el-button-hover-border-color: var(--store-accent-2);
    --el-button-active-bg-color: var(--store-accent-2);
    --el-button-active-border-color: var(--store-accent-2);
}

body[data-app="store"] .el-tabs__item.is-active,
body[data-app="store"] .el-tabs__item:hover {
    color: var(--store-accent);
}

body[data-app="store"] .el-tabs__active-bar {
    background-color: var(--store-accent);
}

body[data-app="store"] .el-pagination.is-background .el-pager li.is-active {
    background-color: var(--store-accent) !important;
}

body[data-app="store"] .el-table {
    --el-table-header-bg-color: #f3f8f6;
    --el-table-row-hover-bg-color: #f6fbf9;
    border-radius: 12px;
    overflow: hidden;
}

body[data-app="store"] .el-dialog {
    border-radius: 16px;
}

body[data-app="store"] .el-drawer__header {
    margin-bottom: 12px;
    font-weight: 700;
}

/* 统计卡片 */
body[data-app="store"] .stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

body[data-app="store"] .stat-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-app="store"] .stat-item {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #ffffff 0%, #f7fbf9 100%);
    border: 1px solid var(--store-line);
    border-radius: 14px;
    padding: 16px 16px 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body[data-app="store"] .stat-item:hover {
    transform: translateY(-2px);
    border-color: rgba(26, 143, 115, 0.35);
    box-shadow: 0 12px 24px rgba(18, 44, 39, 0.07);
}

body[data-app="store"] .stat-item::after {
    content: "";
    position: absolute;
    right: -12px;
    top: -16px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--store-accent-soft);
    pointer-events: none;
}

body[data-app="store"] .stat-num {
    position: relative;
    font-size: 26px;
    font-weight: 800;
    color: var(--store-ink);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

body[data-app="store"] .stat-label {
    position: relative;
    font-size: 12px;
    color: var(--store-muted);
    margin-top: 6px;
    font-weight: 500;
}

body[data-app="store"] .stat-item.is-accent {
    background: linear-gradient(145deg, #1a8f73 0%, #147a62 100%);
    border-color: transparent;
    color: #fff;
}

body[data-app="store"] .stat-item.is-accent .stat-num,
body[data-app="store"] .stat-item.is-accent .stat-label {
    color: #fff;
}

body[data-app="store"] .stat-item.is-accent .stat-label {
    opacity: 0.82;
}

body[data-app="store"] .stat-item.is-accent::after {
    background: rgba(255, 255, 255, 0.12);
}

/* 工作台头图条 */
.store-hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 18px 18px 16px;
    border-radius: 14px;
    background:
        linear-gradient(120deg, rgba(26, 143, 115, 0.12), transparent 55%),
        linear-gradient(180deg, #f7fbf9, #eef6f2);
    border: 1px solid var(--store-line);
}

.store-hero h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--store-ink);
}

.store-hero p {
    margin: 0;
    color: var(--store-muted);
    font-size: 13px;
}

.store-hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.store-quick {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.store-quick a {
    display: block;
    text-decoration: none;
    color: var(--store-ink);
    background: #fff;
    border: 1px solid var(--store-line);
    border-radius: 12px;
    padding: 14px 14px 12px;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.store-quick a:hover {
    border-color: var(--store-accent);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(18, 44, 39, 0.06);
}

.store-quick strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.store-quick span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--store-muted);
}

/* 登录页增强 */
.store-login.login-page {
    background:
        radial-gradient(circle at 18% 18%, rgba(126, 219, 188, 0.28), transparent 42%),
        radial-gradient(circle at 80% 80%, rgba(31, 138, 112, 0.18), transparent 40%),
        linear-gradient(145deg, #0c241f 0%, #14352d 42%, #1a4a3f 100%);
}

.store-login .store-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(126, 219, 188, 0.16);
    color: #b7f0de;
    margin-bottom: 14px;
}

.store-login .login-brand h1 {
    font-family: var(--store-font);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.store-login .brand-points {
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13.5px;
    line-height: 2;
}

.store-login .brand-points li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-login .brand-points li::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7ad9bc;
    box-shadow: 0 0 0 3px rgba(122, 217, 188, 0.2);
    flex-shrink: 0;
}

.store-login .brand-foot {
    opacity: 0.5;
    font-size: 12px;
    margin-top: 28px;
    letter-spacing: 0.02em;
}

.store-login .login-card {
    border-radius: 18px;
    border: 1px solid rgba(213, 226, 220, 0.9);
    box-shadow: 0 20px 50px rgba(8, 28, 24, 0.22);
}

.store-login .login-card h2 {
    font-family: var(--store-font);
    font-weight: 800;
}

.store-login .el-button--primary {
    --el-button-bg-color: var(--store-accent);
    --el-button-border-color: var(--store-accent);
    --el-button-hover-bg-color: var(--store-accent-2);
    --el-button-hover-border-color: var(--store-accent-2);
}

.pick-title {
    font-size: 16px;
    font-weight: 750;
    margin: 0 0 4px;
    color: var(--store-ink);
}

.pick-item {
    border: 1px solid var(--store-line);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.pick-item:hover,
.pick-item.active {
    border-color: var(--store-accent);
    background: var(--store-accent-soft);
    transform: translateX(2px);
}

.pick-item strong { display: block; color: var(--store-ink); font-weight: 700; }
.pick-item small { display: block; margin-top: 4px; color: var(--store-muted); font-size: 12px; }

/* 移动端 */
body[data-device="mobile"] .store-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
}

body[data-device="mobile"] .store-aside { display: none; }

body[data-device="mobile"] .store-main-wrap {
    height: auto;
    max-height: none;
    overflow: visible;
    min-height: 100vh;
}

body[data-device="mobile"] .store-mobile-bar {
    display: flex;
    gap: 6px;
    overflow: auto;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--store-line);
    position: sticky;
    top: 52px;
    z-index: 9;
    -webkit-overflow-scrolling: touch;
}

body[data-device="mobile"] .store-mobile-bar a {
    flex-shrink: 0;
    text-decoration: none;
    color: var(--store-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eef4f1;
}

body[data-device="mobile"] .store-mobile-bar a.active {
    background: var(--store-accent-soft);
    color: var(--store-accent);
}

body[data-device="mobile"] .store-main {
    padding: 10px;
    overflow: visible;
}

body[data-device="mobile"] .store-topbar { padding: 0 12px; }
body[data-device="mobile"] .store-topbar-sub { display: none; }

body[data-device="mobile"] .page-card {
    min-height: auto;
}

body[data-device="mobile"] .stat-grid,
body[data-device="mobile"] .stat-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-device="mobile"] .store-quick {
    grid-template-columns: 1fr;
}

/* 门店应用中心 */
.store-app-group { margin-top: 18px; }
.store-app-group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--store-muted);
    margin-bottom: 10px;
}
.store-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.store-app-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--store-line);
    background: #fff;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.store-app-card:hover {
    transform: translateY(-2px);
    border-color: rgba(26, 143, 115, 0.4);
    box-shadow: 0 10px 22px rgba(18, 44, 39, 0.07);
}
.store-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}
.store-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.store-app-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--store-ink);
}
.store-app-desc {
    margin-top: 4px;
    font-size: 12px;
    color: var(--store-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1100px) {
    body[data-app="store"] .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
