/* 奥丁曝光台 — 简约层次：石板中性底 + 靛蓝强调 + 琥珀点缀 */
:root {
    --white: #ffffff;
    --bg-page: #f1f5f9;
    --bg-muted: #e8eef5;
    --bg-elevated: #f8fafc;
    /* 主色：靛蓝，耐看不刺眼 */
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: #6366f1;
    --accent-soft: rgba(79, 70, 229, 0.09);
    --accent-soft-strong: rgba(79, 70, 229, 0.14);
    /* 兼容旧变量名 */
    --blue: var(--accent);
    --blue-focus: var(--accent-light);
    --text: #1e293b;
    --text-secondary: #64748b;
    --placeholder: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --tab-bar-bg: #e2e8f0;
    --icon-muted: #94a3b8;
    --warm-accent: #d97706;
    --warm-accent-soft: rgba(217, 119, 6, 0.12);
    --radius: 10px;
    --radius-sm: 8px;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 28px rgba(15, 23, 42, 0.07);
    --shadow-soft: 0 4px 20px rgba(15, 23, 42, 0.06);
    --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", sans-serif;
}

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

html {
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg-page);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -30%, rgba(79, 70, 229, 0.07), transparent 55%),
        radial-gradient(ellipse 90% 60% at 100% 100%, rgba(217, 119, 6, 0.04), transparent 45%),
        linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
    background-attachment: fixed;
}

/* ========== 顶部横栏 · 曝光（深色简约 + 琥珀底边点缀） ========== */
.exposure-bar {
    width: 100%;
    background: linear-gradient(105deg, #0f172a 0%, #1e293b 42%, #334155 100%);
    color: #f8fafc;
    box-shadow: var(--shadow-soft);
    border-bottom: 2px solid rgba(251, 191, 36, 0.55);
}

.exposure-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 12px 16px;
    text-align: center;
}

.exposure-bar-word {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.45em;
    text-indent: 0.45em;
    color: #fef3c7;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.exposure-bar-line {
    opacity: 0.45;
    font-weight: 300;
    font-size: 1.1rem;
    user-select: none;
}

.exposure-bar-desc {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #cbd5e1;
}

@media (min-width: 768px) {
    .exposure-bar-inner {
        padding: 14px 28px;
        gap: 10px 18px;
    }

    .exposure-bar-word {
        font-size: 1.65rem;
    }

    .exposure-bar-desc {
        font-size: 0.92rem;
    }
}

@media (min-width: 1024px) {
    .exposure-bar-inner {
        padding: 16px 40px;
    }

    .exposure-bar-word {
        font-size: 1.75rem;
        letter-spacing: 0.5em;
        text-indent: 0.5em;
    }
}

.shell {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px 16px 32px;
}

/* ========== 站点 Logo + 标题 ========== */
.site-brand {
    margin-bottom: 18px;
}

.site-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    transition: opacity 0.2s;
}

.site-brand-link:hover {
    opacity: 0.88;
}

.site-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.site-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.25;
}

/* ========== PC 侧栏布局（大屏再启用，见 1024px） ========== */
.app-layout {
    display: block;
}

.app-sidebar {
    display: none;
}

.app-main {
    min-width: 0;
}

.mobile-nav {
    display: block;
}

/* ========== Tab 导航 ========== */
.tab-bar {
    display: flex;
    background: var(--tab-bar-bg);
    border-radius: var(--radius);
    margin-bottom: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.tab-link {
    flex: 1;
    text-align: center;
    padding: 14px 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
    position: relative;
    transition: color 0.2s;
}

.tab-link:hover {
    color: var(--blue);
}

.tab-link.is-active {
    color: var(--blue);
    font-weight: 600;
}

.tab-link.is-active::after {
    content: "";
    position: absolute;
    left: 22%;
    right: 22%;
    bottom: 0;
    height: 3px;
    background: var(--blue);
    border-radius: 2px 2px 0 0;
}

/* ========== 表单字段 ========== */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    margin: 0;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.field-limit {
    font-weight: 500;
    font-size: 13px;
    color: var(--placeholder);
}

/* QQ 输入 + 右侧 # */
.input-qq-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-qq-wrap input[type="text"] {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s;
}

.input-qq-wrap input::placeholder {
    color: var(--placeholder);
}

.input-qq-wrap input:hover {
    border-color: var(--border-strong);
}

.input-qq-wrap input:focus {
    border-color: var(--blue-focus);
}

.input-qq-suffix {
    position: absolute;
    right: 14px;
    color: var(--placeholder);
    font-size: 16px;
    font-weight: 600;
    pointer-events: none;
}

/* 多行说明 */
textarea.field-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

textarea.field-textarea::placeholder {
    color: var(--placeholder);
}

textarea.field-textarea:hover {
    border-color: var(--border-strong);
}

textarea.field-textarea:focus {
    border-color: var(--blue-focus);
}

/* ========== 上传块 + 照片墙预览 ========== */
.upload-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-wall {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

@media (max-width: 360px) {
    .preview-wall {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    vertical-align: middle;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.preview-remove:active {
    background: rgba(0, 0, 0, 0.7);
}

.preview-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.25;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    max-height: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
}

.upload-count {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========== 上传区域 ========== */
.upload-zone {
    position: relative;
    display: block;
    min-height: 128px;
    padding: 20px 16px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover {
    border-color: var(--border-strong);
    background: var(--bg-elevated);
}

.upload-zone:focus-within {
    border-color: var(--accent-light);
    background: var(--accent-soft);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.upload-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    pointer-events: none;
}

.upload-zone .icon-svg {
    width: 36px;
    height: 36px;
    color: var(--icon-muted);
}

.upload-zone-title {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-zone-hint {
    margin: 0;
    font-size: 12px;
    color: var(--placeholder);
}

.upload-zone-files {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    max-width: 100%;
    word-break: break-all;
    pointer-events: none;
}

/* ========== 按钮 ========== */
.btn-submit {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: var(--white);
    background: var(--blue);
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn-submit:hover {
    background: var(--accent-light);
    box-shadow: 0 6px 20px var(--accent-soft-strong);
}

.btn-submit:active {
    opacity: 0.92;
}

/* ========== 提示消息 ========== */
.msg {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.45;
}

.msg.ok {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.msg.err {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.msg-paths {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(4, 120, 87, 0.18);
    font-size: 12px;
    color: #047857;
    line-height: 1.5;
}

.msg-paths-title {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
}

.msg-paths-group {
    margin: 8px 0 4px;
    font-weight: 600;
    font-size: 12px;
}

.msg-paths-list {
    margin: 0;
    padding-left: 1.1rem;
}

.msg-paths-list code {
    font-size: 11px;
    word-break: break-all;
    background: rgba(255, 255, 255, 0.65);
    padding: 1px 4px;
    border-radius: 4px;
}

/* ========== 查询页：搜索条 ========== */
.search-panel {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

.search-panel:focus-within {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px 0 14px;
    color: var(--placeholder);
    flex-shrink: 0;
}

.search-icon-wrap svg {
    width: 18px;
    height: 18px;
    display: block;
}

.search-panel input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 14px 8px 14px 0;
    border: none;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    outline: none;
}

.search-panel input::placeholder {
    color: var(--placeholder);
}

.btn-search {
    flex-shrink: 0;
    padding: 0 20px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--white);
    background: var(--blue);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-search:hover {
    background: var(--accent-light);
}

/* ==========            查询结果 ========== */
.result-heading {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.result-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 16px 18px;
    box-shadow: var(--shadow-card);
}

.result-qq-line {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.result-qq-line span {
    font-weight: 700;
}

.result-time {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

.result-intro {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.result-gallery-label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.result-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.result-gallery:last-child {
    margin-bottom: 0;
}

.result-gallery a {
    display: block;
    width: 88px;
    height: 88px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-page);
    flex-shrink: 0;
}

.result-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.result-empty {
    font-size: 13px;
    color: var(--placeholder);
    margin: 0;
}

/* ========== 桌面端 / 大屏（PC 阅读与操作更舒适） ========== */
@media (min-width: 768px) {
    body {
        font-size: 15px;
    }

    .shell {
        max-width: 620px;
        padding: 28px 32px 40px;
    }

    .site-brand {
        margin-bottom: 22px;
    }

    .site-logo {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .site-title {
        font-size: 1.5rem;
    }

    .tab-bar {
        margin-bottom: 26px;
        border-radius: 12px;
    }

    .tab-link {
        padding: 16px 16px;
        font-size: 15px;
    }

    .form-fields {
        gap: 24px;
    }

    .field-label {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .input-qq-wrap input[type="text"],
    textarea.field-textarea {
        padding: 13px 42px 13px 16px;
        border-radius: 10px;
        font-size: 15px;
    }

    textarea.field-textarea {
        min-height: 140px;
    }

    .upload-zone {
        min-height: 132px;
        padding: 22px 18px;
        border-radius: 10px;
    }

    .preview-wall {
        gap: 10px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .btn-submit {
        padding: 15px 22px;
        border-radius: 10px;
        margin-top: 4px;
    }

    .search-panel {
        border-radius: 12px;
        margin-bottom: 22px;
    }

    .search-panel input[type="text"] {
        padding: 15px 10px 15px 0;
        font-size: 15px;
    }

    .btn-search {
        padding: 0 26px;
        font-size: 15px;
    }

    .result-heading {
        font-size: 18px;
        margin-bottom: 14px;
    }

    .result-card {
        padding: 22px 22px 24px;
        border-radius: 12px;
    }

    .result-qq-line {
        font-size: 17px;
    }

    .result-intro {
        font-size: 15px;
        line-height: 1.7;
    }

    .result-gallery {
        gap: 10px;
    }

    .result-gallery a {
        width: 102px;
        height: 102px;
        border-radius: 10px;
    }
}

@media (min-width: 1024px) {
    body {
        font-size: 16px;
        line-height: 1.55;
    }

    .app-layout {
        display: flex;
        align-items: stretch;
        min-height: 100vh;
    }

    .app-sidebar {
        display: flex;
        flex-direction: column;
        width: 260px;
        flex-shrink: 0;
        padding: 28px 16px 24px;
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        border-right: 1px solid var(--border);
        box-shadow: 4px 0 32px rgba(15, 23, 42, 0.05);
        position: sticky;
        top: 0;
        align-self: flex-start;
        min-height: 100vh;
        box-sizing: border-box;
    }

    .sidebar-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        text-decoration: none;
        color: var(--text);
        gap: 14px;
        padding: 8px 8px 28px;
        margin-bottom: 8px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }

    .sidebar-brand:hover {
        opacity: 0.92;
    }

    .sidebar-logo {
        width: 72px;
        height: 72px;
        border-radius: 18px;
        object-fit: cover;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
    }

    .sidebar-title {
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        line-height: 1.4;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .sidebar-link {
        display: block;
        padding: 14px 18px;
        border-radius: 12px;
        text-decoration: none;
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 15px;
        transition: background 0.2s, color 0.2s;
    }

    .sidebar-link:hover {
        background: var(--accent-soft);
        color: var(--accent);
    }

    .sidebar-link.is-active {
        background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
        color: #fff;
        box-shadow: 0 6px 18px var(--accent-soft-strong);
    }

    .mobile-nav {
        display: none !important;
    }

    .app-main {
        flex: 1;
        min-width: 0;
        background: linear-gradient(
            165deg,
            rgba(241, 245, 249, 0.95) 0%,
            rgba(238, 242, 248, 0.98) 45%,
            rgba(248, 250, 252, 1) 100%
        );
        background-attachment: fixed;
        padding: 32px 28px 48px;
        box-sizing: border-box;
    }

    .shell.shell--content {
        width: 100%;
        max-width: min(1080px, calc(100vw - 260px - 64px));
        margin: 0 auto;
        padding: 36px 48px 48px;
        background: var(--white);
        border-radius: 16px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-card);
    }

    /* 主内容区已是白卡片，搜索条 / 结果区轻度区分层次 */
    .search-panel {
        box-shadow: none;
        background: var(--bg-elevated);
        border-color: var(--border);
    }

    .search-panel:focus-within {
        background: var(--white);
    }

    .result-card {
        background: var(--bg-elevated);
        border-color: var(--border);
        box-shadow: none;
    }

    .preview-wall {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 12px;
    }

    .preview-item {
        border-radius: 10px;
    }

    .upload-block {
        gap: 12px;
    }

    .field-label {
        font-size: 16px;
    }

    .input-qq-wrap input[type="text"],
    textarea.field-textarea {
        font-size: 16px;
    }

    .result-gallery a {
        width: 116px;
        height: 116px;
    }

    .msg {
        border-radius: 10px;
    }
}

@media (min-width: 1400px) {
    .app-sidebar {
        width: 280px;
        padding: 32px 20px 28px;
    }

    .shell.shell--content {
        max-width: min(1280px, calc(100vw - 280px - 80px));
        padding: 40px 56px 52px;
    }
}

/* ========== 档案上传 · 提交中全屏遮罩 ========== */
/* 不用 backdrop-filter：全屏模糊会每帧重算底层像素，低端机/微信内核极易卡顿 */
.page-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(15, 23, 42, 0.58);
    /* 独立合成层，减少与下方页面的互相重绘 */
    isolation: isolate;
}

.page-loading-overlay[hidden] {
    display: none !important;
}

.page-loading-spinner {
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.28);
    border-top-color: var(--accent);
    border-radius: 50%;
    will-change: transform;
    animation: page-loading-spin 0.9s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .page-loading-spinner {
        animation: none;
        will-change: auto;
        border-color: rgba(255, 255, 255, 0.35);
        border-top-color: var(--accent);
        opacity: 0.95;
    }
}

@keyframes page-loading-spin {
    from {
        transform: translateZ(0) rotate(0deg);
    }
    to {
        transform: translateZ(0) rotate(360deg);
    }
}

.page-loading-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
