:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e7edf6;
    --bg: #f5f8fd;
    --side: #0d1f42;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink); background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.app { display: flex; min-height: 100vh; }

/* ---------------- 侧边栏 ---------------- */
.side {
    width: 218px; flex: 0 0 218px; background: linear-gradient(180deg, #0d1f42, #14305f);
    color: #dbe6f7; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand .ico {
    width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    display: flex; align-items: center; justify-content: center;
}
.brand .t { font-size: 14px; font-weight: 600; line-height: 1.3; }
.brand .t small { display: block; font-size: 10.5px; opacity: .55; font-weight: 400; letter-spacing: .5px; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
    color: #cbd8ec; font-size: 13.5px; text-decoration: none; transition: background .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav-item.on { background: rgba(96, 165, 250, .18); color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 #60a5fa; }
.nav-item svg { width: 16px; height: 16px; opacity: .85; flex: 0 0 16px; }
.side-foot { margin-top: auto; padding: 12px 10px 0; font-size: 11.5px; opacity: .45; border-top: 1px solid rgba(255, 255, 255, .08); }

/* ---------------- 主区 ---------------- */
.main { flex: 1; min-width: 0; padding: 26px 30px 50px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; margin: 0; font-weight: 600; }
.page-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.card {
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(16, 42, 90, .04);
}
.card h2 { font-size: 14.5px; margin: 0 0 16px; font-weight: 600; }

/* ---------------- 表单 ---------------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: #475569; margin-bottom: 6px; }
.field .tip { font-size: 11.5px; color: #94a3b8; margin-top: 5px; line-height: 1.6; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #dbe4f0; border-radius: 9px;
    font-size: 13.5px; background: #fbfcfe; outline: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
textarea { resize: vertical; min-height: 80px; }

.btn {
    display: inline-flex; align-items: center; gap: 6px; justify-content: center;
    padding: 10px 20px; border: 0; border-radius: 9px; cursor: pointer;
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff;
    font-size: 13.5px; font-weight: 600; font-family: inherit;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
}
.btn:hover { filter: brightness(1.05); }
.btn.gray { background: #eef2f9; color: #40556f; box-shadow: none; }
.btn.gray:hover { background: #e3eaf5; }
.btn.danger { background: #fee2e2; color: #b91c1c; box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
.table td:last-child .btn.sm { padding: 6px 10px; }
.table th {
    text-align: left; font-weight: 600; color: #64748b; font-size: 12px;
    padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 10px; border-bottom: 1px solid #f1f5fa; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafcff; }
.fname-cell { display: flex; align-items: flex-start; gap: 10px; min-width: 210px; }
.mini-icon {
    width: 32px; height: 32px; min-height: 32px; max-height: 32px; border-radius: 8px; flex: 0 0 32px;
    align-self: flex-start; color: #fff; font-size: 9px;
    font-weight: 700; display: flex; align-items: center; justify-content: center; text-transform: uppercase;
    overflow: hidden;
}
.mini-icon.img { background: #db2777; } .mini-icon.zip { background: #d97706; }
.mini-icon.doc { background: #0284c7; } .mini-icon.media { background: #7c3aed; }
.mini-icon.code { background: #059669; } .mini-icon.app { background: #475569; }
.mini-icon.file { background: #4f46e5; }
.fname-cell .nm {
    font-weight: 600; color: var(--ink); word-break: break-all; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fname-cell .fn { font-size: 11.5px; color: #94a3b8; word-break: break-all; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: #eff6ff; color: #2563eb; }
.tag.gray { background: #f1f5f9; color: #64748b; }
.tag.warn { background: #fff7ed; color: #c2410c; }
.tag.green { background: #ecfdf5; color: #047857; }
.tag.red { background: #fef2f2; color: #b91c1c; }

/* ---------------- 提示 ---------------- */
.alert { padding: 11px 15px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }
.alert.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.alert.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

.empty { text-align: center; padding: 46px 16px; color: #94a3b8; font-size: 13.5px; }

/* ---------------- 上传区 ---------------- */
.drop {
    border: 2px dashed #cddff5; border-radius: 14px; padding: 40px 20px; text-align: center;
    background: #fbfdff; cursor: pointer; transition: all .18s;
}
.drop.hover { border-color: var(--brand); background: #eff6ff; }
.drop .big { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.drop .small { font-size: 12.5px; color: #94a3b8; }
.file-list { margin-top: 14px; }
.file-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; font-size: 13px;
}
.file-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: #eef2f9; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width .2s; }

@media (max-width: 860px) {
    .app { flex-direction: column; }
    .side { width: 100%; flex: none; height: auto; position: static; flex-direction: row; overflow-x: auto; padding: 12px; gap: 6px; align-items: center; }
    .brand { padding: 0 10px 0 4px; }
    .brand .t small { display: none; }
    .side-foot { display: none; }
    .nav-item { white-space: nowrap; padding: 8px 12px; }
    .main { padding: 18px 14px 40px; }
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .table-responsive { overflow-x: auto; }
}
