/**
 * 大屏展示样式 v2 - 深色主题 + 卡片/表格
 * 适配 1920x1080 大屏
 */

/* ========== 基础重置 ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #0a1628 0%, #132744 50%, #0d1f3c 100%);
    color: #e8edf3;
    display: flex; flex-direction: column;
}

/* ========== 顶部标题栏 ========== */
.header {
    display: flex; justify-content: center; align-items: center;
    padding: 12px 30px; background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
    position: relative;
}
.header-left { display: flex; align-items: center; gap: 20px; }
.logo {
    font-size: 24px; font-weight: 700;
    background: linear-gradient(90deg, #4fc3f7, #81d4fa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.user-label {
    font-size: 14px; color: rgba(255,255,255,0.5);
    padding: 4px 12px; border: 1px solid rgba(255,255,255,0.15); border-radius: 20px;
}
.header-right { display: flex; gap: 20px; font-size: 14px; color: rgba(255,255,255,0.6); position: absolute; right: 30px; }
.date { letter-spacing: 1px; }
.time { font-variant-numeric: tabular-nums; font-weight: 500; color: #4fc3f7; }

/* ========== 三列布局 ========== */
.columns-wrapper {
    flex: 1; display: flex; gap: 16px; padding: 16px 20px;
    min-height: 0; /* flex 子项溢出修复 */
}

.column {
    flex: 1; display: flex; flex-direction: column;
    background: rgba(255,255,255,0.04); border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06); overflow: hidden;
}
.column-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; background: rgba(0,0,0,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.column-header h3 { font-size: 16px; font-weight: 600; color: #81d4fa; }
.column-header .count { font-size: 12px; color: rgba(255,255,255,0.4); }

.column-body {
    flex: 1; padding: 16px; overflow: hidden;
    display: flex; flex-direction: column;
    position: relative;
}

/* ========== 卡片 ========== */
.card {
    background: rgba(255,255,255,0.06); border-radius: 10px;
    padding: 18px 20px; border: 1px solid rgba(255,255,255,0.08);
}
.card-title {
    font-size: 16px; font-weight: 600; color: #fff;
    margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.card-body {
    font-size: var(--wp-font-size, 14px); line-height: 1.8; color: rgba(255,255,255,0.8);
    white-space: pre-wrap; word-break: break-word;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.week-label { font-size: 15px; font-weight: 600; color: #fff; }
.responsible {
    font-size: 12px; color: #4fc3f7;
    padding: 3px 10px; background: rgba(79,195,247,0.12); border-radius: 12px;
}

/* 服务标准卡片 - 蓝色调 */
.card-ss { border-left: 3px solid #42a5f5; }
/* 服务标准图片卡片 */
.card-ss-image {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border: none;
    background: transparent;
}
.card-ss-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}
/* 单图模式视频卡片（16:9） */
.card-ss-video {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: 100%;
}
.card-ss-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
/* 工作计划卡片 - 绿色调 */
.card-wp { border-left: 3px solid #66bb6a; }
.card-wp .week-label { color: #a5d6a7; }

/* 图片+视频模式：固定视频区（16:9） */
.ss-video-fixed {
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}
.ss-video-fixed video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ========== 工作计划日报/周报 ========== */
.wp-period-header {
    text-align: center;
    padding: 6px 0 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 10px;
    flex-shrink: 0;
}
.wp-period-title {
    font-size: 17px;
    font-weight: 700;
    color: #a5d6a7;
    letter-spacing: 3px;
}
.wp-dept-blocks {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wp-dept-block {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}
.wp-dept-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wp-dept-name {
    font-size: 14px;
    font-weight: 600;
    color: #81d4fa;
}
.wp-dept-period {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}
/* 任务组 */
.wp-task-group {
    margin-top: 2px;
}
.wp-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 6px 14px;
    font-size: var(--wp-font-size, 13px);
    font-weight: 600;
    color: #a5d6a7;
    letter-spacing: 1px;
}
.wp-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #66bb6a;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(102,187,106,0.5);
}
/* 任务行 */
.wp-task-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 14px 6px 14px;
    font-size: var(--wp-font-size, 13px);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.wp-task-row:last-child {
    border-bottom: none;
}
.wp-task-num {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
.wp-task-content {
    flex: 1;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
    word-break: break-word;
}
.wp-task-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
    align-items: flex-end;
}
.wp-task-person {
    font-size: 11px;
    color: #81d4fa;
}
.wp-task-time {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.05);
    padding: 1px 6px;
    border-radius: 6px;
}
/* 任务状态标签 */
.wp-task-status {
    flex-shrink: 0;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
    align-self: center;
    margin-right: 4px;
}
.st-待领取 { background: rgba(255, 193, 7, 0.18); color: #ffc107; }
.st-进行中 { background: rgba(33, 150, 243, 0.18); color: #42a5f5; }
.st-已完成 { background: rgba(76, 175, 80, 0.18); color: #66bb6a; }
.st-未完成 { background: rgba(244, 67, 54, 0.18); color: #ef5350; }
.st-已关闭 { background: rgba(158, 158, 158, 0.18); color: #9e9e9e; }
/* 旧数据回退卡片 */
.wp-task-card {
    padding: 10px 14px;
    font-size: var(--wp-font-size, 13px);
    color: rgba(255,255,255,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.wp-task-card:last-child {
    border-bottom: none;
}
.wp-dept-blocks::-webkit-scrollbar {
    width: 4px;
}
.wp-dept-blocks::-webkit-scrollbar-track {
    background: transparent;
}
.wp-dept-blocks::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* ========== 值班 - 今日+明日人员卡片 ========== */
.dr-day-section {
    flex-shrink: 0;
}
.dr-day-label {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #81d4fa;
    letter-spacing: 1px;
    padding: 8px 0 14px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}
.dr-day-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.today-dot {
    background: #4fc3f7;
    box-shadow: 0 0 8px rgba(79,195,247,0.6);
}
.tomorrow-dot {
    background: rgba(255,255,255,0.3);
    box-shadow: none;
}
.dr-day-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 8px;
    letter-spacing: 2px;
}
.today-badge {
    color: #fff;
    background: rgba(79,195,247,0.35);
}
.tomorrow-badge {
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
}
.dr-cat-tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #ffcc80;
    background: rgba(255,183,77,0.12);
    padding: 2px 12px;
    border-radius: 10px;
    letter-spacing: 2px;
}
/* 明日标题淡化 */
.dr-tomorrow-section {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.dr-tomorrow-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
    padding: 4px 0 10px 0;
}
.dr-tomorrow-cat {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,204,128,0.5);
    background: rgba(255,183,77,0.06);
    padding: 1px 10px;
    letter-spacing: 1px;
}
/* 明日卡片淡化 */
.dr-tomorrow-card {
    opacity: 0.6;
}
.dr-tomorrow-card:hover {
    opacity: 0.85;
}
.dr-personnel-grid {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-content: flex-start;
    overflow-y: auto;
    padding-right: 4px;
}
.dr-personnel-grid::-webkit-scrollbar { width: 4px; }
.dr-personnel-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}
.dr-personnel-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    flex: 1 1 calc(50% - 6px);
    min-width: 180px;
    transition: background 0.2s, border-color 0.2s;
}
.dr-personnel-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(79,195,247,0.3);
}
.dr-photo {
    width: 56px;
    height: 74px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(79,195,247,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dr-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dr-photo-placeholder {
    font-size: 24px;
    font-weight: 700;
    color: #81d4fa;
}
.dr-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.dr-name {
    font-size: var(--dr-font-size, 15px);
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
}
.dr-phone {
    font-size: calc(var(--dr-font-size, 13px) - 1px);
    color: rgba(255,255,255,0.6);
}
.dr-position {
    font-size: calc(var(--dr-font-size, 12px) - 1px);
    color: #4fc3f7;
    padding: 2px 8px;
    background: rgba(79,195,247,0.12);
    border-radius: 10px;
    align-self: flex-start;
}
.dr-custom-field {
    font-size: calc(var(--dr-font-size, 12px) - 2px);
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
}
.dr-table {
    width: 100%; border-collapse: collapse;
}
.dr-table th {
    padding: 10px 12px; text-align: left; font-size: 12px;
    color: rgba(255,255,255,0.5); font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.dr-table td {
    padding: 12px; font-size: 14px; color: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dr-table tr:hover td { background: rgba(255,255,255,0.03); }
.dr-table .weekday { font-size: 12px; color: rgba(255,255,255,0.45); margin-left: 4px; }

/* 今日值班高亮 */
.dr-table tr.dr-today td {
    background: rgba(76,175,80,0.15);
    color: #fff;
    font-weight: 600;
}
.dr-table tr.dr-today td:first-child {
    border-left: 3px solid #66bb6a;
}
.dr-table tr.dr-today .weekday { color: #a5d6a7; }

/* ========== 客服负责楼栋（值班下方固定，单行轮播） ========== */
.cs-building-slot {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 14px 10px 14px;
    margin-top: 6px;
}
.cs-building-scroll {}
.cs-building-title {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cs-building-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
    line-height: 1.5;
    border-radius: 4px;
}
.cs-building-row:nth-child(even) {
    background: rgba(255,255,255,0.03);
}
.cs-name {
    color: #4fc3f7;
    flex-shrink: 0;
    min-width: 56px;
    font-weight: 600;
    line-height: 1;
}
.cs-phone {
    color: rgba(255,255,255,0.45);
    flex-shrink: 0;
    font-size: 0.92em;
}
.cs-colon {
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.cs-buildings {
    color: rgba(255,255,255,0.75);
    flex: 1;
}

/* ========== 轮播 ========== */
.carousel-item {
    display: none; width: 100%; height: 100%;
    opacity: 0; transition: opacity 0.5s ease;
}
.carousel-item.active {
    display: flex; flex-direction: column;
    opacity: 1;
}
.carousel-item.fade-out {
    display: flex; flex-direction: column;
    opacity: 0;
}

/* 向左滑动轮播 */
.ss-slide-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.ss-slide-item {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform: translateX(100%);
    transition: transform 0.5s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.ss-slide-item.active {
    transform: translateX(0);
}
.ss-slide-item.slide-out-left {
    transform: translateX(-100%);
}

/* ========== 空状态 ========== */
.empty-col {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: rgba(255,255,255,0.3); font-size: 14px;
}

/* ========== 加载状态 ========== */
.loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; gap: 16px;
}
.loading-spinner {
    width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #4fc3f7; border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: rgba(255,255,255,0.5); font-size: 14px; }

/* ========== 底部滚动栏 ========== */
.footer {
    flex-shrink: 0; padding: 10px 20px;
    background: rgba(0,0,0,0.3); border-top: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}
.marquee {
    white-space: nowrap; animation: marquee 30s linear infinite;
}
.marquee span { font-size: 20px; font-weight: 600; color: #4fc3f7; }
@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ========== 无用户提示 ========== */
.no-user {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.8); z-index: 100;
}
.no-user-box {
    text-align: center; padding: 40px 60px;
    background: rgba(255,255,255,0.05); border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}
.no-user-box h2 { font-size: 20px; color: #81d4fa; margin-bottom: 16px; }
.no-user-box p { color: rgba(255,255,255,0.6); font-size: 14px; }
.no-user-box code {
    display: inline-block; padding: 4px 12px; margin-top: 8px;
    background: rgba(255,255,255,0.1); border-radius: 6px;
    font-family: monospace; color: #4fc3f7;
}

/* ========== 七日天气预报 ========= */
.weather-slot {
    flex-shrink: 0; padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
}
.weather-strip {
    display: flex; gap: 4px; justify-content: space-between;
}
.weather-day {
    flex: 1; text-align: center; padding: 6px 2px;
    border-radius: 8px; transition: background 0.2s;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.weather-day.today {
    background: rgba(79,195,247,0.15);
    border: 1px solid rgba(79,195,247,0.25);
}
.wd-label { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.8); }
.wd-date { font-size: 10px; color: rgba(255,255,255,0.4); }
.wd-icon { font-size: 18px; line-height: 1; margin: 2px 0; }
.wd-temp { font-size: 10px; color: rgba(255,255,255,0.6); }

/* ========== 值班标题头部（日期范围+标签同行） ========= */
.dr-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}
.dr-header .dr-date-range {
    margin-bottom: 0;
}
.dr-header .category-tag {
    margin-bottom: 0;
}

/* ========== 值班日期范围 ========= */
.dr-date-range {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

/* ========== 分类标签 ========= */
.category-tag {
    display: inline-block; padding: 6px 20px; margin-bottom: 12px;
    font-size: 16px; font-weight: 600; color: #81d4fa;
    background: rgba(79,195,247,0.12); border: 1px solid rgba(79,195,247,0.25);
    border-radius: 14px;
    text-align: center;
    letter-spacing: 4px;
}
.card-group {
    display: flex; flex-direction: column; gap: 12px;
}

/* ========== 动态字段卡片 ========== */
.card-field {
    display: flex; justify-content: space-between;
    padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.card-field:last-child { border-bottom: none; }
.field-label {
    color: rgba(255,255,255,0.5); font-size: 13px;
    flex-shrink: 0; margin-right: 12px;
}
.field-value {
    text-align: right; color: rgba(255,255,255,0.85);
    font-size: 13px; word-break: break-all;
}
