/* 商务部 11 月业绩大屏样式
   风格：浅粉背景 + 白色玻璃卡片 + 蓝色渐变（沿用 10 月销售大屏） */

/* ---------- 全局变量 ---------- */
:root {
    --blue-1: #4facfe;          /* 蓝色渐变起点 */
    --blue-2: #2b6cff;          /* 蓝色渐变终点 */
    --pink-1: #ff9ec4;          /* 粉色点缀 */
    --text: #2c3a55;            /* 主文字 */
    --muted: #8b95ad;           /* 次要文字 */
    --card-bg: rgba(255, 255, 255, 0.72);   /* 玻璃卡片底色 */
    --card-border: rgba(255, 255, 255, 0.9);
    --radius: 16px;
    --shadow: 0 8px 24px rgba(120, 140, 190, 0.14);
}

/* ---------- 基础布局 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: var(--text);
    /* 浅粉色背景，叠加两处柔光斑增加层次 */
    background:
        radial-gradient(900px 500px at 12% 8%, rgba(255, 190, 214, 0.45), transparent 60%),
        radial-gradient(800px 460px at 88% 92%, rgba(160, 200, 255, 0.35), transparent 60%),
        linear-gradient(160deg, #fff6fa 0%, #fdf1f6 45%, #f3f7ff 100%);
    min-height: 100vh;
}

.screen {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100vh;
    padding: 16px 20px 20px;
}

/* ---------- 顶栏 ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand h1 {
    font-size: 26px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--blue-1), var(--blue-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.9);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.6; }
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--muted);
}

.live {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #37d39a;
    box-shadow: 0 0 8px #37d39a;
    animation: pulse 1.4s infinite;
}

/* ---------- 一键更新按钮 ---------- */
.refresh-btn {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
    box-shadow: 0 4px 12px rgba(43, 108, 255, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(43, 108, 255, 0.45);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

/* ---------- 顶部核心指标卡 ---------- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    flex: 0 0 auto;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.kpi-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
}

.kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    font-size: 22px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.18), rgba(43, 108, 255, 0.16));
}

.kpi-icon.flip {
    animation: flipIcon 0.6s ease;
}

@keyframes flipIcon {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(90deg) scale(0.85); }
    100% { transform: rotateY(0deg) scale(1); }
}

.kpi-body {
    min-width: 0;
}

.kpi-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(90deg, var(--blue-1), var(--blue-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.kpi-unit {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 3px;
}

/* ---------- 三栏主体 ---------- */
.main {
    display: flex;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
}

.col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 25%;
    min-height: 0;
}

.col-center {
    width: 50%;
}

/* ---------- 卡片 ---------- */
.card {
    display: flex;
    flex-direction: column;
    padding: 14px 16px 16px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    min-height: 0;
}

.card-title {
    position: relative;
    flex: 0 0 auto;
    padding-left: 10px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 700;
}

.card-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
}

.hint {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.chart {
    flex: 1 1 auto;
    min-height: 0;
}

/* 左栏：人员对比整栏 */
.card-compare { flex: 1 1 auto; }

/* 中栏：趋势占大头，待回款排名占小头 */
/* 42%：给排名留足空间，保证 6 个人都完整显示（否则最后一名被裁掉） */
.card-trend { flex: 0 0 42%; }
.card-rank { flex: 1 1 auto; }

/* ---------- 个人待回款排名 ---------- */
.rank-list {
    flex: 1 1 auto;
    min-height: 0;
    /* 万一空间实在不够，出滚动条而不是悄悄裁掉人 */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.rank-item {
    font-size: 12.5px;
    flex: 0 0 auto;
}

.rank-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.rank-name { font-weight: 700; }

/* 排名序号小圆标 */
.rank-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    color: #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
}

.rank-value { color: #d4568c; font-weight: 700; }

.rank-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
    text-align: right;
}

/* 进度条外槽 */
.rank-bar {
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 158, 196, 0.15);
    overflow: hidden;
}

/* 进度条填充：宽度由 JS 设置，transition 产生进度动画 */
.rank-fill {
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--blue-1), var(--blue-2));
    transition: width 1s ease;
}

/* 待回款排名用粉色填充，呼应"待回款"语义 */
.rank-fill-pink {
    background: linear-gradient(90deg, var(--pink-1), #d4568c);
}

/* 右栏：达成率仪表盘（上部 42%）+ 过程端数据（下部） */
.card-gauge { flex: 0 0 42%; }
.card-process { flex: 1 1 auto; }

/* 过程端四列均分 */
.process-head,
.process-row {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    font-size: 13px;
    text-align: center;
}

/* ---------- 滚动列表通用 ---------- */
.list-head,
.list-row {
    display: grid;
    align-items: center;
    padding: 8px 6px;
    font-size: 13px;
}

.list-head {
    flex: 0 0 auto;
    color: var(--muted);
    border-bottom: 1px dashed rgba(139, 149, 173, 0.35);
}

.list-track {
    list-style: none;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-around;   /* 行数少时在整栏内均匀铺开 */
}

.list-row:nth-child(odd) {
    background: rgba(79, 172, 254, 0.06);
    border-radius: 8px;
}

.list-row .num {
    font-weight: 700;
    color: var(--blue-2);
    text-align: center;
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 1400px) {
    .kpi-row { grid-template-columns: repeat(3, 1fr); }
    .brand h1 { font-size: 22px; }
    .kpi-value { font-size: 22px; }
}
