*{box-sizing:border-box;margin:0;padding:0}
body{font-family:"Microsoft YaHei",system-ui,sans-serif;background:#f4f6fb;color:#222;min-height:100vh}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:14px 22px;background:#1f2937;color:#fff;position:sticky;top:0;z-index:10;gap:12px;flex-wrap:wrap}
.logo{font-size:20px;font-weight:700}.logo span{font-size:13px;font-weight:400;color:#9ca3af;margin-left:8px}
.top-actions{display:flex;gap:8px;align-items:center}
.top-actions input,.top-actions select{padding:8px 12px;border-radius:8px;border:1px solid #374151;background:#111827;color:#fff;outline:none}
.top-actions input{width:260px}
.btn{padding:8px 14px;border-radius:8px;border:none;background:#e5e7eb;cursor:pointer;font-size:14px}
.btn.primary{background:#2563eb;color:#fff}.btn.danger{background:#ef4444;color:#fff}
.btn.ghost{background:transparent;color:inherit;border:1px solid #6b7280}
.btn.small{padding:6px 10px;font-size:13px}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;padding:16px 22px}
.stat-card{background:#fff;border-radius:12px;padding:14px;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.stat-num{font-size:20px;font-weight:700}.stat-label{font-size:12px;color:#6b7280;margin-top:4px}
.layout{display:grid;grid-template-columns:250px 1fr;gap:16px;padding:0 22px 30px}
.sidebar{background:#fff;border-radius:12px;padding:16px;height:fit-content;position:sticky;top:76px}
.sidebar h3{font-size:15px;margin-bottom:10px}
.cat-list{display:flex;flex-wrap:wrap;gap:8px}
.chip{padding:6px 12px;border-radius:20px;border:1px solid #d1d5db;background:#f9fafb;cursor:pointer;font-size:13px}
.chip.active{background:#2563eb;color:#fff;border-color:#2563eb}
.chip .del{margin-left:6px;color:#ef4444;cursor:pointer}
.cat-add{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.cat-add input{padding:7px 10px;border:1px solid #d1d5db;border-radius:8px;font-size:13px}
.hint{margin-top:14px;background:#f3f4f6;border-radius:8px;padding:10px;font-size:12px;color:#4b5563}.hint p{margin-top:6px;line-height:1.6}
.content{min-width:0}
.dropzone{background:#fff;border:2px dashed #93c5fd;border-radius:12px;padding:22px;text-align:center;margin-bottom:14px;transition:.2s}
.dropzone.dragover{background:#eff6ff;border-color:#2563eb}
.dz-title{font-size:16px}.dz-sub{font-size:12px;color:#6b7280;margin-top:6px}
.upload-progress{margin-top:10px;font-size:13px;color:#2563eb}
.file-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px}
.file-card{background:#fff;border-radius:12px;padding:12px;box-shadow:0 1px 4px rgba(0,0,0,.08);cursor:pointer;transition:.15s}
.file-card:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.12)}
.file-icon{font-size:34px;text-align:center;padding:8px}
.file-icon svg{display:inline-block;vertical-align:middle}
.file-icon.big svg{width:72px;height:72px}
.file-name{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-sub{font-size:12px;color:#6b7280;margin-top:4px;display:flex;gap:6px;flex-wrap:wrap}
.badge{background:#eef2ff;color:#3730a3;border-radius:6px;padding:1px 7px;font-size:11px}
.badge.t-文档{background:#ecfdf5;color:#065f46}.badge.t-视频{background:#fef2f2;color:#991b1b}
.badge.t-音频{background:#fffbeb;color:#92400e}.badge.t-图片{background:#eff6ff;color:#1e40af}
.empty{text-align:center;color:#9ca3af;padding:40px;display:none}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;z-index:50;padding:16px}
.modal.hidden{display:none}
.modal-box{background:#fff;border-radius:14px;width:640px;max-width:100%;max-height:90vh;overflow:auto}
.modal-box.small{width:440px}
.modal-head{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid #eee}
.m-preview{padding:16px;text-align:center;max-height:340px;overflow:auto;background:#f9fafb}
.m-preview img,.m-preview video{max-width:100%;max-height:300px;border-radius:8px}
.m-form{padding:16px;display:flex;flex-direction:column;gap:10px}
.m-form label{font-size:14px;display:flex;flex-direction:column;gap:6px}
.m-form input,.m-form select{padding:8px 10px;border:1px solid #d1d5db;border-radius:8px}
.m-meta{font-size:12px;color:#6b7280}
.m-btns{display:flex;gap:8px;flex-wrap:wrap}
.bulkbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;background:#fff;border-radius:12px;padding:10px 12px;margin-bottom:12px;box-shadow:0 1px 4px rgba(0,0,0,.08);font-size:13px}
.bulkbar.hidden{display:none}
.bulkbar input,.bulkbar select{padding:6px 10px;border:1px solid #d1d5db;border-radius:8px;font-size:13px}
.bulkbar input#bulkTags{width:160px}
.file-card{position:relative}
.file-check{position:absolute;top:8px;left:8px;width:18px;height:18px;cursor:pointer}
.file-card.selected{outline:2px solid #2563eb}
.file-snippet{font-size:11px;color:#92400e;background:#fffbeb;border-radius:6px;padding:4px 6px;margin-top:6px;line-height:1.5;word-break:break-all}
.file-tags{font-size:11px;color:#3730a3;margin-top:4px;word-break:break-all}
.privacy-badge{font-size:12px;color:#a7f3d0;border:1px solid #059669;border-radius:20px;padding:4px 10px;white-space:nowrap}
.mini-hint{font-size:11px;color:#9ca3af;font-weight:400}
.audit-list{max-height:260px;overflow:auto;background:#f9fafb;border-radius:8px;padding:8px;font-size:12px}
.audit-row{display:flex;gap:8px;padding:4px 0;border-bottom:1px solid #eee;flex-wrap:wrap}
.gate-tabs{display:flex;gap:8px}
.gate-msg{font-size:13px;min-height:18px}
@media(max-width:800px){.layout{grid-template-columns:1fr}.sidebar{position:static}.top-actions input{width:150px}}

/* ===== 平板 ===== */
@media(max-width:900px){
  .layout{grid-template-columns:1fr}
  .sidebar{position:static}
  .content{order:-1} /* 手机/平板先看到上传和文件 */
  .file-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
}

/* ===== 手机 ===== */
@media(max-width:640px){
  .topbar{padding:10px 12px}
  .logo{font-size:17px}
  .top-actions{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .top-actions input,.top-actions select{width:100%;font-size:14px}
  #searchInput{grid-column:1/-1}
  .privacy-badge{grid-column:1/-1;text-align:center}
  .top-actions .btn{padding:9px 6px;font-size:13px}
  .stats{grid-template-columns:1fr 1fr;padding:10px 12px;gap:8px}
  .layout{padding:0 12px 24px;gap:10px}
  .file-grid{grid-template-columns:1fr 1fr;gap:8px}
  .file-card{padding:8px}
  .file-icon{padding:4px}
  .file-icon svg{width:36px;height:36px}
  .file-name{font-size:13px}
  .file-sub{font-size:11px}
  .file-check{width:22px;height:22px} /* 手指好点 */
  .bulkbar{font-size:12px}
  .bulkbar input#bulkTags{width:100%}
  .modal{padding:0}
  .modal-box{width:100%;max-height:100vh;height:100%;border-radius:0}
  .modal-box.small{width:100%}
  .m-preview{max-height:38vh}
  .m-btns .btn{flex:1;padding:10px 4px;font-size:13px;min-height:44px} /* 44px 触控标准 */
  .dropzone{padding:16px 10px}
}

/* ---- 下载按钮状态(默认/下载中/完成/失败), 与 .btn 主色系一致 ---- */
.btn.is-downloading{opacity:.75;cursor:progress}
.btn.is-done{background:#16a34a;color:#fff}
.btn.is-error{background:#ef4444;color:#fff}
.btn:disabled{cursor:not-allowed}
.btn .spin{display:inline-block;width:13px;height:13px;border:2px solid rgba(0,0,0,.25);border-top-color:currentColor;border-radius:50%;vertical-align:-2px;margin-right:6px;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.btn .spin{animation:none}}
.btn:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

.file-tags{font-size:12px;color:#374151;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-summary{font-size:12px;color:#4c1d95;background:#f5f3ff;border-radius:6px;padding:3px 7px;margin-top:5px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.m-summary{background:#f5f3ff;border-left:3px solid #7c3aed;border-radius:0 8px 8px 0;padding:8px 12px;font-size:13px;color:#374151;line-height:1.6;margin-bottom:10px}
.m-preview{max-height:380px}

/* ---- AI 内容审核区(管理员) ---- */
.review-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:6px;border-radius:9px;background:#ef4444;color:#fff;font-size:11px;font-weight:600;line-height:1}
.review-badge.hidden{display:none}
.review-row{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid #e5e7eb;border-radius:10px;margin-bottom:8px;background:#fff}
.rr-main{min-width:0;flex:1}
.rr-name{cursor:pointer;color:#2563eb;font-weight:600;word-break:break-all}
.rr-name:hover{text-decoration:underline}
.rr-main .badge{margin-left:6px}
.rr-meta{font-size:12px;color:#6b7280;margin-top:4px}
.rr-reason{font-size:12px;color:#92400e;background:#fef3c7;border-radius:6px;padding:4px 8px;margin-top:6px;display:inline-block;line-height:1.5}
.rr-btns{display:flex;flex-direction:column;gap:6px;flex-shrink:0}
@media(max-width:640px){
  .review-row{flex-direction:column}
  .rr-btns{flex-direction:row;width:100%}
  .rr-btns .btn{flex:1;min-height:40px}
}

/* ---- ICP 备案页脚 ---- */
.site-footer { text-align: center; padding: 20px 0 28px; font-size: 12px; color: #9aa4b2; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #4a5568; text-decoration: underline; }
