/* ==============================================
   JoyBird | 雀喜・嘻 V6.0全局样式
   品牌色：主色#2E7D32，食台#81C784，巢居#7986CB
   ============================================== */


/* 全局重置（包含伪元素，统一盒模型） */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}


body {
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}


/* 全局链接样式统一 */
a {
    color: #2E7D32;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}


/* 全局输入框基础样式 */
input {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}
input:focus {
    border-color: #4CAF50;
}


/* 顶部导航栏（品牌统一） */
.header {
    background: #2E7D32;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


.header h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
}


/* 导航栏内按钮专属样式：与背景区分开 */
.header button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.header button:hover {
    background: rgba(255, 255, 255, 0.25);
}


/* 按钮样式 */
button {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    background: #2E7D32;
    color: #fff;
    cursor: pointer;
    margin: 0 4px;
    font-size: 13px;
    transition: background 0.2s, opacity 0.2s;
}


button:hover {
    background: #1B5E20;
}


button:focus-visible {
    outline: 2px solid #81C784;
    outline-offset: 2px;
}


button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


button.danger { background: #f56c6c; }
button.danger:hover { background: #c62828; }
button.warning { background: #e6a23c; }
button.warning:hover { background: #f57c00; }


/* 提示文字 */
.btn-tip { font-size: 12px; color: #666; margin-left: 6px; }
.tip-danger { color: #f56c6c; font-size: 12px; margin-left: 6px; }
.tip-warning { color: #e6a23c; font-size: 12px; margin-left: 6px; }


/* 设备卡片（双设备差异化背景） */
.device-card {
    background: #fff;
    padding: 14px;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid transparent;
}


/* 食台卡片：浅草绿左边框 */
.device-card.feeder {
    border-left-color: #81C784;
    background: linear-gradient(to right, rgba(129, 199, 132, 0.05), #fff);
}


/* 巢居卡片：浅靛蓝左边框 */
.device-card.nest {
    border-left-color: #7986CB;
    background: linear-gradient(to right, rgba(121, 134, 203, 0.05), #fff);
}


/* 私有设备标记 */
.private-badge {
    display: inline-flex;
    align-items: center;
    background: #909399;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}


.private-badge img {
    width: 12px;
    height: 12px;
    margin-right: 4px;
}


/* 鸟类图鉴瀑布流 */
.bird-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 10px;
}


.bird-item {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}


.bird-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}


.bird-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
}


.bird-info {
    padding: 6px;
    font-size: 12px;
}


/* 视频卡片 */
.video-card {
    position: relative;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}


.video-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.2s;
}


.video-card:hover img {
    opacity: 1;
}


.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}


.video-card:hover .video-play-btn {
    background: rgba(0,0,0,0.8);
    transform: translate(-50%, -50%) scale(1.1);
}


.video-play-btn img {
    width: 20px;
    height: 20px;
    margin-left: 4px;
    opacity: 1;
}


.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    padding: 8px;
    font-size: 12px;
}


/* 繁殖周期时间线 */
.cycle-timeline {
    position: relative;
    padding-left: 30px;
    margin: 20px 0;
}


.cycle-timeline::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #7986CB;
}


.cycle-item {
    position: relative;
    margin-bottom: 20px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}


.cycle-item::before {
    content: "";
    position: absolute;
    left: -25px;
    top: 14px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #7986CB;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #7986CB;
}


.cycle-item.completed::before {
    background: #4CAF50;
    box-shadow: 0 0 0 2px #4CAF50;
}


.cycle-time {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}


.cycle-title {
    font-weight: 600;
    color: #333;
}


/* 通用弹窗基础样式 */
.extend-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
}


/* 实时视频样式补充 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px 0;
}


/* 响应式适配（合并所有移动端规则，统一维护） */
@media (max-width: 768px) {
    .header { 
        flex-direction: column; 
        text-align: center; 
        gap: 10px; 
    }
    .bird-grid { 
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    }
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .extend-dialog {
        width: 90%;
        max-width: 300px;
        padding: 20px;
    }
}
