/* ===================================
   wishtree.css — 心想事成 独立沉浸式界面
   专属全屏 overlay + 玻璃质感 + 多层次深度
   不复用共享卡片系统
   =================================== */

/* ============ 全屏 Overlay ============ */
.wt-overlay {
    position: fixed; inset: 0; z-index: 55;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.4s ease;
}
.wt-overlay.active { opacity: 1; }

/* 背景：暗色渐变 + 模糊遮罩 */
.wt-backdrop {
    position: absolute; inset: 0;
    background: linear-gradient(155deg,
        rgba(30,20,40,0.88) 0%,
        rgba(40,25,50,0.85) 40%,
        rgba(20,15,35,0.9) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ============ 主面板 ============ */
.wt-panel {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 1000px;
    max-height: 92vh;
    margin: 20px 0;
    padding: 36px 40px 28px;
    background:
        linear-gradient(170deg,
            rgba(255,252,248,0.97) 0%,
            rgba(255,248,240,0.95) 30%,
            rgba(253,242,232,0.97) 100%);
    border-radius: 28px;
    box-shadow:
        0 2px 6px rgba(0,0,0,0.06),
        0 8px 24px rgba(0,0,0,0.1),
        0 24px 60px rgba(0,0,0,0.18),
        0 0 0 1px rgba(255,255,255,0.6) inset,
        0 0 0 2px rgba(255,215,0,0.15),
        0 0 80px rgba(255,183,197,0.12);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.wt-overlay.active .wt-panel {
    transform: translateY(0) scale(1);
}

/* 滚动条美化 */
.wt-panel::-webkit-scrollbar { width: 6px; }
.wt-panel::-webkit-scrollbar-track { background: transparent; }
.wt-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }

/* ============ 关闭按钮 ============ */
.wt-close {
    position: absolute; top: 16px; right: 20px;
    z-index: 5;
    width: 40px; height: 40px;
    border: none; border-radius: 50%;
    background: rgba(0,0,0,0.06);
    font-size: 1.2rem; color: #999;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.wt-close:hover {
    background: rgba(255,107,122,0.12);
    color: #e0606a;
    transform: rotate(90deg);
}

/* 心愿单按钮（左上角） */
.wt-wishlist-btn {
    position: absolute; top: 16px; left: 20px;
    z-index: 5;
    padding: 8px 16px;
    border: 1px solid #e0d8e8;
    border-radius: 20px;
    background: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem; font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.25s ease;
}
.wt-wishlist-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-dark-purple);
    background: #fffde8;
}
.wt-wishlist-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--color-pink);
    color: #fff;
    font-size: 0.72rem; font-weight: 700;
    line-height: 1.2;
}

/* ============ 标题 ============ */
.wt-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.8rem; font-weight: 800;
    color: #5C4B6B;
    text-align: center;
    margin-bottom: 6px;
}
.wt-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem; font-weight: 500;
    color: #9a8ea0;
    text-align: center;
    margin-bottom: 24px;
}

/* ============ 分类 Tab 栏 ============ */
.wt-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
    padding: 6px;
    background: rgba(0,0,0,0.025);
    border-radius: 16px;
    flex-wrap: wrap;
}
.wt-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 16px;
    border: none; border-radius: 12px;
    background: transparent;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem; font-weight: 600;
    color: #9a8ea0;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.wt-tab:hover { color: #6C5B7B; background: rgba(255,255,255,0.6); }
.wt-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #C7CEEA, #B5A0D8);
    box-shadow: 0 4px 14px rgba(180,160,210,0.4);
}
.wt-tab-icon { font-size: 1rem; }

/* ============ 子选项网格 ============ */
.wt-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 4px 0;
}

.wt-card {
    position: relative;
    width: 85px;
    min-height: 48px;
    padding: 12px 7px 10px;
    background: #fff;
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    box-shadow:
        0 1px 4px rgba(0,0,0,0.05),
        0 0 0 1px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}
.wt-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 6px 18px rgba(0,0,0,0.1),
        0 0 0 1px rgba(255,183,197,0.3),
        0 0 20px rgba(255,183,197,0.08);
}
/* 有备注的卡片左侧金色标记 */
.wt-card.has-note::before {
    content: '';
    position: absolute; top: 4px; left: 4px;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--color-gold);
}

/* 卡片图标 */
.wt-card-icon {
    display: block;
    font-size: 1.25rem;
    line-height: 1.2;
    margin-bottom: 4px;
}
.wt-card-text {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.78rem; font-weight: 600;
    color: #4A3F50;
    word-break: break-word;
    line-height: 1.3;
}
.wt-card-note {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.62rem; color: #bbb;
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 卡片操作按钮（hover 显示） */
.wt-card-edit, .wt-card-del {
    position: absolute;
    top: -6px;
    width: 22px; height: 22px;
    border: 2px solid #fff; border-radius: 50%;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 2;
}
.wt-card-edit { right: 18px; background: #C7CEEA; color: #fff; }
.wt-card-del  { right: -6px;  background: #FFB7C5; color: #fff; }
.wt-card:hover .wt-card-edit,
.wt-card:hover .wt-card-del { opacity: 1; }
.wt-card-edit:hover, .wt-card-del:hover { transform: scale(1.15); }

/* 已加入心愿单：打勾 + 金色边框 */
.wt-card.picked {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05), 0 0 0 2px rgba(255,215,0,0.4);
}
.wt-card-check {
    position: absolute; top: 6px; left: 8px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--color-gold);
    color: #fff;
    font-size: 0.7rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
}

/* 心愿单列表项 */
.wt-wish-list {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 12px;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
}
.wt-wish-list::-webkit-scrollbar { width: 5px; }
.wt-wish-list::-webkit-scrollbar-track { background: transparent; }
.wt-wish-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
.wt-wish-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: #fdf9f0; border-radius: 12px;
    text-align: left;
}
.wt-wish-item-icon { font-size: 1.3rem; flex-shrink: 0; }
.wt-wish-item-text {
    flex: 1;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.92rem; font-weight: 600;
    color: var(--color-dark);
}
.wt-wish-item-del {
    width: 26px; height: 26px;
    border: none; border-radius: 50%;
    background: rgba(0,0,0,0.06);
    font-size: 0.7rem; color: #bbb;
    cursor: pointer; flex-shrink: 0;
    transition: all 0.2s ease;
}
.wt-wish-item-del:hover { background: #FFB7C5; color: #fff; }

/* ============ 添加按钮 ============ */
.wt-add-wrap { text-align: center; margin-top: 16px; }
.wt-add {
    width: 48px; height: 48px;
    border: 3px dashed var(--color-gold); border-radius: 50%;
    background: transparent;
    color: var(--color-gold);
    font-size: 1.6rem; font-weight: 700; line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}
.wt-add:hover {
    background: linear-gradient(135deg, #FFD700, #FFB7C5);
    color: #fff; border-style: solid; border-color: transparent;
    transform: rotate(90deg);
    box-shadow: 0 6px 20px rgba(255,183,197,0.35);
}

/* ============ 空状态 ============ */
.wt-empty {
    text-align: center; padding: 40px 0;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem; color: #bbb;
}

/* ============ 模态弹窗（详情/编辑器） ============ */
.wt-modal {
    position: absolute; inset: 0; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.wt-modal.active { opacity: 1; }

.wt-modal-mask {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.3);
    border-radius: 28px;
}

.wt-modal-dialog {
    position: relative; z-index: 1;
    background: #fff;
    border-radius: 20px;
    padding: 30px 28px 22px;
    width: 90%;
    max-width: 440px;
    box-shadow:
        0 8px 30px rgba(0,0,0,0.15),
        0 0 0 1px rgba(0,0,0,0.05);
    animation: wt-pop 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes wt-pop {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.wt-modal-close {
    position: absolute; top: 12px; right: 16px;
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    background: rgba(0,0,0,0.05);
    font-size: 1rem; color: #999;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.wt-modal-close:hover { background: rgba(0,0,0,0.1); color: #333; }

/* ---- 详情弹窗 ---- */
.wt-detail-dialog { text-align: center; }
.wt-detail-cat {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    background: #f0e8f8;
    color: #6C5B7B;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem; font-weight: 700;
    margin-bottom: 10px;
}
.wt-detail-icon { font-size: 3.5rem; line-height: 1.2; margin: 6px 0; }
.wt-detail-name {
    font-family: 'Nunito', sans-serif;
    font-size: 1.45rem; font-weight: 800;
    color: #5C4B6B;
    margin: 8px 0 10px;
}
.wt-detail-note {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem; color: #4A3F50;
    line-height: 1.7;
    margin: 10px 0 18px;
    padding: 14px 16px;
    background: #fdf9f0;
    border-radius: 12px;
    border-left: 3px solid var(--color-gold);
    text-align: left; word-break: break-word;
}
.wt-detail-note-empty { color: #ccc; font-style: italic; border-left-color: #e0e0e0; background: #fafafa; }
.wt-detail-edit-btn {
    display: inline-block;
    margin: 0 auto;
    padding: 10px 24px;
    border: none; border-radius: 24px;
    background: linear-gradient(135deg, #C7CEEA, #FFB7C5);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem; font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(199,206,234,0.35);
}
.wt-detail-edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(199,206,234,0.5);
}

/* ---- 编辑器 ---- */
.wt-editor-dialog { max-width: 480px; }

.wt-editor-label {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem; font-weight: 700;
    color: #6C5B7B;
    margin-bottom: 6px;
}
.wt-editor-input {
    width: 100%; padding: 11px 14px;
    border: 2px solid #e8e0f0; border-radius: 10px;
    font-size: 0.95rem; font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.wt-editor-input:focus { border-color: #FFB7C5; }

.wt-editor-textarea {
    width: 100%; padding: 11px 14px;
    border: 2px solid #e8e0f0; border-radius: 10px;
    font-size: 0.93rem; font-family: inherit;
    box-sizing: border-box; resize: vertical;
    margin-bottom: 18px;
    outline: none;
    transition: border-color 0.2s;
}
.wt-editor-textarea:focus { border-color: #FFB7C5; }

.wt-editor-btns {
    display: flex; gap: 12px; justify-content: flex-end;
}
.wt-editor-cancel {
    padding: 10px 22px;
    border: 1px solid #ddd; border-radius: 24px;
    background: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem; font-weight: 600;
    color: #999; cursor: pointer;
    transition: all 0.2s ease;
}
.wt-editor-cancel:hover { background: #f5f5f5; color: #666; }
.wt-editor-save {
    padding: 10px 26px;
    border: none; border-radius: 24px;
    background: linear-gradient(135deg, #C7CEEA, #FFB7C5);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(199,206,234,0.35);
    transition: all 0.25s ease;
}
.wt-editor-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(199,206,234,0.5);
}

/* ---- 编辑器内图标选择 ---- */
.wt-icon-row {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: #faf8fc;
    border-radius: 10px;
    border: 1px solid #e8e0f0;
}
.wt-icon-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem; font-weight: 700;
    color: #6C5B7B;
}
.wt-icon-cur { font-size: 1.5rem; line-height: 1; }
.wt-icon-toggle {
    margin-left: auto;
    padding: 4px 14px;
    border: 1px solid #d8cce8; border-radius: 16px;
    background: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 0.78rem; font-weight: 600;
    color: #999; cursor: pointer;
    transition: all 0.2s ease;
}
.wt-icon-toggle:hover { border-color: #FFB7C5; color: #6C5B7B; background: #fff5f8; }

.wt-icon-picker {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-bottom: 14px;
    max-height: 170px; overflow-y: auto;
    padding: 6px;
    background: #faf8fc; border-radius: 10px;
    border: 1px solid #e8e0f0;
}
.wt-ic-group {
    width: 100%;
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem; font-weight: 700;
    color: #bbb;
    padding: 4px 2px 0;
    margin-top: 4px;
    border-top: 1px solid #eee;
}
.wt-ic-group:first-of-type { border-top: none; margin-top: 0; }

.wt-ic-btn {
    width: 36px; height: 36px;
    border: 2px solid transparent; border-radius: 8px;
    background: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0; line-height: 1;
}
.wt-ic-btn:hover { border-color: #FFB7C5; background: #fff5f7; transform: scale(1.1); }
.wt-ic-btn.selected {
    border-color: #FFD700;
    background: #fffde8;
    box-shadow: 0 0 0 2px rgba(255,215,0,0.25);
}
.wt-ic-none { font-size: 0.85rem; color: #ddd; }
.wt-ic-none:hover { color: #999; background: #f5f5f5; }
.wt-ic-none.selected { color: #999; background: #f0f0f0; border-color: #ccc; }

/* ============ 响应式 ============ */
@media (max-width: 700px) {
    .wt-panel {
        width: 96%;
        padding: 24px 16px 20px;
        border-radius: 20px;
        max-height: 95vh;
    }
    .wt-title { font-size: 1.4rem; }
    .wt-tab { padding: 8px 12px; font-size: 0.8rem; gap: 3px; }
    .wt-tab-icon { font-size: 0.85rem; }
    .wt-grid { gap: 10px; }
    .wt-card { width: 74px; min-height: 42px; padding: 10px 5px 8px; border-radius: 12px; }
    .wt-card-icon { font-size: 1.1rem; }
    .wt-card-text { font-size: 0.7rem; }
    .wt-card-note { font-size: 0.58rem; }
    .wt-card-edit, .wt-card-del { width: 20px; height: 20px; font-size: 0.55rem; }
    .wt-card-edit { right: 15px; }
    .wt-card-del  { right: -5px; }
    .wt-modal-dialog { max-width: 340px; padding: 22px 16px 16px; }
    .wt-detail-icon { font-size: 2.8rem; }
    .wt-detail-name { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .wt-panel { width: 100%; border-radius: 16px; margin: 0; max-height: 100vh; }
    .wt-tab { padding: 7px 10px; font-size: 0.75rem; }
    .wt-grid { gap: 8px; }
    .wt-card { width: 66px; min-height: 38px; padding: 8px 4px 6px; border-radius: 10px; }
    .wt-card-icon { font-size: 1rem; }
    .wt-card-text { font-size: 0.66rem; }
    .wt-card-note { font-size: 0.55rem; }
}
