/* ===== 模型专区共享样式 (index.html + fdm.html) ===== */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Space Grotesk','PingFang SC','Microsoft YaHei',sans-serif;
    background: linear-gradient(140deg, #0a1020 0%, #0f192f 50%, #0b1220 100%);
    color: var(--text);
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* 通用组件 */
.pill { padding:8px 12px; border-radius:10px; border:1px solid var(--border); background: var(--glass); color: var(--muted); font-size:13px; cursor:pointer; transition:all .15s; }
.pill.active { color: var(--text); border-color: rgba(14,165,233,0.6); box-shadow:0 0 0 1px rgba(14,165,233,0.3); }
.pill:hover { color: var(--text); border-color: rgba(14,165,233,0.4); }
main { max-width: 1280px; margin: 0 auto; padding: 18px 20px 60px; display: grid; gap: 18px; }
.panel { background: var(--panel); border:1px solid var(--border); border-radius:14px; padding:14px 16px; box-shadow:0 16px 40px rgba(0,0,0,0.3); }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.muted { color: var(--muted); font-size: 13px; }
.grid { display:grid; grid-template-columns: repeat(4, 1fr); gap:16px; }
.card { background: var(--card); border:1px solid var(--border); border-radius:12px; padding:12px; display:grid; gap:10px; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.input { width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); font-size:14px; }
.input:focus { outline:none; border-color: var(--accent); }
textarea.input { min-height:80px; resize:vertical; }
select.input { cursor:pointer; }
select.input option { background: #1a2035; color: #e9effa; }
.btn { padding:9px 14px; border-radius:10px; border:1px solid var(--border); background: rgba(255,255,255,0.07); color: var(--text); cursor:pointer; font-size:14px; }
.btn:hover { background: rgba(255,255,255,0.12); }
.btn.primary { background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%); color:#0b0f1b; border:none; box-shadow:0 10px 20px rgba(14,165,233,0.25); font-weight:700; }
.btn.primary:disabled { opacity:0.5; cursor:not-allowed; }
.tag { display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border-radius:9px; background: rgba(255,255,255,0.05); border:1px solid var(--border); color: var(--muted); font-size:12px; cursor:pointer; }
.tag.active { background: var(--accent); color:#0b0f1b; border-color: var(--accent); }
.status-pill { padding:6px 10px; border-radius:999px; font-size:12px; border:1px solid var(--border); background: rgba(255,255,255,0.05); }
.good { color: #34d399; font-weight:600; }
.warning { color: #fbbf24; font-weight:600; }

/* 模型缩略图 */
.model-thumb { cursor:pointer; height: 220px; border-radius:10px; background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)); border:1px solid var(--border); position: relative; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.model-thumb img { width:100%; height:100%; object-fit:contain; }
#modelsGrid { cursor:default; }
#modelsGrid:active { cursor:default; }
.model-meta { display:flex; justify-content:space-between; color: var(--muted); font-size:12px; }
.hidden { display: none !important; }

/* 登录浮动面板 */
.login-float { position: fixed; top: 70px; right: 20px; width: 340px; max-height: calc(100vh - 100px); overflow-y: auto; background: rgba(10,16,32,0.95); border:1px solid var(--border); border-radius:12px; padding:16px; box-shadow:0 20px 50px rgba(0,0,0,0.45); z-index: 20; }
.login-float h4 { margin:0 0 12px; }
.divider { height:1px; background: var(--border); margin:12px 0; }
.chip-row { display:flex; gap:8px; flex-wrap:wrap; }

/* 上传区域 */
.upload-zone {
    border:2px dashed var(--border);
    border-radius:12px;
    padding:30px;
    text-align:center;
    color: var(--muted);
    cursor:pointer;
    transition: all 0.2s;
}
.upload-zone:hover { border-color: var(--accent); background: rgba(14,165,233,0.05); }
.upload-zone.dragover { border-color: var(--accent); background: rgba(14,165,233,0.1); }
.preview-images { display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
.preview-item { width:80px; height:80px; border-radius:8px; overflow:hidden; position:relative; border:1px solid var(--border); }
.preview-item img { width:100%; height:100%; object-fit:cover; }
.preview-item .remove { position:absolute; top:2px; right:2px; width:20px; height:20px; background:rgba(0,0,0,0.7); color:#fff; border:none; border-radius:50%; cursor:pointer; font-size:12px; line-height:20px; }
.form-group { margin-bottom:16px; }
.form-label { display:block; margin-bottom:6px; font-size:13px; color: var(--muted); }
.form-label.required::after { content:" *"; color: #ef4444; }

/* 双栏布局 */
.upload-layout { display:grid; grid-template-columns: 1fr 1fr; gap:20px; }

/* 标签自动完成 */
.tag-input-wrapper { position: relative; width: 100%; }
.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.tag-suggestions.show { display: block; }
.tag-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.tag-suggestion-item:last-child { border-bottom: none; }
.tag-suggestion-item:hover,
.tag-suggestion-item.active { background: rgba(14,165,233,0.15); }
.tag-suggestion-item .tag-count { float: right; font-size: 12px; color: var(--muted); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    font-size: 12px;
    color: white;
}
.tag-chip .remove-tag { cursor: pointer; font-size: 14px; margin-left: 2px; opacity: 0.8; }
.tag-chip .remove-tag:hover { opacity: 1; }

/* 响应式 */
@media (max-width: 768px) {
    .upload-layout { grid-template-columns: 1fr; }
    #userInfo { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
    #loginBtn { padding: 6px 10px; font-size: 12px; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .model-thumb { cursor:pointer; height: 160px; }
    #modelsGrid, #modelsGrid:active { cursor:default; }
    .card { padding: 8px; }
    .chip-row { gap: 6px; }
    .tag, .pill { padding: 5px 8px; font-size: 11px; }
    .login-float { width: calc(100% - 24px); right: 12px; left: 12px; }
}
