/* ============ 我的网盘 - 移动端优先 ============ */
:root{
  --primary:#4f46e5; --primary2:#6366f1; --primary-d:#4338ca;
  --bg:#f4f5fb; --card:#fff; --ink:#1e2233; --ink2:#5b6178; --mut:#9aa0b4;
  --line:#e6e8f2; --shadow:0 4px 16px rgba(30,34,51,.06);
  --safe-b:env(safe-area-inset-bottom,0px); --safe-t:env(safe-area-inset-top,0px);
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html{height:auto;min-height:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--ink);background:var(--bg);line-height:1.55;min-height:100%;overflow-x:hidden;
  padding-top:var(--safe-t);
}
.app{max-width:560px;margin:0 auto;padding-bottom:calc(24px + var(--safe-b))}

/* 顶栏 */
.topbar{
  position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:11px;
  padding:13px 16px;background:linear-gradient(135deg,#4f46e5,#6366f1);color:#fff;
  box-shadow:0 4px 18px rgba(79,70,229,.28);
}
.logo{width:38px;height:38px;border-radius:11px;background:rgba(255,255,255,.18);
  display:grid;place-items:center;font-size:22px;flex:none}
.brand{flex:1;min-width:0}
.brand b{display:block;font-size:16px;font-weight:800;letter-spacing:.3px}
.brand span{display:block;font-size:11px;color:#e0e7ff;margin-top:1px}
.icon-btn{width:38px;height:38px;border:none;border-radius:11px;background:rgba(255,255,255,.16);
  color:#fff;font-size:19px;cursor:pointer;flex:none}
.icon-btn:active{background:rgba(255,255,255,.3)}

/* 视图 */
.view{display:none;padding:14px 14px 30px;animation:fade .25s}
.view.active{display:block}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* 配额卡 */
.quota-card{background:var(--card);border-radius:16px;padding:17px 16px;box-shadow:var(--shadow);margin-bottom:14px}
.quota-top{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:12px}
.quota-label{font-size:11px;color:var(--mut);font-weight:650;letter-spacing:.3px}
.quota-num{font-size:14px;color:var(--ink2);margin-top:2px}
.quota-num b{font-size:25px;font-weight:800;color:var(--ink)}
.quota-num span{font-size:13px;color:var(--mut)}
.quota-pct{font-size:15px;font-weight:800;color:var(--primary)}
.quota-track{height:9px;background:#eef0f8;border-radius:6px;overflow:hidden}
.quota-fill{height:100%;width:0;background:linear-gradient(90deg,#4f46e5,#818cf8);
  border-radius:6px;transition:width .5s}
.quota-fill.warn{background:linear-gradient(90deg,#f59e0b,#fbbf24)}
.quota-fill.full{background:linear-gradient(90deg,#ef4444,#f87171)}
.quota-sub{display:flex;justify-content:space-between;font-size:11px;color:var(--mut);margin-top:8px}

/* 未配置提示 */
.not-config{background:#fff;border:1.5px dashed #c7d2fe;border-radius:16px;
  padding:34px 20px;text-align:center;margin-bottom:14px}
.nc-icon{font-size:40px;margin-bottom:10px}
.nc-title{font-size:16px;font-weight:800;margin-bottom:5px}
.nc-desc{font-size:12.5px;color:var(--mut);margin-bottom:16px}

/* 上传区 */
.upload-zone{background:linear-gradient(135deg,#eef2ff,#e0e7ff);border:1.5px dashed #a5b4fc;
  border-radius:16px;padding:22px 16px;text-align:center;cursor:pointer;margin-bottom:14px;transition:.2s}
.upload-zone:active{transform:scale(.98);background:#e0e7ff}
.uz-icon{width:44px;height:44px;border-radius:50%;background:#4f46e5;color:#fff;
  display:grid;place-items:center;font-size:24px;margin:0 auto 10px;box-shadow:0 4px 12px rgba(79,70,229,.3)}
.uz-title{font-size:14px;font-weight:750;color:var(--primary-d)}
.uz-desc{font-size:11.5px;color:#6366f1;margin-top:3px}

/* 工具栏 */
.toolbar{display:flex;gap:8px;margin-bottom:12px}
.search-wrap{flex:1;position:relative}
.search-ico{position:absolute;left:12px;top:50%;transform:translateY(-50%);font-size:14px;opacity:.6}
.search-wrap input{width:100%;border:1px solid var(--line);border-radius:11px;
  padding:10px 12px 10px 34px;font-size:13px;background:#fff;color:var(--ink);outline:none}
.search-wrap input:focus{border-color:#a5b4fc}
.refresh-btn{width:42px;border:1px solid var(--line);border-radius:11px;background:#fff;
  color:var(--primary);font-size:20px;cursor:pointer;flex:none}
.refresh-btn:active{background:#eef2ff}

/* 文件列表 */
.file-list{display:flex;flex-direction:column;gap:8px}
.file-item{background:#fff;border:1px solid var(--line);border-radius:13px;padding:12px;
  display:flex;align-items:center;gap:11px;box-shadow:var(--shadow)}
.f-icon{width:42px;height:42px;border-radius:11px;display:grid;place-items:center;
  font-size:20px;flex:none;background:#eef2ff}
.f-icon.img{background:#dcfce7}.f-icon.vid{background:#fef3c7}.f-icon.doc{background:#dbeafe}
.f-icon.aud{background:#fce7f3}.f-icon.zip{background:#f3e8ff}.f-icon.other{background:#f1f5f9}
.f-info{flex:1;min-width:0}
.f-name{font-size:13.5px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:6px}
.f-badge{font-size:10px;font-weight:700;color:var(--primary-d);background:#eef2ff;border:1px solid #c7d2fe;
  border-radius:5px;padding:0 5px;line-height:16px;flex:none}
.f-meta{font-size:11px;color:var(--mut);margin-top:2px}
.f-actions{display:flex;gap:5px;flex:none}
.f-act{width:32px;height:32px;border:none;border-radius:9px;display:grid;place-items:center;
  font-size:15px;cursor:pointer}
.f-act.prev{background:#eef2ff;color:var(--primary)}
.f-act.down{background:#ecfdf5;color:#059669}
.f-act.del{background:#fef2f2;color:#ef4444}
.f-act:active{transform:scale(.9)}
.empty{text-align:center;padding:40px 20px;color:var(--mut);font-size:13px}
.empty .e-ico{font-size:40px;display:block;margin-bottom:10px;opacity:.5}
.load-more{text-align:center;padding:10px}

/* 按钮 */
.btn{border:none;border-radius:11px;padding:11px 16px;font-size:13.5px;font-weight:700;
  cursor:pointer;transition:.15s}
.btn:active{transform:scale(.97)}
.btn-primary{background:var(--primary);color:#fff;box-shadow:0 4px 12px rgba(79,70,229,.25)}
.btn-ghost{background:#eef2ff;color:var(--primary-d)}
.btn-block{display:block;width:100%;margin-top:8px}
.btn-danger{background:#fef2f2;color:#ef4444}

/* ============ 配置视图 ============ */
.cfg-hero{background:linear-gradient(135deg,#3730a3,#4f46e5 55%,#6366f1);color:#fff;
  border-radius:18px;padding:22px 20px;margin-bottom:12px;box-shadow:0 8px 26px rgba(79,70,229,.28)}
.cfg-kicker{font-size:11px;letter-spacing:1.5px;color:#c7d2fe;margin-bottom:6px}
.cfg-title{font-size:22px;font-weight:800;margin-bottom:6px}
.cfg-desc{font-size:12.5px;color:#e0e7ff;line-height:1.6}
.setup{background:#fff;border:1.5px solid #c7d2fe;border-radius:16px;padding:16px;margin-bottom:12px;
  box-shadow:var(--shadow)}
.setup-head{font-size:14px;font-weight:800;color:var(--primary-d);margin-bottom:4px}
.step{padding:14px 0;border-top:1px dashed var(--line)}
.step:first-of-type{border-top:none}
.step-title{display:flex;align-items:center;gap:9px;font-size:13.5px;font-weight:750;
  color:var(--ink);margin-bottom:6px;line-height:1.4}
.step-title .n{flex:none;width:21px;height:21px;border-radius:50%;background:var(--primary);
  color:#fff;display:grid;place-items:center;font-size:11px;font-weight:800}
.step-body{font-size:12px;color:var(--ink2);line-height:1.65;margin-bottom:9px}
.code{background:#0f172a;color:#c7d2fe;border-radius:10px;padding:11px 12px;font-size:11px;
  line-height:1.6;white-space:pre-wrap;word-break:break-word;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;margin-bottom:4px}
.field{margin-bottom:11px}
.field label{display:block;font-size:11px;font-weight:750;color:var(--mut);
  letter-spacing:.3px;margin-bottom:5px}
.field input{width:100%;border:1px solid var(--line);border-radius:10px;padding:10px 11px;
  font-size:13px;background:#fff;color:var(--ink);outline:none;letter-spacing:0}
.field input:focus{border-color:#a5b4fc}
.cfg-actions{display:flex;gap:8px;margin-top:6px}
.cfg-actions .btn{flex:1}
.cfg-result{font-size:12px;margin-top:10px;line-height:1.6;display:none}
.cfg-result.ok{display:block;color:#047857;background:#ecfdf5;border-radius:9px;padding:9px 11px}
.cfg-result.err{display:block;color:#b91c1c;background:#fef2f2;border-radius:9px;padding:9px 11px}
.note{background:#fffbeb;border-left:3px solid #f59e0b;border-radius:0 10px 10px 0;
  padding:11px 13px;font-size:11.5px;color:#92400e;line-height:1.7}
.note b{display:block;margin-bottom:4px}

/* 底部弹层 */
.sheet{position:fixed;inset:0;z-index:40;background:rgba(15,23,42,.55);
  display:flex;align-items:flex-end;justify-content:center}
.sheet-inner{background:#fff;width:100%;max-width:560px;border-radius:20px 20px 0 0;
  padding:18px 16px calc(20px + var(--safe-b));max-height:85vh;overflow:auto}
.sheet-h{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.sheet-h b{font-size:16px;font-weight:800}
.sheet-close{border:none;background:#f1f5f9;width:30px;height:30px;border-radius:50%;
  font-size:16px;color:var(--ink2);cursor:pointer}
.prev-box{text-align:center}
.prev-box img{max-width:100%;max-height:55vh;border-radius:12px}
.prev-box video{max-width:100%;max-height:55vh;border-radius:12px}
.prev-name{font-size:13px;font-weight:650;margin-top:12px;word-break:break-all}
.prev-meta{font-size:11px;color:var(--mut);margin-top:3px}
.prev-actions{display:flex;gap:8px;margin-top:14px}
.prev-actions .btn{flex:1}
.confirm-text{font-size:13px;color:var(--ink2);line-height:1.7;margin-bottom:14px}

/* toast */
.toast{position:fixed;left:50%;bottom:calc(30px + var(--safe-b));transform:translateX(-50%) translateY(20px);
  background:#1e2233;color:#fff;padding:11px 18px;border-radius:22px;font-size:13px;
  z-index:60;opacity:0;pointer-events:none;transition:.3s;max-width:88%;text-align:center;
  box-shadow:0 8px 24px rgba(0,0,0,.25)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.ok{background:#047857}
.toast.err{background:#b91c1c}
