/* 服药助手模块专属样式 */

.medicine-page {
    max-width: 900px;
    margin: 0 auto;
}

.medicine-page h1 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.medicine-page .description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* 时间轴外层容器，提供足够高度容纳标签和滑块 */
.timeline-wrap {
    background: #fff;
    border-radius: 10px;
    padding: 32px 20px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.timeline-container {
    position: relative;
    width: 100%;
    height: 110px; /* 滑块顶部标签(25px) + 轴高度(60px) + 刻度(25px) */
}

/* 时间轴色条 */
.timeline-bg {
    position: absolute;
    top: 25px; /* 为滑块顶部标签留空间 */
    left: 0;
    width: 100%;
    height: 50px;
    background-color: #4caf50; /* 绿色：可进食 */
    border-radius: 6px;
    /* 不用 overflow:hidden，改为让禁食区域自身带圆角，避免裁掉滑块点击区域 */
}

/* 禁食区域（由 JS 动态插入） */
.fasting-zone {
    position: absolute;
    height: 100%;
    top: 0;
    background-color: #e53935; /* 红色：禁食 */
    opacity: 0.88;
    transition: left 0.08s ease, width 0.08s ease;
    /* 端点圆角：如果禁食区在时间轴左右两端，加圆角覆层 */
    border-radius: 6px;
}

/* 时间刻度标签 */
.time-labels {
    position: absolute;
    top: 82px;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.time-label {
    position: absolute;
    font-size: 11px;
    color: #999;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* 服药滑块（可拖拽，第一次） */
/* 视觉是 4px 细线，用 ::before 伪元素向左右各扩展 12px 可点击区域 */
.drug-handle {
    position: absolute;
    top: 18px;
    width: 4px;
    height: 64px;
    background-color: #1a1a2e;
    border-radius: 2px;
    cursor: grab;
    z-index: 10;
    transform: translateX(-50%);
    transition: box-shadow 0.15s;
}

/* 透明点击热区，左右各向外扩展 12px */
.drug-handle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -12px;
    right: -12px;
    bottom: 0;
}

.drug-handle:hover {
    box-shadow: 0 0 0 4px rgba(26, 26, 46, 0.12);
}

.drug-handle:active,
.drug-handle.dragging {
    cursor: grabbing;
    box-shadow: 0 0 0 6px rgba(26, 26, 46, 0.18);
}

/* 服药标记（只读，第二次） */
.drug-marker {
    position: absolute;
    top: 18px;
    width: 4px;
    height: 64px;
    background-color: #888;
    border-radius: 2px;
    cursor: default;
    z-index: 5;
    transform: translateX(-50%);
    border: none;
    background-image: repeating-linear-gradient(
        to bottom,
        #888 0px,
        #888 6px,
        transparent 6px,
        transparent 10px
    );
    background-color: transparent;
}

/* 滑块顶部标签 */
.handle-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
}

.drug-marker .handle-label {
    background: #888;
}

/* 状态信息面板 */
.status-panel {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.status-item {
    flex: 1;
    min-width: 220px;
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.status-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 6px;
}

.status-time {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.fasting-info {
    font-size: 13px;
    color: #e53935;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .medicine-page h1 {
        font-size: 18px;
    }

    .status-time {
        font-size: 26px;
    }

    .timeline-wrap {
        padding: 28px 12px 16px;
    }
}
