/* ============================================
 * NZCIME 公共样式 v3.0
 * ============================================ */

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

body {
    background: #f2f2f2;
    font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft YaHei", sans-serif;
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- 顶部栏 ---------- */
.top-bar {
    background: #111; color: #fff; padding: 0 20px; height: 50px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 2px solid #cc0000; position: relative; z-index: 50;
}
.brand { display: flex; align-items: center; font-size: 14px; color: #aaa; }
.brand .logo-zc {
    background: #cc0000; color: #fff; padding: 4px 8px;
    font-weight: bold; font-family: monospace; margin-right: 12px;
}
.brand .scp-f { color: #fff; font-weight: bold; }
.user-menu {
    display: flex; align-items: center; gap: 15px;
    font-size: 12px; color: #aaa; font-family: monospace; position: relative;
}
.user-menu a { color: #aaa; text-decoration: none; }
.user-menu a:hover { color: #fff; }
.menu-btn { cursor: pointer; font-size: 20px; padding: 5px; transition: 0.2s; user-select: none; }
.menu-btn:hover { color: #cc0000; }

.dropdown-menu {
    position: absolute; top: 40px; right: 0;
    background: #fff; border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 140px; display: none; z-index: 100;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a {
    display: block; padding: 10px 15px; color: #333;
    text-decoration: none; font-size: 13px; font-family: monospace;
    border-bottom: 1px solid #eee; transition: 0.2s;
}
.dropdown-menu a:last-child { border-bottom: none; }
.dropdown-menu a:hover { background: #f2f2f2; color: #cc0000; }

/* ---------- 主内容 ---------- */
.main-content {
    flex-grow: 1; max-width: 900px;
    margin: 40px auto; padding: 0 20px; width: 100%;
}

/* ---------- 通用卡片 ---------- */
.card {
    background: #fff; border: 1px solid #ddd;
    padding: 25px; border-left: 4px solid #111; margin-bottom: 20px;
}
.card h2, .card h3 { font-family: monospace; font-weight: 900; margin-bottom: 15px; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 16px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block; padding: 10px 20px;
    font-size: 13px; font-family: monospace; cursor: pointer;
    border: 1px solid transparent; border-radius: 4px;
    transition: 0.25s; text-decoration: none; text-align: center;
}
.btn-primary { background: #111; color: #fff; }
.btn-primary:hover { background: #cc0000; }
.btn-danger { background: #cc0000; color: #fff; }
.btn-danger:hover { background: #e60000; }
.btn-light { background: #fff; color: #111; border-color: #ccc; }
.btn-light:hover { background: #f0f0f0; }
.btn-ghost { background: transparent; color: #555; border-color: #ccc; }
.btn-ghost:hover { background: #f0f0f0; }
.btn:disabled { background: #ccc; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px; font-family: monospace;
    margin-bottom: 8px; color: #555;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 12px 15px;
    border: 1px solid #ddd; font-family: inherit; font-size: 14px;
    outline: none; transition: 0.3s; background: #fafafa;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #cc0000; background: #fff; }
.form-group textarea { min-height: 160px; resize: vertical; }

/* ---------- 帖子列表 ---------- */
.section-header {
    display: flex; justify-content: space-between; align-items: baseline;
    border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 20px;
}
.section-header h2 { font-size: 22px; font-weight: 900; }
.section-header .count { font-size: 13px; color: #555; font-family: monospace; }

.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item {
    display: flex; align-items: center; padding: 15px;
    background: #fff; border: 1px solid #eee;
    text-decoration: none; color: inherit; transition: 0.2s;
}
.doc-item:hover { border-color: #ccc; box-shadow: 2px 2px 0 #e0e0e0; }
.doc-tag {
    background: #111; color: #fff; font-family: monospace;
    font-size: 12px; padding: 3px 8px; margin-right: 20px;
    min-width: 70px; text-align: center; font-weight: bold;
}
.doc-tag.red { background: #cc0000; }
.doc-content { flex-grow: 1; }
.doc-content h3 { font-size: 16px; margin-bottom: 8px; font-weight: bold; }
.doc-meta {
    font-size: 12px; color: #888; display: flex;
    align-items: center; gap: 8px; font-family: monospace;
}
.doc-meta img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.doc-stats {
    text-align: right; font-size: 12px; font-family: monospace;
    color: #555; display: flex; gap: 20px; margin-left: 20px;
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center; padding: 60px 20px; background: #fff;
    border: 1px dashed #ccc; color: #888;
    font-family: monospace; font-size: 14px;
}

/* ---------- 底部 ---------- */
.footer {
    background: #1a1a1a; color: #888; padding: 30px 40px;
    display: flex; gap: 60px; font-family: monospace;
    font-size: 12px; margin-top: auto;
}
.footer h4 { color: #fff; margin-bottom: 15px; font-weight: normal; }
.footer a { color: #888; text-decoration: none; display: block; margin-bottom: 8px; }
.footer a:hover { color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .top-bar { flex-direction: column; height: auto; padding: 10px; gap: 10px; }
    .doc-item { flex-wrap: wrap; }
    .doc-content { width: 100%; margin-top: 10px; }
    .doc-stats { width: 100%; text-align: left; margin: 10px 0 0 0; gap: 30px; }
    .footer { flex-direction: column; gap: 20px; padding: 20px; }
}

/* ============================================
 * 加载遮罩
 * ============================================ */
.nz-loading {
    position: fixed; inset: 0;
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(4px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 9999;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.nz-loading.show { opacity: 1; visibility: visible; }
.nz-loading .hourglass {
    width: 48px; height: 48px; position: relative; margin-bottom: 20px;
}
.nz-loading .hourglass::before,
.nz-loading .hourglass::after {
    content: ''; position: absolute; left: 50%; transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 24px solid transparent;
    border-right: 24px solid transparent;
}
.nz-loading .hourglass::before {
    top: 0; border-top: 22px solid #cc0000;
    animation: hg-top 1.6s ease-in-out infinite;
    transform-origin: center top;
}
.nz-loading .hourglass::after {
    bottom: 0; border-bottom: 22px solid #cc0000;
    animation: hg-bottom 1.6s ease-in-out infinite;
    transform-origin: center bottom;
}
@keyframes hg-top {
    0%, 40% { transform: translateX(-50%) scaleY(1); opacity: 1; }
    60%, 100% { transform: translateX(-50%) scaleY(0.1); opacity: 0.3; }
}
@keyframes hg-bottom {
    0%, 40% { transform: translateX(-50%) scaleY(0.1); opacity: 0.3; }
    60%, 100% { transform: translateX(-50%) scaleY(1); opacity: 1; }
}
.nz-loading .text {
    color: #fff; font-family: monospace; font-size: 14px;
    letter-spacing: 3px; margin-bottom: 8px;
}
.nz-loading .subtext {
    color: #888; font-family: monospace; font-size: 11px; letter-spacing: 1px;
}
.nz-loading .dots::after {
    content: ''; animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
    0% { content: ''; } 25% { content: '.'; }
    50% { content: '..'; } 75% { content: '...'; }
}

/* ---------- 顶部进度条 ---------- */
.nz-progress {
    position: fixed; top: 0; left: 0; height: 2px;
    background: #cc0000; width: 0%; z-index: 10000;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(204, 0, 0, 0.8);
}

/* ============================================
 * 页面过渡
 * ============================================ */
.nz-transition {
    position: fixed; inset: 0; background: #111;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 99998;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.nz-transition.cover { opacity: 1; pointer-events: auto; }
.nz-transition .logo {
    font-family: monospace; font-size: 40px; font-weight: 900;
    color: #cc0000; letter-spacing: 4px; margin-bottom: 15px;
}
.nz-transition .label {
    font-family: monospace; font-size: 12px;
    color: #666; letter-spacing: 3px;
}
.nz-transition .line {
    width: 60px; height: 2px; background: #cc0000;
    margin-top: 20px;
    animation: nt-line 1.2s ease-in-out infinite;
}
@keyframes nt-line {
    0%, 100% { transform: scaleX(1); opacity: 1; }
    50% { transform: scaleX(0.3); opacity: 0.5; }
}

/* ============================================
 * 开屏动画
 * ============================================ */
.splash {
    position: fixed; inset: 0; background: #f7f7f7;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 99999;
    transition: opacity 0.6s ease;
}
.splash.fade-out { opacity: 0; pointer-events: none; }
.splash-icon {
    width: 90px; height: 90px; border-radius: 18px;
    background: #3ddc84;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(61, 220, 132, 0.35);
    opacity: 0; transform: scale(0.6);
    animation: sp-icon 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}
@keyframes sp-icon { to { opacity: 1; transform: scale(1); } }
.splash-title {
    font-family: "STKaiti", "KaiTi", "Kaiti SC", serif;
    font-size: 30px; color: #333; margin-top: 28px;
    letter-spacing: 6px; opacity: 0;
    animation: sp-fade 0.5s ease 0.7s forwards;
}
.splash-sub {
    font-family: "Georgia", "Times New Roman", serif;
    font-style: italic; font-size: 18px; color: #888;
    margin-top: 8px; letter-spacing: 2px; opacity: 0;
    animation: sp-fade 0.5s ease 1s forwards;
}
.splash-welcome {
    margin-top: 36px; background: #ededed;
    padding: 10px 28px; border-radius: 22px;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 17px; color: #333;
    opacity: 0; transform: translateY(10px);
    animation: sp-up 0.5s ease 1.4s forwards;
}
.splash-version {
    margin-top: 14px;
    font-family: "Georgia", serif; font-style: italic;
    font-size: 13px; color: #aaa; letter-spacing: 1px; opacity: 0;
    animation: sp-fade 0.5s ease 1.7s forwards;
}
.splash-bar {
    position: absolute; bottom: 30px;
    width: 60%; max-width: 320px; height: 3px;
    background: #e0e0e0; border-radius: 2px; overflow: hidden;
}
.splash-bar-fill {
    height: 100%; width: 0; background: #888;
    border-radius: 2px;
    animation: sp-bar 2s ease-in-out 0.3s forwards;
}
@keyframes sp-fade { to { opacity: 1; } }
@keyframes sp-up { to { opacity: 1; transform: translateY(0); } }
@keyframes sp-bar {
    0% { width: 0; } 40% { width: 55%; }
    70% { width: 78%; } 100% { width: 100%; }
}
/* ============ 侧滑抽屉菜单 ============ */
.nz-drawer-mask {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.nz-drawer-mask.show { opacity: 1; pointer-events: auto; }

.nz-drawer {
    position: fixed; top: 0; right: 0;
    width: 240px; height: 100vh;
    background: #fff;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    overflow-y: auto;
}
.nz-drawer.show { transform: translateX(0); }

.nz-drawer-header {
    background: #111;
    color: #fff;
    padding: 15px 20px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 2px solid #cc0000;
    flex-shrink: 0;
}
.nz-drawer-header .user {
    font-family: monospace; font-size: 14px;
    color: #fff; text-decoration: none;
}
.nz-drawer-header .user:hover { color: #cc0000; }
.nz-drawer-header .close {
    font-size: 22px; cursor: pointer;
    color: #aaa; line-height: 1; user-select: none;
    padding: 0 5px;
}
.nz-drawer-header .close:hover { color: #cc0000; }

.nz-drawer-nav { flex-grow: 1; padding: 8px 0; }
.nz-drawer-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px;
    font-family: monospace; font-size: 14px;
    color: #333; text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: 0.2s;
}
.nz-drawer-nav a:hover {
    background: #f7f7f7;
    color: #cc0000;
    padding-left: 24px;
}
.nz-drawer-nav a.active {
    color: #cc0000;
    border-left: 3px solid #cc0000;
    padding-left: 17px;
    background: #fafafa;
}
.nz-drawer-nav a .icon {
    font-size: 16px; width: 20px; text-align: center;
    flex-shrink: 0;
}
.nz-drawer-nav a .label { flex-grow: 1; }
.nz-drawer-nav a.external::after {
    content: '↗'; font-size: 11px; color: #aaa;
}

.nz-drawer-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.nz-drawer-footer a {
    display: block;
    padding: 10px 0;
    font-family: monospace; font-size: 13px;
    color: #888; text-decoration: none;
    text-align: center;
}
.nz-drawer-footer a:hover { color: #cc0000; }
.nz-drawer-footer .admin-link { color: #cc0000; font-weight: bold; }

@media (min-width: 701px) {
    .nz-drawer { width: 280px; }
}