*{margin:0;padding:0;box-sizing:border-box;font-family:"Noto Sans SC Rounded","MiSans Rounded","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;}
body{background-color:#f3efe6;color:#222;line-height:1.6;padding:16px;max-width:720px;margin:0 auto;}
body.drag-lock{
    touch-action: pan-y;
}
header{text-align:center;margin-bottom:24px;position:relative;}
#hamburgerBtn{
    width:36px;
    height:36px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:4px;
    cursor:pointer;
    border-radius:8px;
    z-index:10;
}
#hamburgerBtn span{
    width:18px;
    height:2px;
    background:#333;
    border-radius:1px;
    pointer-events:none;
}
.category-dropdown{
    position:absolute;
    right: 0;
    top: 100%;
    margin-top:4px;
    background:#fff;
    border:1px solid #f0b888;
    border-radius:12px;
    z-index:30;
    width:90px;
    display:none;
    overflow:hidden;
}
.category-dropdown.open{
    display:block;
}
.category-item{
    padding:8px 10px;
    cursor:pointer;
    font-size:13px;
    text-align:center;
}
.category-item.active{
    background:#f9e9d8;
    color:#e67e22;
}
.category-item:hover{
    background:#f7efe3;
}
h1{font-size:24px;font-weight:600;margin-bottom:6px;color:#1d2129;}
.tip-text{color:#666;font-size:13px;}
.search-wrap{
    position:relative;
    margin-bottom:20px;
    display:flex;
    gap:8px;
    align-items:center;
}
#kw{
    flex:1;
    padding:12px 40px 12px 14px;
    border:1px solid #f0b888;
    border-radius:16px;
    font-size:15px;
    outline:none;
    transition:0.24s;
    background:#fff;
}
#kw:active{background:#f9e9d8;}
#kw:focus{border-color:#e67e22;box-shadow:0 2px 10px rgba(0,0,0,0.05);}
.clear-kw{
    position:absolute;
    right: 78px;
    top:50%;
    transform: translateY(-50%);
    font-size:18px;
    color:#999;
    cursor:pointer;
    display:none;
    user-select:none;
}
.clear-kw.show{
    display:block;
}
#searchBtn{padding:12px 16px;border-radius:16px;border:none;background:#e67e22;color:#fff;font-size:14px;cursor:pointer;transition:0.24s;}
#searchBtn:active{opacity:0.9;}
.top-bar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;gap:10px;flex-wrap:wrap;}
.btn{padding:10px 14px;border-radius:16px;border:1px solid #f0b888;background:#fff;color:#222;font-size:14px;cursor:pointer;transition:0.24s;user-select:none;}
.btn:active{background:#f9e9d8;}
.btn:hover{border-color:#e67e22;box-shadow:0 2px 8px rgba(0,0,0,0.04);}
.source-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;position:relative;}
.source-card{background:#f3efe6;border:1px solid #f0b888;border-radius:16px;padding:14px;text-align:center;position:relative;transition:0.24s;cursor:pointer;user-select: none;-webkit-user-select: none;}
.source-card:active{transform: translateY(-2px);box-shadow: 0 4px 10px #d9cdbc77;}
.source-card:hover{box-shadow:0 3px 12px rgba(0,0,0,0.05);transform:translateY(-1px);}
.source-card.dragging{opacity:0.4;}
.visitor-tag{
    position:absolute;
    right:6px;
    bottom:4px;
    font-size:10px;
    color:#999;
    pointer-events:none;
}
.source-card .card-name{font-size:14px;color:#1d2129;}
.drag-ghost{
    position:fixed;
    pointer-events:none;
    z-index:9999;
    background:#f3efe6;
    border:1px solid #e67e22;
    border-radius:16px;
    padding:14px;
    opacity:0.8;
    transform:translate(-50%,-50%);
}
.card-ops{
    position:absolute;
    top:4px;
    left:4px;
    right:4px;
    display:none;
    gap:4px;
    z-index:20;
    pointer-events:auto;
    justify-content:space-between;
}
.card-ops.show{
    display:flex;
}
.opt-btn{
    font-size:11px;
    padding:2px 5px;
    border-radius:4px;
    border:none;
    color:#fff;
    cursor:pointer;
}
.edit{background:#4080ff;}
.del{background:#f53f3f;}
.mask{position:fixed;inset:0;background:rgba(0,0,0,0.35);display:none;align-items:center;justify-content:center;z-index:99;}
.mask.open{display:flex;}
.modal{width:90%;max-width:420px;background:#fff;border-radius:18px;padding:20px;border:1px solid #e5e6eb;box-shadow:0 6px 24px rgba(0,0,0,0.07);}
.modal h3{font-size:17px;margin-bottom:14px;color:#1d2129;}
.modal .limit-tip{font-size:13px;color:#666;margin-bottom:12px;}
.modal input{width:100%;padding:11px 13px;border:1px solid #e5e6eb;border-radius:16px;margin-bottom:12px;font-size:14px;outline:none;transition:0.2s;}
.modal input:focus{border-color:#e67e22;}
.modal select{padding:11px 8px;border:1px solid #e5e6eb;border-radius:16px;margin-bottom:12px;font-size:14px;outline:none;transition:0.2s;}
.modal select:focus{border-color:#e67e22;}
.modal .input-row{display:flex;gap:8px;}
.modal .input-row input{flex:1;margin-bottom:12px;}
.modal .input-row select{width:110px;margin-bottom:12px;}
.modal .btn-group{display:flex;gap:8px;justify-content:flex-end;margin-top:8px;}
.pwd-wrap {
  display: flex;
  align-items: center;
  position: relative;
}
.pwd-wrap input{
    padding-right:44px;
    margin-bottom:12px;
}
.pwd-eye {
  position: absolute;
  right: 12px;
  top: 14px;
  font-size: 18px;
  line-height:1;
}
.toast{position:fixed;bottom:60px;left:50%;transform:translateX(-50%);background:#222;color:#fff;padding:9px 18px;border-radius:9px;font-size:14px;display:none;z-index:100;white-space:nowrap;}
.toast.show{display:block;}
footer{margin-top:36px;padding-top:16px;border-top:1px solid #e5e6eb;text-align:center;color:#666;font-size:13px;}
#debugBox{margin-top:20px;background:#111;color:#0f0;padding:10px;font-size:11px;white-space:pre-wrap;max-height:220px;overflow-y:auto;}
.modal .btn:disabled {
    background: #eeeeee !important;
    color: #aaaaaa !important;
    border-color: #dddddd !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}
