/* ==========================================================
   清思纪念堂 · 自定义样式（配合 Tailwind CSS 使用）
   主题：暗黑 · 黑绿
   ========================================================== */

:root {
    --qs-bg: #050807;
    --qs-bg-soft: #080e0b;
    --qs-panel: #0b120f;
    --qs-line: #18251f;
    --qs-line-soft: #121c17;
    --qs-text: #dbe7df;
    --qs-muted: #7f948b;
    --qs-jade: #22c55e;
    --qs-jade-light: #4ade80;
    --qs-jade-dim: #15803d;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--qs-bg);
    color: var(--qs-text);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 背景氛围：极淡的绿色辉光 + 细网格 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(34, 197, 94, 0.09), transparent 70%),
        radial-gradient(700px 400px at 100% 100%, rgba(21, 128, 61, 0.06), transparent 70%);
}

.qs-grid-lines {
    background-image:
        linear-gradient(to right, rgba(34, 197, 94, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(34, 197, 94, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
}

.font-serif-cn {
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
}

/* ---------- 通用组件 ---------- */
.qs-card {
    background: linear-gradient(180deg, rgba(14, 22, 18, 0.9), rgba(9, 14, 12, 0.9));
    border: 1px solid var(--qs-line);
    border-radius: 14px;
}

.qs-card-hover {
    transition: border-color .25s, transform .25s, box-shadow .25s;
}
.qs-card-hover:hover {
    border-color: rgba(34, 197, 94, 0.45);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -20px rgba(34, 197, 94, 0.5);
}

.qs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .6rem 1.15rem;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.2;
    border: 1px solid transparent;
    transition: all .2s ease;
    cursor: pointer;
    white-space: nowrap;
}
.qs-btn:disabled { opacity: .55; cursor: not-allowed; }

.qs-btn-primary {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    color: #04140a;
    box-shadow: 0 8px 24px -12px rgba(34, 197, 94, .9);
}
.qs-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

.qs-btn-ghost {
    background: rgba(34, 197, 94, 0.07);
    border-color: rgba(34, 197, 94, 0.28);
    color: #86efac;
}
.qs-btn-ghost:hover { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, .55); }

.qs-btn-plain {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--qs-line);
    color: var(--qs-muted);
}
.qs-btn-plain:hover { color: var(--qs-text); border-color: #2a3d33; background: rgba(255,255,255,.05); }

.qs-btn-danger {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .35);
    color: #fca5a5;
}
.qs-btn-danger:hover { background: rgba(239, 68, 68, .2); }

.qs-btn-sm { padding: .35rem .75rem; font-size: .8rem; border-radius: 8px; }

.qs-input {
    width: 100%;
    background: rgba(4, 8, 6, 0.75);
    border: 1px solid var(--qs-line);
    border-radius: 10px;
    padding: .68rem .9rem;
    color: var(--qs-text);
    font-size: .92rem;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.qs-input::placeholder { color: #55665e; }
.qs-input:focus {
    border-color: rgba(34, 197, 94, 0.65);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}
.qs-input:-webkit-autofill {
    -webkit-text-fill-color: var(--qs-text);
    -webkit-box-shadow: 0 0 0 1000px #0a100d inset;
}
textarea.qs-input { min-height: 120px; resize: vertical; line-height: 1.7; }
select.qs-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f948b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 1rem; padding-right: 2rem; }

.qs-label {
    display: block;
    font-size: .82rem;
    color: #9db0a7;
    margin-bottom: .45rem;
    letter-spacing: .02em;
}

.qs-help { font-size: .75rem; color: #5f7269; margin-top: .35rem; line-height: 1.5; }

/* 表单错误 */
.qs-field-error { color: #f87171; font-size: .76rem; margin-top: .3rem; }

/* 徽标 */
.qs-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .12rem .5rem;
    border-radius: 99px;
    font-size: .7rem;
    line-height: 1.5;
    color: var(--badge-color, #22c55e);
    background: color-mix(in srgb, var(--badge-color, #22c55e) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--badge-color, #22c55e) 35%, transparent);
}

/* 分页 */
.qs-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    flex-wrap: wrap;
    padding: 2rem 0 .5rem;
}
.qs-pager__btn,
.qs-pager__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .7rem;
    border-radius: 8px;
    border: 1px solid var(--qs-line);
    color: #9db0a7;
    font-size: .84rem;
    background: rgba(255, 255, 255, .02);
    transition: all .2s;
}
.qs-pager__btn:hover,
.qs-pager__num:hover { border-color: rgba(34, 197, 94, .5); color: #86efac; }
.qs-pager__num.is-current {
    background: rgba(34, 197, 94, .16);
    border-color: rgba(34, 197, 94, .55);
    color: #86efac;
    font-weight: 600;
}
.qs-pager__btn.is-disabled { opacity: .35; }
.qs-pager__dots { color: #4a5c53; padding: 0 .2rem; }

/* 表格 */
.qs-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.qs-table thead th {
    text-align: left;
    padding: .75rem 1rem;
    font-weight: 500;
    font-size: .78rem;
    letter-spacing: .04em;
    color: #7f948b;
    background: rgba(255, 255, 255, .025);
    border-bottom: 1px solid var(--qs-line);
    white-space: nowrap;
}
.qs-table tbody td {
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--qs-line-soft);
    color: #c3d2ca;
    vertical-align: middle;
}
.qs-table tbody tr:hover { background: rgba(34, 197, 94, .04); }

/* 侧边导航（后台） */
.qs-side-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .62rem .85rem;
    border-radius: 9px;
    font-size: .875rem;
    color: #93a79e;
    transition: all .18s;
}
.qs-side-link:hover { background: rgba(34, 197, 94, .07); color: #d1e5da; }
.qs-side-link.is-active {
    background: linear-gradient(90deg, rgba(34, 197, 94, .16), rgba(34, 197, 94, .03));
    color: #86efac;
    box-shadow: inset 2px 0 0 #22c55e;
}

/* 灵堂 */
.qs-altar {
    position: relative;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(34, 197, 94, .13), transparent 65%),
        linear-gradient(180deg, #070d0a 0%, #050807 100%);
    overflow: hidden;
}
.qs-altar::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(34, 197, 94, .05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(34, 197, 94, .05) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
    pointer-events: none;
}

/* 遗像相框 */
.qs-portrait {
    position: relative;
    border-radius: 6px;
    padding: 6px;
    background: linear-gradient(150deg, #24382d, #0d1512);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(34, 197, 94, .15);
}
.qs-portrait::before {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 10px;
    background: radial-gradient(circle, rgba(34, 197, 94, .16), transparent 70%);
    filter: blur(14px);
    z-index: -1;
}
.qs-portrait img { border-radius: 3px; display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); }

/* 蜡烛 */
.qs-candle { position: relative; width: 10px; height: 44px; border-radius: 5px; background: linear-gradient(180deg, #e8e2cf, #b9b19a); }
.qs-candle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -16px;
    width: 12px;
    height: 18px;
    margin-left: -6px;
    border-radius: 50% 50% 45% 45%;
    background: radial-gradient(circle at 50% 70%, #fff9d6, #fbbf24 45%, rgba(249, 115, 22, .25) 75%, transparent 80%);
    animation: qs-flicker 1.8s ease-in-out infinite;
    filter: blur(.4px);
}
@keyframes qs-flicker {
    0%, 100% { transform: scale(1) translateY(0); opacity: .95; }
    35% { transform: scale(.92) translateY(1px) rotate(-2deg); opacity: .8; }
    70% { transform: scale(1.05) translateY(-1px) rotate(2deg); opacity: 1; }
}

/* 香炉烟 */
.qs-smoke {
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 2px;
    height: 46px;
    background: linear-gradient(to top, rgba(180, 200, 190, .35), transparent);
    filter: blur(1px);
    animation: qs-smoke 4.5s linear infinite;
    opacity: 0;
}
@keyframes qs-smoke {
    0% { transform: translateX(0) scaleY(.4); opacity: 0; }
    25% { opacity: .6; }
    100% { transform: translateX(14px) scaleY(1.4); opacity: 0; }
}

/* 落花 */
.qs-petal {
    position: fixed;
    top: -30px;
    pointer-events: none;
    z-index: 40;
    animation: qs-fall linear forwards;
    opacity: .8;
}
@keyframes qs-fall {
    0% { transform: translateY(-10vh) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: .9; }
    100% { transform: translateY(110vh) translateX(60px) rotate(320deg); opacity: 0; }
}

/* 淡入 */
.qs-fade-up { animation: qsFadeUp .6s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes qsFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* 提示条 */
.qs-toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 90;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    max-width: 22rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    font-size: .875rem;
    background: #0d1712;
    border: 1px solid #1e2f26;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9);
    animation: qsToastIn .35s cubic-bezier(.22, .61, .36, 1) both;
}
.qs-toast.is-success { border-color: rgba(34, 197, 94, .45); color: #a7f3c6; }
.qs-toast.is-error { border-color: rgba(239, 68, 68, .45); color: #fca5a5; }
.qs-toast.is-info { border-color: rgba(56, 189, 248, .4); color: #bae6fd; }
@keyframes qsToastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: none; }
}
.qs-toast.is-hiding { animation: qsToastOut .3s ease forwards; }
@keyframes qsToastOut {
    to { opacity: 0; transform: translateX(20px); }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #060b09; }
::-webkit-scrollbar-thumb { background: #1d2e26; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #2a4438; }

/* 富文本 */
.qs-prose { line-height: 1.95; color: #c3d2ca; font-size: .95rem; word-break: break-word; }
.qs-prose p { margin: 0 0 1em; }
.qs-prose p:last-child { margin-bottom: 0; }
.qs-prose h1, .qs-prose h2, .qs-prose h3 { color: #e4efe8; margin: 1.4em 0 .6em; font-weight: 600; }
.qs-prose img { border-radius: 10px; margin: 1em 0; max-width: 100%; }
.qs-prose blockquote { border-left: 2px solid #22c55e; padding-left: 1rem; color: #8fa79c; margin: 1em 0; }

/* 选中 */
::selection { background: rgba(34, 197, 94, .3); color: #eafff2; }

/* 隐藏滚动条（横向 tab） */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* 图片上传预览 */
.qs-upload {
    border: 1px dashed #22362c;
    border-radius: 12px;
    background: rgba(255, 255, 255, .015);
    transition: border-color .2s, background .2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.qs-upload:hover { border-color: rgba(34, 197, 94, .5); background: rgba(34, 197, 94, .04); }
.qs-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

@media print {
    header, footer, .no-print { display: none !important; }
    body { background: #fff; color: #000; }
}

/* 下拉菜单项（后台/前台通用） */
.qs-menu-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .65rem;
    border-radius: 7px;
    font-size: .83rem;
    color: #a8bcb2;
    transition: all .15s;
}
.qs-menu-item:hover { background: rgba(34, 197, 94, .09); color: #86efac; }

/* 后台统计卡 */
.qs-stat {
    background: linear-gradient(180deg, rgba(14, 22, 18, .92), rgba(8, 13, 11, .92));
    border: 1px solid #17251d;
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
}
.qs-stat__label { font-size: .72rem; letter-spacing: .08em; color: #5f7269; }
.qs-stat__value { margin-top: .5rem; font-size: 1.6rem; font-weight: 600; color: #dff3e7; font-family: "Noto Serif SC", Georgia, serif; }
.qs-stat__sub { margin-top: .3rem; font-size: .72rem; color: #4d5f56; }

/* 简易柱状图 */
.qs-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.qs-bars__item { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.qs-bars__bar { width: 100%; max-width: 34px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #22c55e, rgba(34,197,94,.18)); min-height: 3px; transition: height .4s; }
.qs-bars__cap { font-size: .62rem; color: #43544c; }
