/* ============================================
   蛋薯机 DanShu Pro v2 — widgets.css
   ============================================ */

/* ========== 通用 Widget ========== */
.widget {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: visible;
}

/* ========================================
   大卡片
   ======================================== */
.widget-card {
    padding: 20px;
    min-height: 140px;
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: visible;
}

.card-color-btn {
    position: absolute;
    top: 12px;
    left: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
    color: #fff;
}

.card-color-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.card-color-picker {
    position: absolute;
    top: 46px;
    left: 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    padding: 8px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    max-width: 180px;
}

.card-color-picker.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.color-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-dot.active {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-custom-input {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
}

.color-custom-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-custom-input::-webkit-color-swatch { border: none; border-radius: 50%; opacity: 0; }

.card-content {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    padding-top: 8px;
}

.card-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    color: #ffdde7;
    line-height: 1.6;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.card-text-box {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-text {
    font-size: 12px;
    color: #ffdde7;
    line-height: 1.7;
    letter-spacing: 0.3px;
}

.card-right { flex-shrink: 0; }

.card-image-box {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: border-color 0.3s ease;
}

.card-image-box:hover { border-color: rgba(255, 255, 255, 0.7); }

.card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-image-hint {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    text-align: center;
    font-size: 9px;
    padding: 4px 0;
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-image-box:hover .card-image-hint { opacity: 1; }

/* ========================================
   倒数日小组件
   ======================================== */
.widget-countdown {
    padding: 18px 20px;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.countdown-top {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    z-index: 1;
}

.cd-label {
    font-size: 11px;
    color: rgba(120, 100, 110, 0.7);
    letter-spacing: 1px;
}

.cd-days-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.cd-days-num {
    font-size: 44px;
    font-weight: 700;
    color: rgba(80, 60, 70, 0.9);
    line-height: 1;
}

.cd-days-unit {
    font-size: 15px;
    font-weight: 400;
    color: rgba(100, 80, 90, 0.7);
}

.countdown-bottom {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    z-index: 1;
}

.cd-title {
    font-size: 12px;
    font-weight: 500;
    color: rgba(80, 60, 70, 0.85);
}

.cd-date {
    font-size: 10px;
    color: rgba(120, 100, 110, 0.6);
    letter-spacing: 0.5px;
}

.cd-deco {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 18px;
    color: #f8a4b8;
    opacity: 0.5;
    animation: float-heart 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes float-heart {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-4px) scale(1.1); }
}

/* ========================================
   聊天气泡组件
   ======================================== */
.widget-chat-bubble {
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
}

.bubble-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.bubble-left {
    flex-direction: row;
    padding-right: 40px;
}

.bubble-right {
    flex-direction: row;
    justify-content: flex-end;
    padding-left: 40px;
}

.bubble-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: border-color 0.3s ease;
    background: #ffd6e0;
}

.bubble-avatar:hover { border-color: rgba(255, 255, 255, 0.85); }

.bubble-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bubble-avatar img[src=""] { display: none; }

.bubble-glass {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    padding: 10px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    max-width: 100%;
}

.bubble-left .bubble-glass { border-bottom-left-radius: 6px; }
.bubble-right .bubble-glass { border-bottom-right-radius: 6px; }

.bubble-text {
    font-size: 12px;
    color: rgba(80, 60, 70, 0.9);
    line-height: 1.5;
    letter-spacing: 0.3px;
    display: block;
}

.bubble-text:focus {
    outline: 1px dashed rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}


/* ========================================
   纪念日设置 App 全屏面板
   ======================================== */
.cd-app-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cd-app-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cd-app-panel {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}

.cd-app-overlay.show .cd-app-panel {
    transform: translateY(0);
}

/* 顶栏 */
.cd-app-header {
    height: 56px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cd-app-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(80, 60, 70, 0.8);
}

.cd-app-back:hover {
    background: rgba(255, 255, 255, 0.45);
    transform: scale(1.08);
}

.cd-app-back svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cd-app-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(80, 60, 70, 0.9);
    letter-spacing: 0.5px;
}

.cd-app-save {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    border-radius: 20px;
    background: rgba(248, 164, 184, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cd-app-save:hover {
    background: rgba(248, 164, 184, 0.85);
    transform: scale(1.05);
}

.cd-app-save svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 滚动内容区 */
.cd-app-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 每个独立毛玻璃板块 */
.cd-app-section {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.cd-app-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(80, 60, 70, 0.8);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.cd-app-section-title svg {
    fill: none;
    stroke: rgba(248, 164, 184, 0.8);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* 输入框 */
.cd-app-field {
    margin-bottom: 10px;
}

.cd-app-field:last-child {
    margin-bottom: 0;
}

.cd-app-field label {
    display: block;
    font-size: 11px;
    color: rgba(100, 80, 90, 0.6);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.cd-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 13px;
    color: rgba(80, 60, 70, 0.9);
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.cd-input:focus {
    border-color: rgba(248, 164, 184, 0.6);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(248, 164, 184, 0.15);
}

.cd-input-short {
    width: auto;
    flex: 1;
    min-width: 0;
}

/* 实时预览卡片 */
.cd-preview-card {
    position: relative;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.3s ease;
}

.cd-preview-top {
    display: flex;
    flex-direction: column;
    gap: 1px;
    position: relative;
    z-index: 1;
}

.cd-preview-label {
    font-size: 10px;
    color: rgba(120, 100, 110, 0.7);
    letter-spacing: 1px;
}

.cd-preview-days-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.cd-preview-days {
    font-size: 36px;
    font-weight: 700;
    color: rgba(80, 60, 70, 0.9);
    line-height: 1;
}

.cd-preview-unit {
    font-size: 13px;
    color: rgba(100, 80, 90, 0.7);
}

.cd-preview-bottom {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    z-index: 1;
}

.cd-preview-title {
    font-size: 11px;
    font-weight: 500;
    color: rgba(80, 60, 70, 0.85);
}

.cd-preview-date {
    font-size: 9px;
    color: rgba(120, 100, 110, 0.6);
    letter-spacing: 0.5px;
}

.cd-preview-deco {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 16px;
    color: #f8a4b8;
    opacity: 0.5;
    z-index: 1;
}

/* 色块行 */
.cd-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.cd-color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2.5px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.cd-color-dot:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.cd-color-dot.active {
    border-color: rgba(80, 60, 70, 0.7);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 2px 10px rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

/* 色号输入行 */
.cd-color-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cd-color-native {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cd-color-native::-webkit-color-swatch-wrapper { padding: 0; }
.cd-color-native::-webkit-color-swatch { border: none; border-radius: 50%; opacity: 0; }

/* 字体提示 */
.cd-font-hint {
    font-size: 10px;
    color: rgba(120, 100, 110, 0.5);
    margin-top: 6px;
    letter-spacing: 0.2px;
}

/* 背景模式切换 */
.cd-bg-mode-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.cd-bg-mode-btn {
    flex: 1;
    padding: 8px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: rgba(80, 60, 70, 0.6);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.25s ease;
}

.cd-bg-mode-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.cd-bg-mode-btn.active {
    background: rgba(248, 164, 184, 0.45);
    border-color: rgba(248, 164, 184, 0.5);
    color: rgba(80, 60, 70, 0.9);
    box-shadow: 0 2px 10px rgba(248, 164, 184, 0.2);
}

/* 上传按钮 */
.cd-bg-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.3);
    border: 1.5px dashed rgba(180, 160, 170, 0.4);
    font-size: 12px;
    color: rgba(100, 80, 90, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.cd-bg-upload-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(248, 164, 184, 0.5);
    color: rgba(80, 60, 70, 0.8);
}

.cd-bg-upload-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 背景图预览 */
.cd-bg-preview-wrap {
    margin-top: 14px;
}

.cd-bg-preview-label {
    font-size: 11px;
    color: rgba(100, 80, 90, 0.6);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.cd-bg-preview-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.05);
    position: relative;
}

.cd-bg-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    object-position: center;
}

/* 位置调整滑块 */
.cd-bg-pos-controls {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cd-pos-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cd-pos-row label {
    font-size: 11px;
    color: rgba(100, 80, 90, 0.6);
    white-space: nowrap;
    min-width: 56px;
}

.cd-pos-row span {
    font-size: 11px;
    color: rgba(100, 80, 90, 0.5);
    min-width: 32px;
    text-align: right;
}

.cd-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: rgba(200, 180, 190, 0.3);
    outline: none;
}

.cd-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(248, 164, 184, 0.85);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.cd-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(248, 164, 184, 0.85);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* 危险区 - 清除按钮 */
.cd-section-danger {
    background: rgba(255, 200, 200, 0.25) !important;
    border-color: rgba(255, 150, 150, 0.3) !important;
}

.cd-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.25);
    font-size: 13px;
    font-weight: 500;
    color: rgba(200, 60, 60, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cd-clear-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    transform: scale(1.02);
}

.cd-clear-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
