@font-face {
    font-family: "MyDefaultFont";
    src: url("./font/by-default.ttf") format("truetype");
    font-display: block;
}
*,*::before,*::after {
    font-family: "MyDefaultFont", system-ui, sans-serif !important;
    box-sizing: border-box !important;
}
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: "MyDefaultFont", system-ui, sans-serif !important;
}
body{
    padding-bottom: 80px;
}
button, input, textarea, select, option, optgroup,
::placeholder, .toast-item span, svg text {
    font-family: inherit !important;
}
/* HTML仅预留默认背景链接 */
body {
    background-image: url("./bg/bg1.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.glass-card {
    background-color: rgba(255,255,255,0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.45);
}
.btn-upload { background-color:#4ade80; color:#111; }
.btn-gallery { background-color:#60a5fa; color:#fff; }
.btn-bgset { background-color:#f472b6; color:#fff; }
.btn-mine { background-color:#fbbf24; color:#111; }
.btn-clear { background-color:#f87171; color:#fff; }
.btn-copy { background-color:#a78bfa; color:#fff; }
.btn-logout { background-color:#ef4444; color:#fff; }
.btn-login-go { background-color:#3b82f6; color:#fff; }
.progress-wrap {
    width:100%;
    height:10px;
    background:rgba(0,0,0,0.15);
    border-radius:999px;
    overflow:hidden;
}
.progress-bar {
    height:100%;
    width:0%;
    background:linear-gradient(90deg,#4ade80,#22d3ee);
    transition: width 0.15s linear;
}
.progress-text{
    text-align:right;
    font-size:13px;
    margin-bottom:4px;
    font-variant-numeric: tabular-nums;
}
.drawer-mask {
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.4);
    z-index:40;
    opacity:0;
    pointer-events:none;
    transition:opacity 0.25s ease;
}
.drawer-mask.open {
    opacity:1;
    pointer-events:auto;
}
.drawer-panel {
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    width:260px;
    z-index:50;
    transform:translateX(-100%);
    transition:transform 0.28s ease-out;
}
.drawer-panel.open {
    transform:translateX(0);
}
.page-item {
    display:none;
}
.page-item.active {
    display:block;
}
.gallery-item{
    transition: transform 0.2s ease;
    cursor: pointer;
}
.gallery-item:hover{
    transform: scale(1.02);
}
/* 云端选中卡片高亮边框 */
.gallery-item.cloud-selected{
    border:3px solid #ef4444 !important;
}
.toast-container{
    position:fixed;
    top:16px;
    right:16px;
    z-index:9999;
    display:flex;
    flex-direction:column;
    gap:10px;
    pointer-events:none;
}
.toast-item{
    pointer-events:auto;
    width:320px;
    max-width:calc(100vw - 32px);
    padding:12px 14px;
    border-radius:10px;
    box-shadow:0 4px 14px rgba(0,0,0,0.18);
    transform: translateX(120%);
    transition: transform 0.22s ease-out;
    display:flex;
    align-items:center;
    gap:10px;
    will-change: transform;
}
.toast-item.show{
    transform: translateX(0);
}
.toast-item.hide{
    transform: translateX(120%);
}
.toast-success{ background:rgba(167,243,208,0.85); }
.toast-error{ background:rgba(254,202,202,0.85); }
.toast-warn{ background:rgba(254,240,138,0.85); }
.toast-info{ background:rgba(224,231,255,0.85); }
.image-detail-modal{
    position:fixed;
    inset:0;
    z-index:9991;
    background:rgba(0,0,0,0.88);
    display:none;
    overflow-y:auto;
    padding:16px;
}
.image-detail-modal.open{
    display:flex;
    align-items:center;
    justify-content:center;
}
.detail-card{
    position: relative;
    width:100%;
    max-width:620px;
    background:#ffffffdd;
    border-radius:14px;
    padding:20px;
    padding-bottom: 48px;
    flex-shrink:0;
}
.detail-img{
    max-width:100%;
    max-height:60vh;
    display:block;
    margin:0 auto 16px;
    cursor:zoom-in;
}
.detail-row{
    display:flex;
    gap:8px;
    margin-top:10px;
    flex-wrap:wrap;
}
.detail-row input{
    flex:1;
    min-width:180px;
    padding:8px 10px;
    border-radius:6px;
    border:1px solid #ccc;
}
.detail-row button,.detail-row a{
    padding:8px 14px;
    border-radius:6px;
    border:none;
    text-decoration:none;
    color:#fff;
    display:flex;
    align-items:center;
    gap:4px;
}
.btn-download{ background:#10b981; }
.detail-float-close {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    color: #1f2937;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.detail-float-close:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.22);
}
.image-preview-modal{
    position:fixed;
    inset:0;
    z-index:9999;
    background:rgba(0,0,0,0.92);
    display:none;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}
.image-preview-modal.open{
    display:flex;
}
.preview-img{
    max-width:95vw;
    max-height:95vh;
    object-fit:contain;
    cursor:grab;
    will-change: transform;
    transition: none;
}
.preview-img:active{
    cursor:grabbing;
}
.pending-item-box{
    position:relative;
}
.pending-del-btn{
    position:absolute;
    top:-6px;
    right:-6px;
    width:22px;
    height:22px;
    border-radius:50%;
    background:#ef4444;
    color:#fff;
    border:none;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    z-index:10;
    padding:0;
}
.drop-area-disabled{
    pointer-events: none !important;
    opacity:0.45 !important;
}
.hidden-dom{
    display:none !important;
}
.mine-avatar{
    width:80px;
    height:80px;
    border-radius:50%;
    object-fit:cover;
    border:2px solid #4ade80;
}
/* iOS风格开关 */
.toggle-wrap{
    display:inline-flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink:0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cccccc;
    border-radius: 28px;
    transition: 0.32s ease;
}
.toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    box-shadow:0 1px 3px rgba(0,0,0,0.18);
    transition: transform 0.32s ease;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: #4ade80;
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}
/* 背景设置页面：分组小标题 */
.bg-type-title{
    font-size:16px;
    font-weight:bold;
    margin:20px 0 10px;
}
.bg-item-btn{
    padding:0;
    border:none;
    border-radius:8px;
    overflow:hidden;
    background:transparent;
}
.bg-item-preview{
    width:100%;
    height:72px;
    object-fit:cover;
    display:block;
}
.bg-item-name{
    font-size:12px;
    padding:4px 0;
}
/* 底部悬浮删除操作栏 */
.cloud-select-bar{
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    z-index:80;
    background:rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding:12px 16px;
    box-shadow:0 -2px 12px rgba(0,0,0,0.12);
    display:none;
}
.cloud-select-bar.open{
    display:flex;
    gap:12px;
    justify-content:center;
}
/* 头部用户组件 桌面端：昵称左，头像右，透明底板 */
.header-user-wrap{
    background:transparent;
}
.header-avatar-box{
    width:36px;
    height:36px;
    position:relative;
}
.header-avatar{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
    border:2px solid #ffffff;
    display:none;
}
.header-avatar-svg{
    width:100%;
    height:100%;
    border-radius:50%;
    border:2px solid #ffffff;
    display:block;
}
.header-username{
    white-space:nowrap;
}

/* 手机抽屉标题 */
.drawer-title{
    font-family:"MyDefaultFont",system-ui,sans-serif;
}

/* 手机侧边抽屉底部用户卡片 */
.drawer-user-wrap{
    flex-shrink:0;
    border-radius:16px;
}
.drawer-divider{
    width:100%;
    height:1px;
    background:rgba(255,255,255,0.20);
    margin:12px 0;
}
.drawer-avatar-box{
    width:36px;
    height:36px;
    position:relative;
}
.drawer-avatar{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
    border:2px solid #ffffff;
    display:none;
}
.drawer-avatar-svg{
    width:100%;
    height:100%;
    border-radius:50%;
    border:2px solid #ffffff;
    display:block;
}
.drawer-username{
    white-space:nowrap;
    font-family:"MyDefaultFont",system-ui,sans-serif;
}
.drawer-setting-icon{
    opacity:0.7;
    flex-shrink:0;
}
.drawer-desc-text{
    line-height:1.45;
    opacity:0.55;
    font-size:0.78rem;
    font-family:"MyDefaultFont",system-ui,sans-serif;
}
/* 页面切换过渡动画 */
.page-item {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.24s ease, transform 0.24s ease;
    pointer-events: none;
    display: none;
}
.page-item.active {
    display: block;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}
.page-item.fade-out {
    opacity: 0;
    transform: translateY(8px);
}
