/* 日期显示模块 */
.date-clock {
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.clock {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.clock-face {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.clock-number {
    position: absolute;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.clock-12 {
    top: 10px;
}

.clock-3 {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.clock-6 {
    bottom: 10px;
}

.clock-9 {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.clock-center {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff6b6b;
    z-index: 10;
}

.clock-hand {
    position: absolute;
    background: #333;
    transform-origin: bottom center;
    border-radius: 2px;
}

.hour-hand {
    width: 3px;
    height: 26px;
    top: 29px;
    background: #333;
    z-index: 5;
}

.minute-hand {
    width: 2px;
    height: 40px;
    top: 15px;
    background: #666;
    z-index: 6;
}

.second-hand {
    width: 1px;
    height: 44px;
    top: 11px;
    background: #ff6b6b;
    z-index: 7;
}

.clock-day {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    font-family: '微软雅黑', 'Microsoft YaHei', sans-serif;
}

/* 快捷功能（垂直下移由 .home-top-row margin-top 承担） */
.quick-functions {
    display: grid;
    grid-template-columns: repeat(2, var(--home-quick-btn-size, 70px));
    grid-template-rows: repeat(2, var(--home-quick-btn-size, 70px));
    gap: var(--home-quick-btn-gap, 12px);
    width: calc(var(--home-quick-btn-size, 70px) * 2 + var(--home-quick-btn-gap, 12px));
    max-width: 100%;
    flex-shrink: 1;
    min-width: 0;
    margin-top: 0;
    justify-content: center;
}

/* 锁屏（今日一句弹窗等）：已迁至 lock-screen.css */
/* 磁贴容器透明化：玻璃方块只包图标（.function-icon），名称独立在方块下方，
   自定义图标铺满方块时不再挤压名称占位 */
.function-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: var(--home-quick-btn-size, 70px);
    height: var(--home-quick-btn-size, 70px);
    max-width: var(--home-quick-btn-size, 70px);
    min-width: var(--home-quick-btn-size, 70px);
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease;
    box-shadow: none;
    box-sizing: border-box;
}

.function-item:hover {
    transform: translateY(-2px);
}

.function-item:hover .function-icon {
    background: linear-gradient(135deg, rgba(252, 251, 249, 0.92) 0%, rgba(244, 241, 234, 0.88) 50%, rgba(250, 248, 244, 0.92) 100%);
    box-shadow: 0 14px 26px rgba(96, 88, 74, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* 编辑杂志风：暖米白玻璃方块 + 极细墨线描边（磨砂 blur 保持不变） */
.function-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(250, 249, 246, 0.9) 0%, rgba(240, 236, 228, 0.86) 50%, rgba(247, 245, 240, 0.9) 100%);
    box-shadow: 0 10px 22px rgba(96, 88, 74, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(28, 28, 28, 0.09);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-sizing: border-box;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.function-icon img {
    width: 32px;
    height: 32px;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    object-fit: contain;
}

/* 自定义上传图标：自动贴合按钮形状——铺满图标区 + cover，圆角与按钮一致。 */
.function-icon.theme-icon-wrap--custom,
.nav-icon.theme-icon-wrap--custom,
.sub-screen-action-icon.theme-icon-wrap--custom {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: calc(var(--home-quick-btn-size, 70px) - 20px);
    margin-bottom: 1px;
    border-radius: 11px;
    background: transparent;
}

/* 主屏/子屏玻璃方块：自定义图标铺满整颗 52×52 方块（名称在方块外，不受挤压） */
.function-icon.theme-icon-wrap--custom,
.sub-screen-action-icon.theme-icon-wrap--custom {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    max-height: 52px;
    margin-bottom: 0;
    border-radius: 15px;
}

.function-icon img.theme-icon-img--custom,
.nav-icon img.theme-icon-img--custom,
.sub-screen-action-icon-img.theme-icon-img--custom {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    object-fit: cover;
    -webkit-object-fit: cover;
    object-position: center;
    padding: 0;
    box-sizing: border-box;
    border-radius: inherit;
    transform: none;
}

/* Love咪猫系轻拟物默认图标：整颗图标已包含按钮面板与光影，避免和旧玻璃底板重复叠加。 */
.lovemi-preset-icon-wrap:not(.theme-icon-wrap--custom) {
    overflow: hidden !important;
    padding: 0 !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.lovemi-preset-icon-wrap:not(.theme-icon-wrap--custom) .lovemi-preset-icon-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    object-fit: cover !important;
    object-position: center;
    border-radius: inherit !important;
    transform: none !important;
}

/* 有自定义图标时略收内边距，让贴图更接近整颗按钮大小（仅底栏；主屏磁贴已是透明容器无内边距） */
.nav-item:has(.theme-icon-wrap--custom) {
    padding: 4px 4px 3px;
}

.function-item:has(.theme-icon-wrap--custom) {
    padding: 0;
}

.function-name {
    flex: 0 0 auto;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(28, 28, 28, 0.78);
    margin-top: 0;
    text-align: center;
    /* 名称直接落在壁纸上：加强白色柔光保证可读性 */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6), 0 0 8px rgba(255, 255, 255, 0.4);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 底部导航 */
.bottom-nav {
    position: absolute;
    bottom: max(16px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    left: 0;
    right: 0;
    width: min(360px, calc(100% - 28px));
    max-width: calc(100% - 28px);
    margin-inline: auto;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(8px, 3vw, 16px);
    padding: 8px 10px;
    background: linear-gradient(135deg, rgba(250, 249, 246, 0.9) 0%, rgba(240, 236, 228, 0.86) 48%, rgba(247, 245, 240, 0.9) 100%);
    border-radius: 26px;
    box-shadow: 0 12px 28px rgba(96, 88, 74, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0.88;
    border: 1px solid rgba(28, 28, 28, 0.09);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    padding: 6px 5px 5px;
    border-radius: 16px;
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
    position: relative;
    flex: 0 0 auto;
    width: var(--home-quick-btn-size, 70px);
    height: var(--home-quick-btn-size, 70px);
    max-width: var(--home-quick-btn-size, 70px);
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(0.97);
    opacity: 0.95;
}

@media (hover: hover) and (pointer: fine) {
    .nav-item:hover {
        background: rgba(255, 255, 255, 0.22);
        transform: translateY(-2px);
    }
}

.nav-icon {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    max-height: calc(var(--home-quick-btn-size, 70px) - 24px);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    transition: all 0.3s ease;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-icon img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.nav-name {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(28, 28, 28, 0.62);
    transition: color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .nav-item:hover .nav-name {
        color: rgba(28, 28, 28, 0.82);
    }
}
