:root{
  --ink:#102033;--navy:#0b1a2b;--muted:#667085;--muted2:#8b95a5;--line:#e8e2d7;
  --paper:#fffdf8;--bg:#f3f0e9;--teal:#0f766e;--copper:#c46f45;--red:#d92d4f;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;color:var(--ink);background:radial-gradient(circle at 5% 0%,rgba(15,118,110,.055),transparent 28%),radial-gradient(circle at 96% 8%,rgba(196,111,69,.055),transparent 26%),var(--bg);font-family:"Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}
button{font:inherit}
.wrap{width:min(1480px,calc(100% - 56px));margin:0 auto}
.hero{position:relative;color:#f8fafc;overflow:hidden;border-radius:0 0 30px 30px;background:radial-gradient(circle at 86% 0%,rgba(20,184,166,.22),transparent 34%),radial-gradient(circle at 10% 100%,rgba(196,111,69,.2),transparent 38%),linear-gradient(135deg,#0a1929,#10253b 58%,#0d1e30)}
.hero::before{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px);background-size:72px 72px;mask-image:linear-gradient(110deg,#000,transparent 72%);-webkit-mask-image:linear-gradient(110deg,#000,transparent 72%);pointer-events:none}
.hero-inner{position:relative;padding:24px 0 70px}
.hero .wrap{position:relative;padding:24px 0 70px}
.hero-top{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:32px}
.brand{display:flex;align-items:center;gap:9px;color:#a9bacd;font-size:9px;font-weight:700;letter-spacing:.19em;text-transform:uppercase}
.brand i{width:6px;height:6px;border-radius:50%;background:#2dd4bf;box-shadow:0 0 0 5px rgba(45,212,191,.12)}
.brand span{opacity:.35}
.hero-actions{display:flex;align-items:center;gap:8px}
.server-badge{display:inline-flex;align-items:center;gap:5px;font-size:8px;border:1px solid rgba(94,234,212,.22);background:rgba(45,212,191,.08);color:#99f6e4;padding:7px 9px;border-radius:999px;white-space:nowrap}
.server-badge i{width:5px;height:5px;border-radius:50%;background:#2dd4bf}
.edit-toggle{appearance:none;display:inline-flex;align-items:center;text-decoration:none;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.05);color:#dbe7f1;border-radius:999px;padding:7px 11px;font-size:9px;font-weight:600;cursor:pointer;white-space:nowrap}
.edit-toggle:hover{background:rgba(255,255,255,.1)}
.edit-toggle.on{background:#fffdf8;color:#102033;border-color:#fffdf8}
.hero-main{display:flex;align-items:flex-end;justify-content:space-between;gap:30px}
.kicker{color:#d8b08f;font-size:10px;font-weight:700;letter-spacing:.2em;margin-bottom:10px}
h1{margin:0;font-size:clamp(36px,4.4vw,60px);letter-spacing:-.04em;line-height:1.08}
.hero p{margin:13px 0 0;color:#aebdce;font-size:12px;line-height:1.7;max-width:680px}
.stats{display:flex;gap:24px;flex:0 0 auto;padding-bottom:2px}
.stats div{text-align:right}
.stats b{display:block;font-family:"Bahnschrift","Segoe UI",sans-serif;font-size:28px;font-weight:600;line-height:1}
.stats span{display:block;margin-top:5px;font-size:9px;color:#93a6b9}
main{position:relative;padding-bottom:28px}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:rgba(255,253,248,.95);border:1px solid rgba(255,255,255,.9);border-radius:20px;box-shadow:0 18px 50px rgba(16,32,51,.08);padding:14px;margin-top:-36px;position:relative;z-index:2}
.search{position:relative;flex:1 1 340px;max-width:600px}
.search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:15px;height:15px;color:#9aa3b1}
.search input{width:100%;border:1px solid #e1dbcf;background:#fff;border-radius:10px;padding:11px 12px 11px 36px;font-size:11px;color:var(--ink);outline:none}
.search input:focus{border-color:#0f766e;box-shadow:0 0 0 3px rgba(15,118,110,.08)}
.toolbar-right{display:flex;gap:7px;flex-wrap:wrap}
.btn{appearance:none;border-radius:8px;padding:9px 12px;font-size:10px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;transition:.2s}
.btn.primary{border:1px solid #0f766e;background:#0f766e;color:#fff;box-shadow:0 5px 14px rgba(15,118,110,.16)}
.btn.primary:hover{background:#0b5f59}
.btn.ghost{border:1px solid #ded7ca;background:#fff;color:#5b6472}
.btn.ghost:hover{background:#f7f4ed}
.btn.danger{border:1px solid #f0d3d8;background:#fff;color:#b42342}
.btn.danger:hover{background:#fff1f2}
.btn:focus-visible,.icon-btn:focus-visible,.cat:focus-visible,.edit-toggle:focus-visible{outline:2px solid #0f766e;outline-offset:2px}
.cats{display:flex;gap:7px;flex-wrap:wrap;padding:17px 2px 13px}
.cat{appearance:none;border:1px solid #e3ddd1;background:#fffdf8;color:#697483;border-radius:999px;padding:7px 10px;font-size:10px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:6px;transition:.2s;white-space:nowrap}
.cat:hover{background:#fff;border-color:#cdc5b7;color:var(--ink)}
.cat.active{background:#102033;border-color:#102033;color:#fff;box-shadow:0 5px 14px rgba(16,32,51,.14)}
.cat i{width:6px;height:6px;border-radius:50%;background:var(--c)}
.cat b{font-family:"Bahnschrift","Segoe UI",sans-serif;font-size:9px;font-weight:600;opacity:.6}
.cat.active b{opacity:.9}
.table-card{background:var(--paper);border:1px solid var(--line);border-radius:20px;box-shadow:0 14px 44px rgba(16,32,51,.055);overflow:hidden}
.table-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;border-bottom:1px solid #eee9df}
.table-head h2{margin:0;font-size:15px;letter-spacing:-.01em}
.table-head p{margin:4px 0 0;font-size:9px;color:var(--muted2)}
.count{font-size:10px;color:#7e8897;white-space:nowrap}
.table-scroll{overflow:auto;max-height:calc(100vh - 300px);min-height:340px}
table{width:100%;border-collapse:separate;border-spacing:0;min-width:1280px}
th{position:sticky;top:0;z-index:2;background:#f8f5ef;color:#7e8794;text-align:left;font-size:9px;font-weight:700;letter-spacing:.05em;padding:10px 11px;border-bottom:1px solid #e9e3d8;white-space:nowrap}
th .th-filter{display:flex;align-items:center;gap:5px}
th .th-filter select{appearance:none;border:1px solid #ddd6c9;background:#fff;color:#596472;border-radius:5px;font-size:8px;padding:3px 18px 3px 5px;max-width:110px;outline:none}
td{padding:10px 11px;border-bottom:1px solid #f2ede4;vertical-align:middle;font-size:10px;color:#4b5563}
tbody tr:hover td{background:#fcfaf6}
.group-row td{background:#f6f3ec;color:#6f7885;font-size:9px;font-weight:700;letter-spacing:.05em;padding:8px 12px;border-top:1px solid #ebe5db}
.group-row b{font-family:"Bahnschrift","Segoe UI",sans-serif;color:#0f766e;margin-left:5px}
.thumb{width:48px;height:48px;padding:0;border:1px solid #e7e1d6;border-radius:8px;background:#f4f1eb;overflow:hidden;display:grid;place-items:center;cursor:pointer;color:#aaa397;font-size:8px}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb:hover{border-color:#b9d8cd;box-shadow:0 3px 10px rgba(15,118,110,.1)}
.cat-badge{display:inline-flex;align-items:center;gap:5px;font-size:9px;font-weight:700;padding:4px 6px;border-radius:6px;background:var(--bgc);color:var(--fgc);white-space:nowrap}
.cat-badge i{width:5px;height:5px;border-radius:50%;background:currentColor}
.cust b{display:block;color:#2f3a48;font-weight:700;font-size:10px;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cust span{display:block;margin-top:3px;color:#a09a8f;font-size:8px}
.code{font-family:"Bahnschrift","Consolas","Segoe UI",sans-serif;font-size:9.5px;color:#3f4a59;line-height:1.45}
.code.wide{max-width:240px;white-space:normal;word-break:break-word}
.code.mold{color:#0f5f58;font-weight:700;white-space:nowrap}
.date{font-family:"Bahnschrift","Segoe UI",sans-serif;font-size:9px;color:#697483;white-space:nowrap}
.attach-count{display:inline-flex;align-items:center;gap:4px;color:#697483;font-size:9px}
.attach-count b{font-family:"Bahnschrift","Segoe UI",sans-serif;color:#0f766e}
.folder-cell{max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#8a94a3;font-size:8px}
.row-actions{display:flex;gap:4px;align-items:center;flex-wrap:nowrap}
.mini{appearance:none;border:1px solid #e2dccf;background:#fff;color:#5f6b7a;border-radius:6px;padding:5px 6px;font-size:8px;font-weight:700;cursor:pointer;white-space:nowrap}
.mini:hover{background:#f7f4ed;color:var(--ink);border-color:#cfc6b8}
.mini.primary{color:#0f766e;border-color:#cfe3dd;background:#f2f8f5}
.mini.purple{color:#6b4bb5;border-color:#e4dbf7;background:#f7f4ff}
.icon-btn{width:28px;height:28px;padding:0;border:1px solid #e5ded2;border-radius:7px;background:#fff;display:grid;place-items:center;cursor:pointer;color:#697483}
.icon-btn:hover{background:#f7f4ed;color:var(--ink)}
.icon-btn.del:hover{background:#fff1f2;border-color:#f0d3d8;color:#b42342}
.icon-btn svg{width:13px;height:13px}
.empty{padding:60px 20px;text-align:center;color:#9a9489;font-size:11px}
.page-footer{display:flex;justify-content:space-between;gap:18px;padding:20px 3px 0;color:#979186;font-size:9px}
.page-footer b{color:#4b5563;font-weight:600}
.edit-only{display:none!important}
body.editing .edit-only{display:inline-flex!important}

/* modal */
.overlay{position:fixed;inset:0;background:rgba(6,18,30,.5);backdrop-filter:blur(3px);z-index:70}
.modal{position:fixed;left:50%;top:50%;transform:translate(-50%,-47%);width:min(820px,calc(100vw - 24px));max-height:calc(100vh - 30px);background:#fffdf8;border-radius:16px;z-index:75;box-shadow:0 30px 90px rgba(6,18,30,.32);display:flex;flex-direction:column;opacity:0;pointer-events:none;transition:.25s ease;border:1px solid #e8e1d5}
.modal.open{opacity:1;pointer-events:auto;transform:translate(-50%,-50%)}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:20px 22px 15px;border-bottom:1px solid #eee9df;flex:0 0 auto}
.eyebrow{font-size:8px;font-weight:700;letter-spacing:.16em;color:#0f766e;margin-bottom:6px}
.modal-head h2{margin:0;font-size:19px;letter-spacing:-.02em}
.modal-head p{margin:6px 0 0;color:#8a94a3;font-size:9px}
.close{appearance:none;border:1px solid #e5ded2;background:#fff;border-radius:8px;width:30px;height:30px;display:grid;place-items:center;cursor:pointer;color:#6b7280;font-size:18px;line-height:1}
.close:hover{background:#f7f4ed}
.modal-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 22px;border-top:1px solid #eee9df;background:#fbf9f4;border-radius:0 0 16px 16px;flex:0 0 auto}
.foot-left,.foot-right{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.edit-body{padding:18px 22px;overflow:auto}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px 13px}
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.field.wide{grid-column:1/-1}
.field span{font-size:9px;color:#7c8695}
.field input,.field select,.field textarea{width:100%;border:1px solid #e1dbcf;background:#fff;border-radius:8px;padding:9px 10px;font-size:10px;color:var(--ink);outline:none;font-family:inherit;min-width:0}
.field textarea{resize:vertical;min-height:62px;line-height:1.55}
.field input:focus,.field select:focus,.field textarea:focus{border-color:#0f766e;box-shadow:0 0 0 3px rgba(15,118,110,.08)}
.form-note{margin:13px 0 0;padding-top:11px;border-top:1px solid #f0ebe2;color:#a09a8f;font-size:9px;line-height:1.65}
.inline-btn{appearance:none;border:0;background:transparent;color:#0f766e;font-size:8px;font-weight:700;text-decoration:underline;cursor:pointer;padding:0 0 0 4px}
.form-error{margin:0 0 10px;padding:9px 10px;border:1px solid #f4d5da;background:#fff1f2;color:#b42342;border-radius:8px;font-size:9px;line-height:1.5}
.auth-body{padding:18px 22px;overflow:auto}
.auth-note{color:#a09a8f;font-size:9px}
.auth-modal{width:min(440px,calc(100vw - 24px))}

/* detail */
.detail-body{padding:18px 22px;overflow:auto}
.detail-hero{display:flex;gap:14px;align-items:flex-start;margin-bottom:14px}
.detail-hero .main{flex:1;min-width:0}
.detail-hero h3{margin:0;font-size:14px;line-height:1.4}
.detail-hero .sub{margin-top:5px;color:#8a94a3;font-size:9px}
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;background:#faf8f2;border:1px solid #eee9df;border-radius:10px;padding:12px}
.detail-grid div{min-width:0}
.detail-grid label{display:block;font-size:8px;color:#a09a8f;margin-bottom:3px}
.detail-grid b{font-size:10px;color:#3f4a59;font-weight:600;word-break:break-word}
.section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0 8px;font-size:10px;font-weight:700;color:#3f4a59}
.section-title span{font-size:8px;color:#a09a8f;font-weight:400}
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:7px}
.gallery .pic{position:relative;border:1px solid #e7e1d6;border-radius:8px;overflow:hidden;background:#f4f1eb;aspect-ratio:1/1;cursor:pointer}
.gallery img{width:100%;height:100%;object-fit:cover;display:block}
.gallery .del-img{position:absolute;top:3px;right:3px;width:20px;height:20px;border-radius:50%;border:0;background:rgba(16,32,51,.72);color:#fff;font-size:12px;cursor:pointer;display:none}
body.editing .gallery .del-img{display:block}
.file-list{display:flex;flex-direction:column;gap:6px}
.file-item{display:flex;align-items:center;gap:9px;padding:8px 10px;border:1px solid #eee9df;border-radius:8px;background:#faf8f2}
.file-item .name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:#3f4a59}
.file-item .meta{font-size:8px;color:#a09a8f;white-space:nowrap}
.file-item a{color:#0f766e;font-size:9px;font-weight:700;text-decoration:none;white-space:nowrap}
.file-item button{appearance:none;border:0;background:transparent;color:#b42342;font-size:8px;cursor:pointer}
.upload-row{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}
.upload-btn{display:inline-flex;align-items:center;gap:5px;border:1px dashed #cfd8d3;background:#f7fbf9;color:#0f766e;border-radius:8px;padding:8px 10px;font-size:9px;font-weight:700;cursor:pointer}
.upload-btn input{display:none}
.folder-box{display:flex;gap:7px;align-items:center;flex-wrap:wrap;padding:9px 10px;border:1px solid #eee9df;border-radius:8px;background:#faf8f2;font-family:"Consolas","Segoe UI",sans-serif;font-size:9px;color:#4b5563;word-break:break-all}
.folder-box button{appearance:none;border:1px solid #ded7ca;background:#fff;border-radius:6px;padding:5px 7px;font-size:8px;cursor:pointer;color:#5b6472}
.detail-empty{color:#a09a8f;font-size:9px;padding:8px 0}
/* lightbox */
.lightbox{position:fixed;inset:0;z-index:90;background:rgba(4,12,20,.9);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;backdrop-filter:blur(4px)}
.lightbox img{max-width:min(1000px,92vw);max-height:74vh;object-fit:contain;border-radius:8px;background:#fff;box-shadow:0 20px 70px rgba(0,0,0,.4)}
.lb-close{position:absolute;top:18px;right:22px;width:36px;height:36px;border-radius:50%;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:#fff;cursor:pointer;font-size:20px}
.lb-caption{color:#e6edf4;font-size:11px;margin-top:12px}
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);background:#102033;color:#fff;font-size:10px;padding:9px 14px;border-radius:999px;opacity:0;pointer-events:none;transition:.3s;z-index:100}
.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:900px){
  .wrap{width:calc(100% - 30px)}
  .hero .wrap{padding:20px 0 64px}
  .hero-main{flex-direction:column;align-items:flex-start;gap:18px}
  .stats{width:100%;justify-content:space-between;gap:10px;text-align:left}
  .stats div{text-align:left}
  .toolbar{margin-top:-30px}
  .table-scroll{max-height:none}
  .page-footer{flex-direction:column;gap:6px}
}
@media(max-width:620px){
  .wrap{width:calc(100% - 20px)}
  .brand{font-size:8px;letter-spacing:.12em}
  .server-badge{display:none}
  h1{font-size:35px}
  .hero p{font-size:10px}
  .stats b{font-size:20px}
  .stats span{font-size:8px}
  .toolbar{padding:10px}
  .toolbar-right{width:100%}
  .toolbar-right .btn{flex:1;justify-content:center}
  .cats{gap:5px}
  .cat{font-size:9px;padding:6px 8px}
  .table-head{padding:14px}
  .table-head p{display:none}
  .form-grid{grid-template-columns:1fr}
  .field.wide{grid-column:auto}
  .detail-grid{grid-template-columns:1fr}
  .modal-head,.edit-body,.detail-body,.modal-foot{padding-left:16px;padding-right:16px}
}
