/* ===== MC建筑分享站 站点样式（Lonzov 风格：全局过渡 + 鼠标跟随高光 + 页面上滑动画）===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root,
[data-theme="light"] {
    --bg-color: #F5F7F9;
    --bg-card: #FFFFFF;
    --bg-sub: #F0F2F5;
    --text-primary: #1A1A1A;
    --text-secondary: #525252;
    --text-tertiary: #A0A0A0;
    --border-color: #E0E0E0;
    --sider-border: #D0D0D0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --accent: #2d7ff9;
    --bezier: cubic-bezier(0.4, 0, 0.2, 1);
    color-scheme: light;
}

[data-theme="dark"] {
    --bg-color: #111111;
    --bg-card: #191919;
    --bg-sub: #242424;
    --text-primary: #E8E8E8;
    --text-secondary: #A0A0A0;
    --text-tertiary: #606060;
    --border-color: #2B2B2B;
    --sider-border: #2B2B2B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    -webkit-appearance: none;
    appearance: none;
}

/* ===== 全局丝滑过渡 ===== */
body, button, input, select, textarea, a, img, svg, path, circle, rect,
div, span, p, h1, h2, h3, h4, h5, h6, ul, ol, li, i {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease,
        box-shadow 0.4s ease, fill 0.4s ease, stroke 0.4s ease;
}

/* ===== 页面进入动画（上滑淡入）===== */
@keyframes page-enter {
    from { opacity: 0; transform: translateY(100px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-enter {
    animation: page-enter 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    .page-enter { animation: none; }
    html { scroll-behavior: auto; }
}

/* ===== 鼠标跟随边框高光 ===== */
.glow-border {
    --glow-size: 150px;
    --glow-color: 120, 170, 255;
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(
        var(--glow-size) circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(var(--glow-color), 0.9)  0%,
        rgba(var(--glow-color), 0.5)  5%,
        rgba(var(--glow-color), 0.28) 10%,
        rgba(var(--glow-color), 0.16) 15%,
        rgba(var(--glow-color), 0.10) 20%,
        rgba(var(--glow-color), 0.06) 30%,
        rgba(var(--glow-color), 0.03) 40%,
        rgba(var(--glow-color), 0.02) 55%,
        transparent                    100%
    );
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: destination-out;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s ease;
}

.glow-border.glow-active::before {
    opacity: 1;
}

/* ===== 布局 ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 0 24px;
}

.main-inner {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0 24px;
}

.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 0 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ===== 左侧栏 ===== */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--bg-color);
    border-right: 1px solid var(--sider-border);
    z-index: 100;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 12px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px 20px;
    font-weight: 700;
    font-size: 17px;
    color: var(--text-primary);
}

.sidebar-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 19px;
    color: var(--accent);
}

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

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 14.5px;
    transition: background-color 0.3s var(--bezier), color 0.3s var(--bezier);
}

.sidebar-nav-item:hover {
    background: var(--bg-sub);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--bg-sub);
    color: var(--text-primary);
    font-weight: 600;
}

.sidebar-nav-icon {
    width: 18px;
    font-size: 15px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px 4px 4px;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14.5px;
    cursor: pointer;
    transition: background-color 0.3s var(--bezier), color 0.3s var(--bezier), transform 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-sub);
    color: var(--text-primary);
}

.theme-toggle-icon {
    width: 18px;
    font-size: 15px;
    text-align: center;
    transition: opacity 0.15s ease, color 0.4s ease;
}

.theme-toggle-label {
    transition: opacity 0.15s ease;
}

.theme-toggle-mini {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.theme-toggle-mini .theme-toggle-icon {
    width: auto;
    font-size: 17px;
}

.sidebar-mask {
    display: none;
}

.mobile-topbar {
    display: none;
}

/* ===== 首页 ===== */
.home-hero {
    text-align: center;
    padding: 40px 16px 28px;
}

.home-hero h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
}

.home-hero-divider {
    width: 56px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin: 14px auto 16px;
}

.home-hero p {
    color: var(--text-secondary);
    font-size: 15px;
}

.home-hero-link {
    color: var(--accent);
    font-weight: 600;
    word-break: break-all;
}

.home-hero-link:hover {
    text-decoration: underline;
}

.home-search {
    max-width: 480px;
    margin: 22px auto 8px;
    position: relative;
}

.home-search input {
    width: 100%;
    padding: 12px 18px 12px 44px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.3s var(--bezier), box-shadow 0.3s var(--bezier);
}

.home-search input:focus {
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 2px rgba(45, 127, 249, 0.2);
}

.home-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
    pointer-events: none;
}

.home-section-title {
    margin: 30px 0 16px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--accent);
    border-radius: 2px;
}

.home-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(45, 127, 249, 0.1);
    border-radius: 10px;
    padding: 1px 10px;
}

/* ===== 建筑卡片网格 ===== */
.build-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.build-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.build-card:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.build-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-sub);
    overflow: hidden;
}

.build-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.build-card:hover .build-card-cover img {
    transform: scale(1.05);
}

.build-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 34px;
}

.build-card-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    line-height: 1.6;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.build-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 14px 14px;
    min-width: 0;
}

.build-card-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.build-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 39px;
}

.build-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.build-card-meta i {
    margin-right: 3px;
}

.build-card-date {
    margin-left: auto;
}

.empty-hint {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13.5px;
    padding: 24px 0;
}

/* ===== 详情页 ===== */
.detail-back {
    margin-bottom: 18px;
}

.detail-back a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-back a:hover {
    color: var(--accent);
}

.detail-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    align-items: start;
}

.detail-cover {
    padding: 0;
    overflow: hidden;
}

.detail-cover img {
    width: 100%;
    display: block;
    object-fit: contain;
    max-height: 560px;
    background: var(--bg-sub);
}

.detail-placeholder {
    aspect-ratio: 16 / 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-tertiary);
    font-size: 56px;
    background: var(--bg-sub);
}

.detail-placeholder p {
    font-size: 14px;
}

.detail-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
}

.detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.detail-meta .build-card-badge {
    position: static;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.detail-tag {
    padding: 2px 12px;
    border-radius: 12px;
    background: rgba(45, 127, 249, 0.1);
    color: var(--accent);
    font-size: 12.5px;
}

.detail-desc {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
}

.detail-download {
    margin-top: 16px;
}

.detail-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-sub);
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 14px;
}

.detail-file-row i {
    color: var(--accent);
    font-size: 18px;
}

.detail-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 15px;
}

.detail-code {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-code b {
    color: var(--accent);
    font-size: 16px;
    letter-spacing: 1px;
}

.btn-copy {
    padding: 4px 14px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12.5px;
    cursor: pointer;
}

.btn-copy:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== 通用面板 / 按钮 ===== */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 9px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s var(--bezier), opacity 0.3s var(--bezier), transform 0.3s var(--bezier);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: #1f6ae0;
    transform: translateY(-1px);
    color: #fff;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ===== 反馈页 ===== */
.feedback-hero {
    text-align: center;
    padding: 30px 16px 10px;
}

.feedback-hero h1 {
    font-size: 26px;
    font-weight: 700;
}

.feedback-hero p {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 14.5px;
}

.feedback-mail-line a {
    color: var(--accent);
}

.feedback-form {
    max-width: 560px;
    margin: 24px auto 0;
}

.feedback-form label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    margin: 14px 0 6px;
}

.feedback-form input,
.feedback-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.3s var(--bezier), box-shadow 0.3s var(--bezier);
}

.feedback-form input:focus,
.feedback-form textarea:focus {
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 2px rgba(45, 127, 249, 0.15);
}

.feedback-form textarea {
    min-height: 140px;
    resize: vertical;
}

.form-msg {
    margin-top: 12px;
    font-size: 13.5px;
    min-height: 20px;
}

.form-msg.ok { color: #27ae60; }
.form-msg.err { color: #e74c3c; }

/* ===== 维护/空提示 ===== */
.maintenance-box {
    text-align: center;
    padding: 60px 20px;
}

.maintenance-box .icon {
    font-size: 42px;
    color: var(--text-tertiary);
}

.maintenance-box h2 {
    margin: 14px 0 8px;
    font-size: 20px;
}

.maintenance-box p {
    color: var(--text-secondary);
    font-size: 14px;
}

.maintenance-box a {
    color: var(--accent);
    display: inline-block;
    margin-top: 18px;
}

/* ===== 响应式（移动端适配）===== */
@media (max-width: 860px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 16px;
        padding-top: env(safe-area-inset-top, 0);
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid rgba(224, 224, 224, 0.5);
        z-index: 200;
    }

    [data-theme="dark"] .mobile-topbar {
        background: rgba(25, 25, 25, 0.75);
        border-bottom-color: rgba(43, 43, 43, 0.6);
    }

    body {
        padding-top: 56px;
        padding-top: calc(56px + env(safe-area-inset-top, 0));
    }

    .mobile-brand {
        font-weight: 700;
        font-size: 16px;
        flex: 1;
        text-align: center;
    }

    .mobile-menu-btn {
        width: 34px;
        height: 30px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
        flex-shrink: 0;
    }

    .mobile-menu-btn span {
        display: block;
        height: 2px;
        width: 100%;
        background: var(--text-primary);
        border-radius: 1px;
        transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out;
    }

    body.nav-open .mobile-menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    body.nav-open .mobile-menu-btn span:nth-child(2) { opacity: 0; }
    body.nav-open .mobile-menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.3s var(--bezier);
        box-shadow: none;
        height: 100vh;
        height: 100dvh;
        background: var(--bg-color);
        z-index: 210;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.2);
    }

    .sidebar-inner {
        padding-top: calc(20px + env(safe-area-inset-top, 0));
    }

    .sidebar.open .sidebar-mask {
        display: block;
        position: fixed;
        inset: 0;
        left: 0;
        top: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: -1;
    }

    .main {
        padding: 0 14px;
        min-width: 0;
    }

    .main-inner {
        padding-top: 20px;
    }

    .home-hero {
        padding: 24px 16px 18px;
    }

    .home-hero h1 {
        font-size: 26px;
    }

    .build-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 16px;
    }

    .feedback-form input,
    .feedback-form textarea {
        font-size: 16px; /* 防止 iOS 聚焦自动缩放 */
    }

    .btn {
        padding: 12px 28px;
        font-size: 15px;
    }

    .site-footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    }
}

/* 超窄屏 */
@media (max-width: 480px) {
    .main {
        padding: 0 10px;
    }

    .home-hero h1 {
        font-size: 22px;
    }

    .build-grid {
        grid-template-columns: 1fr 1fr;
    }

    .detail-title {
        font-size: 20px;
    }
}
