﻿/* ==========================================================================
   白夜 · 小工具抽屉 (toolbox.css)
   --------------------------------------------------------------------------
   番茄专注钟 / 今日天气 / 每日一言 / 随机景点 / 呼吸练习 的抽屉样式。
   原先内联在 base.html 中，现拆分为独立文件，便于维护。
   ========================================================================== */
    /* ---------- 遮罩层 ---------- */
    .toolbox-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1040;
    }
    .toolbox-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* ---------- 抽屉主体 ---------- */
    .toolbox-drawer {
        position: fixed;
        top: 0;
        left: 0;
        width: 340px;
        max-width: 88vw;
        height: 100vh;
        background-color: rgba(253, 246, 236, 0.96);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
        border-right: 2px solid #e8d5c4;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        overflow-y: auto;
        padding: 20px 0 40px;
    }
    .toolbox-drawer.active {
        transform: translateX(0);
    }

    .toolbox-drawer::-webkit-scrollbar {
        width: 6px;
    }
    .toolbox-drawer::-webkit-scrollbar-thumb {
        background: rgba(90, 62, 43, 0.15);
        border-radius: 3px;
    }

    /* ---------- 抽屉头部 ---------- */
    .toolbox-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 22px 16px;
        border-bottom: 2px dashed #e8d5c4;
        margin-bottom: 20px;
        position: sticky;
        top: 0;
        background: rgba(253, 246, 236, 0.98);
        z-index: 2;
    }
    .toolbox-header h5 {
        margin: 0;
        color: #5a3e2b;
        font-weight: 700;
        font-size: 1.15rem;
        letter-spacing: 1px;
    }
    .toolbox-close {
        background: none;
        border: none;
        font-size: 1.4rem;
        color: #a08a75;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 50%;
        transition: all 0.2s;
        line-height: 1;
    }
    .toolbox-close:hover {
        background-color: rgba(90, 62, 43, 0.08);
        color: #5a3e2b;
        transform: rotate(90deg);
    }

    /* ---------- 小工具卡片通用 ---------- */
    .toolbox-widget {
        margin: 0 18px 16px;
        padding: 18px 20px;
        background-color: rgba(255, 255, 255, 0.85);
        border-radius: 18px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(232, 213, 196, 0.5);
        transition: all 0.25s ease;
    }
    .toolbox-widget:hover {
        box-shadow: 0 6px 22px rgba(0, 0, 0, 0.1);
    }
    .toolbox-widget-title {
        font-size: 0.88rem;
        color: #5a3e2b;
        font-weight: 600;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* ---------- 🍅 番茄钟 ---------- */
    .pomodoro-display {
        font-size: 2.6rem;
        font-weight: 300;
        color: #2c3e50;
        text-align: center;
        letter-spacing: 3px;
        line-height: 1;
        margin: 6px 0 14px;
        font-variant-numeric: tabular-nums;
    }
    .pomodoro-buttons {
        display: flex;
        gap: 8px;
        justify-content: center;
    }
    .pomodoro-buttons button {
        border-radius: 30px;
        font-size: 0.85rem;
        padding: 6px 20px;
        border: none;
        font-weight: 600;
        transition: all 0.25s;
        cursor: pointer;
    }
    .btn-pomodoro-start {
        background: linear-gradient(135deg, #f5c842, #e8a832);
        color: #2c3e50;
        box-shadow: 0 3px 12px rgba(245, 200, 66, 0.35);
    }
    .btn-pomodoro-start:hover {
        transform: translateY(-1px);
        box-shadow: 0 5px 16px rgba(245, 200, 66, 0.5);
    }
    .btn-pomodoro-start.running {
        background: linear-gradient(135deg, #ef6c6c, #d64545);
        color: #fff;
        box-shadow: 0 3px 12px rgba(214, 69, 69, 0.35);
    }
    .btn-pomodoro-reset {
        background: rgba(90, 62, 43, 0.08);
        color: #5a3e2b;
    }
    .btn-pomodoro-reset:hover {
        background: rgba(90, 62, 43, 0.15);
    }
    .pomodoro-settings {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin-top: 14px;
        font-size: 0.82rem;
        color: #7f8c8d;
    }
    .pomodoro-settings input {
        width: 60px;
        border: 1.5px solid #e8d5c4;
        border-radius: 8px;
        padding: 4px 8px;
        font-size: 0.85rem;
        text-align: center;
        color: #2c3e50;
        background: rgba(255, 255, 255, 0.8);
        transition: all 0.2s;
    }
    .pomodoro-settings input:focus {
        outline: none;
        border-color: #f5c842;
        box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.2);
    }
    .pomodoro-count {
        text-align: center;
        font-size: 0.78rem;
        color: #7f8c8d;
        margin-top: 12px;
    }

    /* ---------- 🌤️ 天气（新版：可自选城市） ---------- */
    .weather-selector {
        margin-bottom: 12px;
    }
    .weather-selector select {
        width: 100%;
        padding: 8px 12px;
        border: 1.5px solid #e8d5c4;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.85);
        color: #2c3e50;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.2s;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 32px;
    }
    .weather-selector select:focus {
        outline: none;
        border-color: #f5c842;
        box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.2);
    }
    .weather-display {
        text-align: center;
        padding: 16px 12px;
        background: linear-gradient(135deg, rgba(255, 250, 240, 0.9), rgba(240, 248, 255, 0.9));
        border-radius: 14px;
        border: 1px solid rgba(232, 213, 196, 0.4);
    }
    .weather-display-icon {
        font-size: 3rem;
        line-height: 1;
        margin-bottom: 6px;
    }
    .weather-display-city {
        font-size: 0.95rem;
        color: #5a3e2b;
        margin-bottom: 4px;
    }
    .weather-display-temp {
        font-size: 2rem;
        font-weight: 300;
        color: #2c3e50;
        margin-bottom: 4px;
        font-variant-numeric: tabular-nums;
    }
    .weather-display-desc {
        font-size: 0.82rem;
        color: #7f8c8d;
    }
    .weather-mini-loading {
        text-align: center;
        color: #a08a75;
        font-size: 0.85rem;
        padding: 10px 0;
    }

    /* ---------- 🎲 每日一言 ---------- */
    .daily-quote-box {
        text-align: center;
        padding: 12px 8px;
        background: linear-gradient(135deg, rgba(255, 248, 235, 0.9), rgba(250, 240, 245, 0.9));
        border-radius: 12px;
        border: 1px dashed rgba(212, 192, 176, 0.6);
    }
    .daily-quote-text {
        font-size: 0.95rem;
        color: #2c3e50;
        line-height: 1.8;
        font-style: italic;
        margin-bottom: 8px;
    }
    .daily-quote-author {
        font-size: 0.78rem;
        color: #a08a75;
        letter-spacing: 1px;
    }

    /* ---------- ✈️ 随机景点 ---------- */
    .random-spot-box {
        text-align: center;
        padding: 8px 0;
    }
    .random-spot-emoji {
        font-size: 2.4rem;
        line-height: 1;
        margin-bottom: 6px;
    }
    .random-spot-name {
        font-size: 1.05rem;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 2px;
    }
    .random-spot-country {
        font-size: 0.75rem;
        color: #7f8c8d;
        letter-spacing: 1px;
        margin-bottom: 8px;
    }
    .random-spot-desc {
        font-size: 0.82rem;
        color: #5a6b7b;
        line-height: 1.6;
        padding: 0 4px;
        margin-bottom: 12px;
    }
    .btn-random-spot {
        background: linear-gradient(135deg, #6ba8e8, #4a7fc1);
        color: #fff;
        border: none;
        font-weight: 600;
        padding: 7px 22px;
        border-radius: 30px;
        font-size: 0.82rem;
        cursor: pointer;
        transition: all 0.25s;
        box-shadow: 0 3px 12px rgba(106, 168, 232, 0.3);
    }
    .btn-random-spot:hover {
        transform: translateY(-1px);
        box-shadow: 0 5px 16px rgba(106, 168, 232, 0.5);
    }

    /* ---------- 🌬️ 呼吸练习 ---------- */
    .breath-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px 0 4px;
    }
    .breath-circle {
        width: 90px;
        height: 90px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(106, 168, 232, 0.5), rgba(106, 168, 232, 0.15));
        border: 2px solid rgba(106, 168, 232, 0.5);
        transition: all 4s ease-in-out;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #2c3e50;
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 14px;
        box-shadow: 0 0 30px rgba(106, 168, 232, 0.2);
    }
    .breath-circle.inhale {
        transform: scale(1.4);
        background: radial-gradient(circle, rgba(245, 200, 66, 0.55), rgba(245, 200, 66, 0.15));
        border-color: rgba(245, 200, 66, 0.6);
        box-shadow: 0 0 40px rgba(245, 200, 66, 0.35);
    }
    .breath-circle.hold {
        transform: scale(1.4);
        background: radial-gradient(circle, rgba(168, 200, 106, 0.55), rgba(168, 200, 106, 0.15));
        border-color: rgba(168, 200, 106, 0.6);
        box-shadow: 0 0 40px rgba(168, 200, 106, 0.35);
    }
    .breath-circle.exhale {
        transform: scale(0.9);
        background: radial-gradient(circle, rgba(200, 150, 200, 0.5), rgba(200, 150, 200, 0.15));
        border-color: rgba(200, 150, 200, 0.6);
    }
    .btn-breath {
        background: linear-gradient(135deg, #a8d8e8, #6ba8e8);
        color: #fff;
        border: none;
        font-weight: 600;
        padding: 7px 22px;
        border-radius: 30px;
        font-size: 0.82rem;
        cursor: pointer;
        transition: all 0.25s;
        box-shadow: 0 3px 12px rgba(106, 168, 232, 0.3);
    }
    .btn-breath:hover {
        transform: translateY(-1px);
        box-shadow: 0 5px 16px rgba(106, 168, 232, 0.5);
    }

    /* ---------- 底部提示 ---------- */
    .toolbox-hint {
        margin: 20px 18px;
        padding: 14px;
        text-align: center;
        font-size: 0.8rem;
        color: #a08a75;
        border: 1px dashed #e8d5c4;
        border-radius: 14px;
    }

