/* 雀庄详情 — 自适应布局 */

:root {
    --sd-primary: #fa9715;
    --sd-primary-dark: #e08610;
    --sd-primary-soft: rgba(250, 151, 21, 0.12);
    --sd-bg-deep: #1a1a2e;
    --sd-text: #1f2937;
    --sd-text-muted: #6b7280;
    --sd-border: rgba(15, 23, 42, 0.08);
    --sd-surface: rgba(255, 255, 255, 0.96);
    --sd-radius: 14px;
    --sd-radius-sm: 10px;
    --sd-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
    --sd-header-h: 56px;
    --sd-safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.sd-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--sd-text);
    line-height: 1.6;
    background-color: #f3f4f6;
    background-image:
        linear-gradient(180deg, rgba(250, 151, 21, 0.07) 0%, transparent 28%),
        url("/static/images/background.png");
    background-size: cover, cover;
    background-position: center, center;
    background-attachment: fixed, fixed;
}

.sd-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--sd-header-h);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--sd-border);
}

.sd-header-inner {
    max-width: 880px;
    margin: 0 auto;
    height: 100%;
    padding: 0 clamp(12px, 3vw, 24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sd-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sd-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--sd-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.04);
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.sd-back:hover {
    background: var(--sd-primary-soft);
    color: var(--sd-primary-dark);
}

.sd-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--sd-primary);
    font-weight: 700;
    font-size: 15px;
}

.sd-brand-logo {
    border-radius: 8px;
}

@media (max-width: 520px) {
    .sd-back-text {
        display: none;
    }
}

.sd-main {
    max-width: 880px;
    margin: 0 auto;
    padding: clamp(16px, 3vw, 28px) clamp(12px, 3vw, 24px) calc(28px + var(--sd-safe-bottom));
}

.sd-card {
    background: var(--sd-surface);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius);
    box-shadow: var(--sd-shadow);
    overflow: hidden;
}

.sd-hero {
    position: relative;
    min-height: 140px;
    padding: clamp(20px, 4vw, 28px);
    background: linear-gradient(135deg, rgba(250, 151, 21, 0.18) 0%, rgba(26, 26, 46, 0.04) 100%);
    border-bottom: 1px solid var(--sd-border);
}

.sd-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.22;
}

.sd-hero-inner {
    position: relative;
    display: flex;
    gap: clamp(14px, 3vw, 20px);
    align-items: flex-start;
}

.sd-logo {
    width: clamp(72px, 18vw, 96px);
    height: clamp(72px, 18vw, 96px);
    border-radius: 14px;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.sd-title-wrap {
    flex: 1;
    min-width: 0;
}

.sd-title {
    margin: 0 0 10px;
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    font-weight: 700;
    color: var(--sd-bg-deep);
    line-height: 1.25;
    word-break: break-word;
}

.sd-meta-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sd-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--sd-text-muted);
    word-break: break-word;
}

.sd-meta-item a {
    color: var(--sd-primary-dark);
    text-decoration: none;
}

.sd-meta-item a:hover {
    text-decoration: underline;
}

.sd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.sd-tag {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sd-primary-dark);
    background: var(--sd-primary-soft);
    border: 1px solid rgba(250, 151, 21, 0.25);
}

.sd-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--sd-border);
    border-bottom: 1px solid var(--sd-border);
}

.sd-stat {
    padding: 16px 12px;
    text-align: center;
    background: #fff;
}

.sd-stat-value {
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: 700;
    color: var(--sd-primary-dark);
}

.sd-stat-label {
    margin-top: 4px;
    font-size: 12px;
    color: var(--sd-text-muted);
}

.sd-section {
    padding: clamp(18px, 3vw, 24px);
    border-bottom: 1px solid var(--sd-border);
}

.sd-section:last-of-type {
    border-bottom: none;
}

.sd-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--sd-bg-deep);
}

.sd-blurb {
    font-size: 14px;
    line-height: 1.8;
    color: var(--sd-text);
    word-break: break-word;
}

.sd-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.sd-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--sd-radius-sm);
    cursor: pointer;
    border: 1px solid var(--sd-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sd-gallery img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.sd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: clamp(16px, 3vw, 20px);
    background: #fafafa;
}

.sd-btn {
    flex: 1 1 auto;
    min-width: min(100%, 140px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
}

.sd-btn:active {
    transform: scale(0.98);
}

.sd-btn-primary {
    background: linear-gradient(135deg, var(--sd-primary) 0%, var(--sd-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(250, 151, 21, 0.35);
}

.sd-btn-primary:hover {
    filter: brightness(1.05);
}

.sd-btn-ghost {
    background: #fff;
    color: var(--sd-text);
    border: 1px solid var(--sd-border);
}

.sd-btn-ghost:hover {
    border-color: var(--sd-primary);
    color: var(--sd-primary-dark);
}

.sd-footer {
    max-width: 880px;
    margin: 0 auto;
    padding: 12px clamp(12px, 3vw, 24px) calc(20px + var(--sd-safe-bottom));
    text-align: center;
}

.sd-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--sd-text-muted);
}

.sd-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.88);
}

.sd-lightbox.is-open {
    display: flex;
}

.sd-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.sd-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .sd-stats {
        grid-template-columns: 1fr;
    }
}
