/* =====================================================================
 * 「行程」独立 App 样式（char-schedule-app.css）
 * ---------------------------------------------------------------------
 * 结构/逻辑见 char-schedule-app.js。
 * 层级：z-index 2705 —— 特意低于「他的行程」界面宿主
 *   #wechat-char-schedule-host（2710，见 wechat-char-schedule.css），
 *   使点选 Char 后行程界面直接盖在本名单层之上、关闭后回到名单；
 *   同时高于普通 page 层，可完整覆盖主屏。
 * 配色：沿用行程模块的冰蓝色族（--cs-ice #DBE2EC / --cs-blue #8FB2C6 /
 *   --cs-ink #4c5668），让名单层与行程界面视觉连贯。
 * 命名：统一 csa- 前缀，独立文件，不与其它模块共用样式。
 * ===================================================================== */

.csa-root {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    z-index: 2705;
    display: none;
    background:
        radial-gradient(circle at 18% 12%, rgba(143, 178, 198, 0.32), transparent 44%),
        radial-gradient(circle at 84% 20%, rgba(215, 198, 230, 0.3), transparent 40%),
        linear-gradient(180deg, #f0f2f6 0%, #dbe2ec 100%);
}

.csa-root.is-open {
    display: flex;
    flex-direction: column;
}

.csa-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.csa-head {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 9px 12px;
    padding-top: max(9px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 8px;
    background: rgba(240, 242, 246, 0.9);
    border-bottom: 1px solid rgba(143, 178, 198, 0.35);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.csa-head h2 {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 17px;
    font-weight: 800;
    color: #4c5668;
    letter-spacing: 1px;
}

.csa-back {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
    color: #4c5668;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 18px rgba(76, 86, 104, 0.1);
    cursor: pointer;
    font-weight: 900;
    font-size: 30px;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.csa-back:active {
    transform: scale(0.95);
}

/* ---------- 内容区 ---------- */
.csa-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px 14px;
    padding-bottom: max(24px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.csa-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.csa-empty {
    margin: 26px 8px;
    padding: 22px 16px;
    border-radius: 16px;
    border: 1px dashed rgba(143, 178, 198, 0.55);
    background: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(76, 86, 104, 0.66);
}

.csa-entry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Char 名单卡片 ---------- */
.csa-entry {
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 12px 28px rgba(100, 116, 137, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.csa-entry:active {
    transform: scale(0.985);
}

.csa-entry__avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #8fb2c6 0%, #647489 100%);
    box-shadow: 0 6px 14px rgba(100, 116, 137, 0.22);
}

.csa-entry__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.csa-entry__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.csa-entry__main strong {
    font-size: 15px;
    font-weight: 700;
    color: #37415a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.csa-entry__main small {
    font-size: 12px;
    color: rgba(76, 86, 104, 0.62);
}

/* 今日行程标记（出差/旅行/连日工作/连日休假 + 起止日期） */
.csa-entry__main em {
    font-style: normal;
    font-size: 11.5px;
    color: #647489;
    background: rgba(143, 178, 198, 0.18);
    border: 1px solid rgba(143, 178, 198, 0.36);
    border-radius: 8px;
    padding: 2px 7px;
    margin-top: 3px;
    align-self: flex-start;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.csa-entry__chevron {
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 700;
    color: rgba(76, 86, 104, 0.4);
}

/* ---------- 暗色模式 ---------- */
html[data-appearance="dark"] .csa-root {
    background:
        radial-gradient(circle at 18% 12%, rgba(103, 128, 154, 0.3), transparent 44%),
        radial-gradient(circle at 84% 20%, rgba(122, 106, 148, 0.26), transparent 40%),
        linear-gradient(180deg, #191d26 0%, #12151c 100%);
}

html[data-appearance="dark"] .csa-head {
    background: rgba(25, 29, 38, 0.88);
    border-bottom-color: rgba(143, 178, 198, 0.2);
}

html[data-appearance="dark"] .csa-head h2 {
    color: #e3e8f2;
}

html[data-appearance="dark"] .csa-back {
    background: rgba(46, 52, 66, 0.85);
    color: #cfd7e6;
    box-shadow: none;
}

html[data-appearance="dark"] .csa-empty {
    border-color: rgba(143, 178, 198, 0.3);
    background: rgba(38, 44, 56, 0.5);
    color: rgba(199, 208, 226, 0.6);
}

html[data-appearance="dark"] .csa-entry {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(38, 44, 56, 0.82);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

html[data-appearance="dark"] .csa-entry__main strong {
    color: #e3e8f2;
}

html[data-appearance="dark"] .csa-entry__main small {
    color: rgba(199, 208, 226, 0.55);
}

html[data-appearance="dark"] .csa-entry__main em {
    color: #a9c2d2;
    background: rgba(143, 178, 198, 0.14);
    border-color: rgba(143, 178, 198, 0.28);
}

html[data-appearance="dark"] .csa-entry__chevron {
    color: rgba(199, 208, 226, 0.35);
}

/* 不支持 backdrop-filter 的内核：卡片与顶栏改为更实的底色，避免文字浮在花底上 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .csa-head { background: rgba(240, 242, 246, 0.98); }
    .csa-entry { background: rgba(255, 255, 255, 0.94); }
    html[data-appearance="dark"] .csa-head { background: rgba(25, 29, 38, 0.98); }
    html[data-appearance="dark"] .csa-entry { background: rgba(38, 44, 56, 0.96); }
}
