/* ========================================
   MocNest 样式
   ======================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 首页 ========== */

.home-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.admin-entry {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: .8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: .3rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .15s;
}
.admin-entry:hover { color: var(--primary); border-color: var(--primary); }

.logo-area { text-align: center; margin-bottom: 3rem; }
.logo-area h1 { font-size: 3rem; margin-bottom: .25rem; }
.logo-area .subtitle { color: var(--text-muted); font-size: 1.1rem; }

.entry-area {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.entry-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 2.5rem 3rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all .2s;
    min-width: 200px;
}
.entry-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(37,99,235,.15);
    transform: translateY(-2px);
}
.entry-icon { font-size: 3rem; }
.entry-label { font-size: 1.25rem; font-weight: 600; }
.entry-desc { font-size: .875rem; color: var(--text-muted); }

.icp-footer {
    position: fixed;
    bottom: 1rem;
    color: var(--text-muted);
    font-size: .8rem;
}

/* ========== 按钮 ========== */

.btn {
    display: inline-block;
    padding: .5rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
    background: var(--surface);
    color: var(--text);
    transition: all .15s;
}
.btn:hover { background: #f8fafc; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-block { display: block; width: 100%; }
.btn-danger { color: #dc2626; border-color: #dc2626; }
.btn-danger:hover { background: #fef2f2; }

/* ========== 顶部导航 ========== */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.top-bar .back-link { text-decoration: none; color: var(--text-muted); font-size: .9rem; }
.top-bar .page-title { font-size: 1.1rem; font-weight: 600; }
.top-bar-right { min-width: 80px; }

/* ========== MOC 展示页 ========== */

.model-layout {
    display: flex;
    height: calc(100vh - 52px);
}
.viewer-main {
    flex: 1;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.viewer-placeholder, .viewer-loaded {
    text-align: center;
    font-size: 1.1rem;
}
.viewer-placeholder p:first-child, .viewer-loaded p:first-child { font-size: 3rem; margin-bottom: .5rem; }

.model-sidebar {
    width: 320px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 1.5rem;
}
.model-sidebar h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .5rem;
}
.model-item-info { display: flex; align-items: center; gap: .5rem; }
.model-item-actions { display: flex; gap: .25rem; }

.type-badge {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 99px;
    background: #f1f5f9;
    font-size: .8rem;
}

/* ========== 登录页 ========== */

.login-container {
    max-width: 380px;
    margin: 5rem auto;
    text-align: center;
}
.login-container h1 { margin-bottom: 2rem; }
.login-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: left;
}
.login-back { margin-top: 1rem; }
.login-back a { color: var(--text-muted); text-decoration: none; font-size: .9rem; }

/* ========== 表单 ========== */

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .25rem; font-weight: 500; font-size: .9rem; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: inherit;
}
.form-group input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-error { color: #dc2626; font-size: .85rem; margin-bottom: .75rem; }
.form-msg { padding: .5rem; border-radius: var(--radius); margin-bottom: .75rem; font-size: .85rem; }
.form-msg-error { background: #fef2f2; color: #dc2626; }
.form-msg-success { background: #f0fdf4; color: #16a34a; }

/* ========== 后台管理 ========== */

.admin-container { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }
.admin-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.admin-section h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.file-table { width: 100%; border-collapse: collapse; }
.file-table th, .file-table td {
    padding: .75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.file-table th { font-weight: 600; color: var(--text-muted); font-size: .8rem; }
.file-table .file-actions { display: flex; gap: .25rem; }
.file-table .file-date { color: var(--text-muted); font-size: .8rem; white-space: nowrap; }

.cover-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg);
}

.empty-hint { color: var(--text-muted); text-align: center; padding: 2rem 0; }

/* ========== 响应式 ========== */

@media (max-width: 768px) {
    .entry-area { flex-direction: column; }
    .logo-area h1 { font-size: 2rem; }
    .model-sidebar { width: 280px; }
    .form-row { flex-direction: column; }
}
