/* ============================================================
   竞赛作品评审系统 —— 蓝色主题样式表
   主色：#2563eb (蓝)   辅色：#4f46e5 (靛蓝)   强调：#f59e0b (琥珀)
   ============================================================ */

:root {
    --c-primary: #2563eb;
    --c-primary-dark: #1d4ed8;
    --c-primary-light: #60a5fa;
    --c-indigo: #4f46e5;
    --c-accent: #f59e0b;
    --c-bg: #f5f7fb;
    --c-surface: #ffffff;
    --c-text: #1e293b;
    --c-text-muted: #64748b;
    --c-border: #e2e8f0;
    --c-shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
    --c-shadow-lg: 0 12px 40px rgba(37, 99, 235, 0.15);
    --radius: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { font-size: 15px; position: relative; min-height: 100%; }

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
}

a { color: var(--c-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-primary-dark); }

/* ---------- 按钮 ---------- */
.btn-primary {
    background: linear-gradient(135deg, var(--c-primary), var(--c-indigo));
    border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-outline-primary {
    color: var(--c-primary);
    border-color: var(--c-primary);
    transition: all .2s;
}
.btn-outline-primary:hover { background: var(--c-primary); border-color: var(--c-primary); }
.btn-link { color: var(--c-primary); text-decoration: none; }
.btn-link:hover { color: var(--c-primary-dark); }

/* ---------- 顶部导航 ---------- */
/* 顶部导航与底部页脚保持同一配色（深蓝灰 #1e293b） */
.site-header {
    background: #1e293b;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.35);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.site-header .navbar { padding: 0.55rem 0; }
/* 深色导航栏下的移动端折叠按钮（汉堡图标）改为浅色描边，否则在深底上不可见 */
.site-header .navbar-toggler-icon {
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.site-header .navbar-toggler { border-color: rgba(255, 255, 255, 0.35); }
.site-header .navbar-brand {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: .5px;
}
.site-header .nav-link {
    color: rgba(255, 255, 255, 0.88) !important;
    font-weight: 500;
    padding: 0.5rem 0.9rem !important;
    border-radius: 8px;
    transition: all .2s;
    position: relative;
}
.site-header .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15);
}
.site-header .nav-link.btn {
    background: #fff;
    color: var(--c-primary) !important;
    font-weight: 600;
    padding: 0.35rem 1rem !important;
}
.site-header .nav-link.btn:hover { background: #eff6ff; }

/* 品牌标识圆点 */
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* 未读消息圆点 */
.site-header .dot {
    position: absolute;
    top: 6px; right: 4px;
    width: 8px; height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #1e293b;
}

/* ---------- 管理后台二级导航 ---------- */
.admin-nav {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--c-border);
    backdrop-filter: blur(8px);
}
.admin-nav a {
    color: var(--c-text-muted);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all .2s;
    white-space: nowrap;
}
.admin-nav a:hover { background: #eff6ff; color: var(--c-primary); }

/* ---------- 内容区容器 ---------- */
main.container { max-width: 1200px; }

/* 内容面板（通用卡片容器） */
.content-panel {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--c-shadow);
    padding: 1.5rem;
}

/* 面包屑行 */
.breadcrumb-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--c-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}
.breadcrumb-line a { color: var(--c-text-muted); }
.breadcrumb-line a:hover { color: var(--c-primary); }
.breadcrumb-line i { font-size: 0.8rem; }

/* ---------- 列表组美化 ---------- */
.list-group-item {
    border-color: var(--c-border);
    padding: 1rem 1.25rem;
    transition: background .15s;
}
.list-group-item:first-child { border-top-left-radius: var(--radius-sm); border-top-right-radius: var(--radius-sm); }
.list-group-item:last-child { border-bottom-left-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.list-group-item-primary {
    background: linear-gradient(90deg, #eff6ff, #ffffff);
    border-left: 3px solid var(--c-primary);
}

/* ---------- 分页 ---------- */
.pagination .page-link {
    border: none;
    color: var(--c-text-muted);
    margin: 0 2px;
    border-radius: 8px;
    min-width: 38px;
    text-align: center;
}
.pagination .page-link:hover { background: #eff6ff; color: var(--c-primary); }
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--c-primary), var(--c-indigo));
    color: #fff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

/* 论坛式列表的翻页条 */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}
.pager .pagination { margin: 0; }
.pager-info { color: var(--c-text-muted); font-size: .875rem; }

/* 论坛式条目 */
.forum-list { list-style: none; margin: 0; padding: 0; }
.forum-item { padding: 1rem 1.25rem; border-bottom: 1px solid var(--c-border); }
.forum-item:last-child { border-bottom: none; }
.forum-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.forum-title { font-weight: 600; color: var(--c-text); }
.forum-meta { color: var(--c-text-muted); font-size: .85rem; }
.forum-body { white-space: pre-wrap; word-break: break-word; color: var(--c-text); }
.forum-actions { margin-top: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- 徽章 ---------- */
.badge.text-bg-primary { background: linear-gradient(135deg, var(--c-primary), var(--c-indigo)) !important; }

/* ---------- 表单 ---------- */
.form-control, .form-select {
    border-color: var(--c-border);
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--c-primary-light);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* ---------- 表单单选/复选 ---------- */
.form-check-input:checked {
    background-color: var(--c-primary);
    border-color: var(--c-primary);
}

/* ---------- 表格 ---------- */
.table > :not(caption) > * > * {
    padding: 0.75rem 0.85rem;
    border-bottom-color: var(--c-border);
}
.table thead th {
    background: #f1f5f9;
    color: var(--c-text);
    font-weight: 600;
    border-bottom: 2px solid var(--c-border);
}
.table-hover > tbody > tr:hover { background: #f8fafc; }

/* ---------- 卡片 ---------- */
.card {
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--c-shadow);
    overflow: hidden;
}
.card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--c-border);
    font-weight: 600;
}

/* ============================================================
   首页
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
    border-radius: var(--radius);
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: "";
    position: absolute;
    top: -80px; right: -80px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.35), transparent 70%);
    border-radius: 50%;
}
.hero-section .eyebrow {
    display: inline-block;
    color: var(--c-primary);
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}
.hero-section h1 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--c-text);
    margin-bottom: 1rem;
}
.hero-section h1 span {
    background: linear-gradient(135deg, var(--c-primary), var(--c-indigo));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-section .lead { color: var(--c-text-muted); font-size: 1.05rem; }

/* 首页艺术卡片 */
.hero-art { position: relative; height: 320px; }
.art-card {
    position: absolute;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--c-shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}
.art-card i { font-size: 2rem; margin-bottom: 0.4rem; }
.art-card strong { font-size: 0.95rem; color: var(--c-text); }
.art-card span { font-size: 0.8rem; color: var(--c-text-muted); }
.art-main {
    top: 30px; left: 20px;
    width: 200px; height: 160px;
    background: linear-gradient(135deg, #fff, #eff6ff);
}
.art-main i { color: var(--c-accent); font-size: 2.4rem; }
.art-float {
    width: 70px; height: 70px;
    padding: 0;
}
.art-code { top: 10px; right: 40px; background: #dbeafe; }
.art-code i { color: var(--c-primary); }
.art-image { bottom: 60px; right: 90px; background: #fef3c7; }
.art-image i { color: var(--c-accent); }
.art-play { bottom: 20px; left: 60px; background: #ede9fe; }
.art-play i { color: var(--c-indigo); }

/* 数据条 */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--c-shadow);
    margin-bottom: 2.5rem;
}
.stats-strip > div { text-align: center; }
.stats-strip strong {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--c-primary), var(--c-indigo));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stats-strip span { color: var(--c-text-muted); font-size: 0.9rem; }

/* 区块 */
.section-block { margin-bottom: 2.5rem; }
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}
.section-heading .eyebrow {
    color: var(--c-primary);
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 0.75rem;
}
.section-heading h2 { font-size: 1.6rem; font-weight: 700; margin: 0.3rem 0 0; }
.section-heading a { color: var(--c-primary); font-weight: 500; }

/* 赛事卡片 */
.competition-card {
    display: block;
    height: 100%;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.4rem;
    color: var(--c-text);
    text-decoration: none;
    box-shadow: var(--c-shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
    position: relative;
    overflow: hidden;
}
.competition-card::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--c-primary), var(--c-indigo));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s;
}
.competition-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--c-shadow-lg);
    border-color: var(--c-primary-light);
    color: var(--c-text);
}
.competition-card:hover::after { transform: scaleX(1); }
.card-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    color: var(--c-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.competition-card h3 { font-size: 1.15rem; font-weight: 700; margin: 0.5rem 0; }
.competition-card p { color: var(--c-text-muted); font-size: 0.9rem; margin-bottom: 1rem; min-height: 2.6em; }
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--c-text-muted);
    font-size: 0.85rem;
}
.card-meta i:last-child { color: var(--c-primary); }

/* 作品卡片 */
.work-card {
    display: block;
    height: 100%;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--c-text);
    text-decoration: none;
    box-shadow: var(--c-shadow);
    transition: transform .2s, box-shadow .2s;
}
.work-card:hover { transform: translateY(-3px); box-shadow: var(--c-shadow-lg); color: var(--c-text); }

/* 我的作品列表卡片顶部的缩略图 */
.my-work-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
}
/* 作品卡片缩略图背景：右侧显示预览画面，左侧白色渐隐保证文字可读 */
.work-card.has-thumb {
    background-image: linear-gradient(to right, var(--c-surface) 0%, var(--c-surface) 26%, rgba(255, 255, 255, .82) 46%, rgba(255, 255, 255, .3) 74%, rgba(255, 255, 255, 0) 100%), var(--work-thumb);
    background-size: cover, cover;
    background-position: center, right center;
    background-repeat: no-repeat, no-repeat;
}
.work-card.has-thumb .work-card-body { position: relative; z-index: 1; }
.work-card.has-thumb:hover {
    background-image: linear-gradient(to right, var(--c-surface) 0%, var(--c-surface) 22%, rgba(255, 255, 255, .72) 44%, rgba(255, 255, 255, .18) 72%, rgba(255, 255, 255, 0) 100%), var(--work-thumb);
}
.work-card-body { padding: 1.2rem 1.4rem; }
.work-card-body h3 { font-size: 1.1rem; font-weight: 700; margin: 0.5rem 0; }
.work-card-body p { color: var(--c-text-muted); font-size: 0.9rem; margin: 0; }
.work-card-foot {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1.4rem;
    background: #f8fafc;
    border-top: 1px solid var(--c-border);
    font-size: 0.85rem;
    color: var(--c-text-muted);
}

/* 分类标签 */
.category-pill {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eff6ff;
    color: var(--c-primary);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--c-text-muted);
}
.empty-state i { font-size: 3rem; color: var(--c-primary-light); margin-bottom: 1rem; }
.empty-state h3 { color: var(--c-text); font-weight: 700; }

/* ============================================================
   管理后台 / 评审工作台
   ============================================================ */
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.admin-sidebar { position: sticky; top: 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: .75rem; box-shadow: 0 4px 24px rgba(37, 99, 235, 0.08); }
.admin-sidebar-title { padding: .55rem .75rem .8rem; color: #6c757d; font-size: .8rem; font-weight: 700; letter-spacing: .08em; }
.admin-nav-link { display: flex; align-items: center; gap: .6rem; color: #495057; border-radius: 10px; padding: .65rem .75rem; margin-bottom: .2rem; text-decoration: none; transition: all .2s; }
.admin-nav-link:hover { color: #2563eb; background: #eff6ff; text-decoration: none; }
.admin-nav-link.active { color: #fff; background: linear-gradient(135deg, #2563eb, #4f46e5); box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35); }
.admin-nav-link .nav-dot { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .7; }
.admin-content { min-width: 0; }
.admin-page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.admin-page-header h1 { font-size: 1.65rem; font-weight: 700; margin-bottom: .25rem; }
.admin-page-header p { color: #6c757d; margin-bottom: 0; }
.admin-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 4px 24px rgba(37, 99, 235, 0.08); }
.admin-card .card-header { background: transparent; border-bottom: 1px solid #edf0f2; padding: 1rem 1.25rem; }
.admin-card .card-body { padding: 1.25rem; }
.admin-empty { text-align: center; padding: 3rem 1rem; color: #6c757d; }
.admin-empty-icon { width: 3rem; height: 3rem; line-height: 3rem; margin: 0 auto .8rem; border-radius: 50%; background: #f1f3f5; color: #868e96; font-size: 1.25rem; }
.admin-audit-text { max-width: 32rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* 操作日志表格：角色不换行，明细列限宽换行 */
.admin-log-role { white-space: nowrap; }
.admin-log-text { min-width: 12rem; max-width: 28rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-table td { vertical-align: middle; }
.admin-filter { background: #f8fafc; border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.admin-stat { border-left: .25rem solid #2563eb; }
.admin-stat .number { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
/* 后台操作图标按钮：固定宽度，仅显示图标，避免撑宽表格 */
.admin-icon-btn {
    width: 2rem;
    min-width: 2rem;
    padding: .25rem 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.admin-danger-zone { border-color: #f1aeb5; }
.admin-form-section + .admin-form-section { border-top: 1px solid #e9ecef; margin-top: 1.5rem; padding-top: 1.5rem; }

/* ---------- 作品附件与在线预览 ---------- */
.attachment-list { display: flex; flex-direction: column; gap: .75rem; }
.attachment-item {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: .85rem 1rem;
    background: #fbfcfe;
}
.attachment-info { display: flex; align-items: center; gap: .75rem; }
.attachment-info .file-icon {
    width: 2.25rem; height: 2.25rem; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; background: #eff6ff; color: var(--c-primary); font-size: 1.1rem;
}
.attachment-info strong { display: block; font-size: .95rem; word-break: break-all; }
.attachment-info span { display: block; color: var(--c-text-muted); font-size: .8rem; }
.attachment-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.image-preview {
    position: relative; display: block; width: 100%; margin-top: .7rem;
    padding: 0; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    overflow: hidden; background: #fff; cursor: zoom-in;
}
.image-preview img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.image-preview span {
    position: absolute; right: .6rem; bottom: .6rem;
    background: rgba(15, 23, 42, .72); color: #fff; font-size: .78rem;
    padding: .25rem .6rem; border-radius: 999px;
}
.image-preview.unsupported-image { padding: 1.5rem; text-align: center; color: var(--c-text-muted); font-size: .85rem; }
.media-preview, .audio-preview { display: block; width: 100%; margin-top: .7rem; border-radius: var(--radius-sm); }
.embedded-preview { margin-top: .7rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: .75rem; background: #fff; max-height: 620px; overflow: auto; }
.embedded-preview .pdf-page { max-width: 100%; height: auto; display: block; margin: 0 auto .6rem; border: 1px solid var(--c-border); border-radius: 6px; }
.embedded-preview pre { margin: 0; background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: 8px; overflow: auto; max-height: 560px; }
.embedded-preview .doc-content { font-size: .92rem; }
.embedded-preview .doc-content img { max-width: 100%; height: auto; }
.preview-notice { margin-top: .6rem; font-size: .82rem; color: var(--c-text-muted); background: #f8fafc; border-radius: 8px; padding: .5rem .75rem; }
.preview-loading { display: flex; align-items: center; gap: .5rem; color: var(--c-text-muted); font-size: .88rem; padding: .75rem 0; }

@media (max-width: 991.98px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; display: flex; gap: .25rem; overflow-x: auto; padding: .5rem; }
    .admin-sidebar-title { display: none; }
    .admin-nav-link { white-space: nowrap; margin-bottom: 0; }
}
@media (max-width: 575.98px) {
    .admin-page-header { flex-direction: column; }
    .admin-card .card-body { padding: 1rem; }
}

/* ---------- 作品详情 ---------- */
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.panel-heading h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.panel-heading h2 small { color: var(--c-text-muted); font-size: .8rem; font-weight: 500; }
.info-list { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: .75rem 0 0; font-size: .9rem; }
.info-list dt { color: var(--c-text-muted); font-weight: 500; }
.info-list dd { margin: 0; }
.work-description { margin-top: .75rem; white-space: pre-wrap; word-break: break-word; }
/* ---------- 作品缩略图 ---------- */
.work-thumb-col { flex: 0 0 auto; }
.work-head-col { flex: 1 1 auto; min-width: 0; }
.work-thumb-box { position: relative; width: 220px; max-width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--c-border); background: #f8fafc; }
.work-thumb-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.work-thumb-placeholder { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; color: var(--c-text-muted); font-size: .8rem; background: linear-gradient(135deg, #f1f5f9, #e2e8f0); }
.work-thumb-placeholder i { font-size: 1.6rem; }
/* Scratch 舞台预览 */
.scratch-frame-wrap { position: relative; width: 100%; max-width: 640px; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--c-border); background: #fff; }
.scratch-frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
.inline-notice { background: #f8fafc; border: 1px dashed var(--c-border); border-radius: var(--radius-sm); padding: .8rem 1rem; color: var(--c-text-muted); font-size: .9rem; }
.empty-state.compact { padding: 1.5rem 1rem; }
.empty-state.compact i { font-size: 2rem; margin-bottom: .5rem; }
.empty-state.compact p { margin: 0; }
.muted-copy { color: var(--c-text-muted); }
.review-item { border-bottom: 1px solid var(--c-border); padding: .8rem 0; }
.review-item:last-child { border-bottom: none; }
.review-item > div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.review-item p { margin: .35rem 0; white-space: pre-wrap; word-break: break-word; }
.review-score { color: var(--c-primary); font-weight: 700; }
.item-date { color: var(--c-text-muted); font-size: .8rem; }
.item-date em { color: var(--c-accent); font-style: normal; margin-left: .3rem; }
.link-button { background: none; border: none; padding: 0; color: var(--c-text-muted); font-size: .8rem; cursor: pointer; }
.link-button:hover { color: var(--c-primary); }
.comment-list { margin-top: 1rem; }
.comment-item { display: flex; gap: .75rem; padding: .9rem 0; border-bottom: 1px solid var(--c-border); }
.comment-item:last-child { border-bottom: none; }
.comment-item p { margin: .3rem 0; white-space: pre-wrap; word-break: break-word; }
.comment-avatar {
    width: 2.25rem; height: 2.25rem; flex: 0 0 auto; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-indigo)); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.comment-form textarea { margin-bottom: .5rem; }
/* 图形验证码行 */
.captcha-row { display: flex; align-items: center; gap: .5rem; }
.captcha-row .form-control { width: 150px; }
.captcha-img { height: 42px; width: 120px; border: 1px solid var(--c-border, #dee2e6); border-radius: 6px; cursor: pointer; background: #fff; }
.site-logo { height: 32px; width: auto; border-radius: 6px; }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 1.5rem 0;
    margin-top: 3rem;
    font-size: 0.9rem;
}
.site-footer a { color: #cbd5e1; }

/* ============================================================
   Scratch 编辑器（保留并微调）
   ============================================================ */
.scratch-editor-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    min-height: 500px;
}
.scratch-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border: 1px solid var(--c-border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    gap: 12px;
    flex-wrap: wrap;
}
.scratch-meta { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.scratch-actions { display: flex; align-items: center; gap: 8px; }
.scratch-iframe-wrap {
    flex: 1;
    border: 1px solid var(--c-border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    overflow: hidden;
    min-height: 0;
    box-shadow: var(--c-shadow);
}
.scratch-iframe-wrap iframe { width: 100%; height: 100%; border: none; display: block; }

/* ============================================================
   Python 代码编辑器（保留）
   ============================================================ */
.python-editor-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    min-height: 500px;
}
.python-code-area {
    flex: 1;
    display: flex;
    border: 1px solid var(--c-border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    overflow: hidden;
    min-height: 0;
    background: #1e1e1e;
}
.python-line-numbers {
    width: 50px;
    background: #2d2d2d;
    color: #858585;
    text-align: right;
    padding: 12px 8px 12px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    user-select: none;
    overflow: hidden;
    white-space: pre;
    border-right: 1px solid #404040;
}
.python-code-textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: #1e1e1e;
    color: #d4d4d4;
    tab-size: 4;
    white-space: pre;
    overflow: auto;
}
.python-code-textarea::placeholder { color: #6a6a6a; }
.python-viewer-code {
    background: #1e1e1e;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 16px;
    overflow: auto;
    max-height: calc(100vh - 220px);
}
.python-viewer-code pre {
    margin: 0;
    background: transparent !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}
.python-viewer-code code { background: transparent !important; padding: 0 !important; }

/* ---------- Python 作品预览面板（源码 + 运行输出）---------- */
.python-preview {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}
.python-preview-toolbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    padding: .6rem .8rem;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border-bottom: 1px solid var(--c-border);
}
.python-preview-status { font-size: .82rem; color: var(--c-text-muted); }
.python-preview-source { border-top: 1px solid var(--c-border); }
.python-preview-source > summary {
    cursor: pointer;
    padding: .5rem .8rem;
    font-size: .85rem;
    color: var(--c-text-muted);
    background: #f8fafc;
    user-select: none;
}
.python-preview-code {
    max-height: 320px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.6;
}
/* 源码区统一采用 Prism 浅色主题（覆盖附件内联预览的深色 pre 样式），保证语法高亮清晰可读 */
.python-preview .python-preview-code,
.python-preview .python-preview-code[class*="language-"] {
    background: #f5f2f0;
    color: #1e293b;
    margin: 0;
    padding: .9rem 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}
.python-preview .python-preview-code code {
    background: transparent !important;
    padding: 0 !important;
    color: inherit;
}
.python-preview-output { border-top: 1px solid var(--c-border); }
.python-preview-output-head {
    padding: .45rem .8rem;
    font-size: .85rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--c-border);
}
.python-preview-log {
    margin: 0;
    min-height: 120px;
    max-height: 320px;
    overflow: auto;
    padding: .8rem 1rem;
    background: #1e1e1e;
    color: #d4d4d4;
    font-size: 13px;
    line-height: 1.6;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}
.python-preview-log .py-err { color: #f48771; }
.python-preview-log .py-ok { color: #89d185; }

/* ============================================================
   群众评分 / 证书 / 海报
   ============================================================ */
.score-seal.audience-score { background: linear-gradient(135deg, #6f42c1, #8b5cf6); }
.audience-score-box { padding: 16px; background: #f8fafc; border-radius: var(--radius-sm); }

.competition-poster { width: 100%; border-radius: var(--radius-sm); box-shadow: var(--c-shadow-lg); }
.qr-card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 24px 16px;
    box-shadow: var(--c-shadow);
}
.qr-card #qrcode { background: #fff; padding: 10px; border-radius: 6px; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .hero-section { padding: 2rem 1.2rem; }
    .hero-section h1 { font-size: 1.8rem; }
    .hero-art { height: 220px; }
    .stats-strip { grid-template-columns: repeat(2, 1fr); }
}
