/* home.css - 新首页样式 */

/* ===== 头部 ===== */
.home-header {
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.home-header .title {
    font-size: 28px;
    font-weight: bold;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-header .title .emoji {
    font-size: 32px;
}

.home-header .sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.home-header .sub .date {
    color: var(--text-hint);
}

.home-header .sub .theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 14px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

.home-header .sub .theme-toggle:active {
    background: var(--bg-hover);
}

/* ===== 今日计划卡片 ===== */
.today-plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.today-plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-accent);
}

.today-plan-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.today-plan-card .card-header .label {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
}

.today-plan-card .card-header .label .badge {
    font-size: 12px;
    font-weight: normal;
    padding: 2px 10px;
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-hint);
    margin-left: 8px;
}

.today-plan-card .card-header .status {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: bold;
}

.today-plan-card .card-header .status.active {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-accent);
}

.today-plan-card .card-header .status.waiting {
    background: rgba(33, 150, 243, 0.2);
    color: var(--color-info);
}

.today-plan-card .card-header .status.done {
    background: rgba(255, 152, 0, 0.2);
    color: var(--color-warning);
}

/* 计划详情 */
.plan-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 14px;
}

.plan-detail .item {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 14px;
    color: var(--text-secondary);
}

.plan-detail .item .num {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 16px;
}

/* 进度条 */
.plan-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.plan-progress .pbar-bg {
    flex: 1;
    height: 8px;
    background: var(--progress-bg);
    border-radius: 4px;
    overflow: hidden;
}

.plan-progress .pbar-fill {
    height: 100%;
    background: var(--progress-bar);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.plan-progress .pbar-text {
    font-size: 13px;
    color: var(--text-hint);
    font-family: monospace;
    min-width: 44px;
    text-align: right;
}

/* 计划操作按钮 */
.plan-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.plan-actions .btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    height: auto;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.plan-actions .btn-primary {
    background: var(--color-accent);
    color: #000;
}

.plan-actions .btn-primary:active {
    background: #388E3C;
}

.plan-actions .btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.plan-actions .btn-outline:active {
    background: var(--bg-hover);
}

.plan-actions .btn-info {
    background: var(--color-info);
    color: #fff;
}

.plan-actions .btn-info:active {
    background: #1976D2;
}

/* 无计划状态 */
.no-plan {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}

.no-plan .big-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.no-plan .btn-create {
    margin-top: 16px;
    padding: 10px 28px;
    background: var(--color-accent);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.no-plan .btn-create:active {
    background: #388E3C;
}

/* ===== 快速词库切换 ===== */
.quick-libs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.quick-libs .lib-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.quick-libs .lib-chip:active {
    background: var(--color-accent);
    color: #000;
    border-color: var(--color-accent);
}

.quick-libs .lib-chip.active {
    background: var(--color-accent);
    color: #000;
    border-color: var(--color-accent);
}

/* ===== 功能网格 ===== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.feature-grid .f-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.feature-grid .f-item:active {
    background: var(--bg-hover);
    transform: scale(0.96);
}

.feature-grid .f-item .icon {
    font-size: 28px;
    display: block;
    margin-bottom: 4px;
}

.feature-grid .f-item .label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: bold;
}

.feature-grid .f-item .sub-label {
    font-size: 10px;
    color: var(--text-muted);
}

/* ===== 底部 ===== */
.home-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .home-header .title {
        font-size: 22px;
    }
    
    .home-header .title .emoji {
        font-size: 26px;
    }
    
    .feature-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .feature-grid .f-item {
        padding: 12px 4px;
    }
    
    .feature-grid .f-item .icon {
        font-size: 22px;
    }
    
    .feature-grid .f-item .label {
        font-size: 11px;
    }
    
    .plan-detail {
        gap: 10px 16px;
        font-size: 13px;
    }
    
    .plan-actions .btn {
        font-size: 13px;
        padding: 6px 14px;
    }
    
    .today-plan-card {
        padding: 14px 16px;
    }
    
    .quick-libs {
        gap: 6px;
    }
    
    .quick-libs .lib-chip {
        font-size: 12px;
        padding: 4px 10px;
    }
}

@media (max-width: 360px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 在 home.css 中添加 */

.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-area .user-name {
    font-size: 13px;
    color: var(--color-accent);
    font-weight: bold;
}

.user-area .user-name a {
    color: var(--color-accent);
    text-decoration: none;
}

.user-area .user-name a:active {
    color: #388E3C;
}

#logout-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 14px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}

#logout-btn:active {
    background: var(--bg-hover);
}

@media (max-width: 480px) {
    .user-area .user-name {
        font-size: 12px;
    }
    #logout-btn {
        font-size: 11px;
        padding: 3px 10px;
    }
}

/* 首页标题加强 */
.home-header .title {
    font-size: 28px;
    font-weight: bold;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-header .title .emoji {
    font-size: 32px;
}

/* 添加日式装饰线 */
.home-header {
    padding: 20px 0 16px;
    border-bottom: 2px solid var(--color-accent);
    margin-bottom: 20px;
    position: relative;
}

.home-header::after {
    content: '◆ ◇ ◆ ◇ ◆';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-hint);
    letter-spacing: 4px;
    background: var(--bg-primary);
    padding: 0 12px;
}

/* ===== 计划滑动模块 ===== */
.plan-slider-wrapper {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    padding: 0;
}

.plan-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}

.plan-slider .slider-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.plan-slider .slider-track .slide-item {
    flex: 0 0 100%;
    min-width: 100%;
    padding: 18px 20px;
    box-sizing: border-box;
}

/* 去除滑动卡片的外边框（因为外层已经有了） */
.plan-slider .slider-track .today-plan-card {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    background: transparent;
}

.plan-slider .slider-track .today-plan-card::before {
    display: none;
}

/* 导航区域 */
.slider-navs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-input);
}

/* 中间区域（计数器 + 圆点） */
.slider-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.slider-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.slider-nav:active {
    background: var(--color-accent);
    color: #000;
    transform: scale(0.92);
}

.slider-nav:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* 计数器（移到导航区域） */
.slider-counter {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-hint);
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* 圆点指示器 */
.slider-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--border-color);
    cursor: pointer;
    transition: 0.3s;
    padding: 0;
    flex-shrink: 0;
}

.slider-dots .dot.active {
    background: var(--color-accent);
    transform: scale(1.25);
}

.slider-dots .dot:active {
    transform: scale(0.85);
}

/* 触摸设备优化 */
@media (hover: none) {
    .slider-nav:active {
        background: var(--color-accent);
        color: #000;
    }
}

/* 响应式 */
@media (max-width: 480px) {
    .slider-navs {
        gap: 10px;
        padding: 8px 12px 12px;
    }
    
    .slider-nav {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .slider-dots .dot {
        width: 8px;
        height: 8px;
    }
    
    .slider-counter {
        font-size: 11px;
    }
    
    .plan-slider .slider-track .slide-item {
        padding: 14px 16px;
    }
}