/* ========================================
   PicPath - Travel Blog Styles
   Unified cool-neutral design system
   ======================================== */

/* Playfair Display - local */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url('/fonts/PlayfairDisplay-700-900.ttf') format('truetype');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/PlayfairDisplay-italic700.ttf') format('truetype');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/PlayfairDisplay-italic900.ttf') format('truetype');
}

/* Noto Sans SC - local */
@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/NotoSansSC-300.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/NotoSansSC-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/NotoSansSC-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/NotoSansSC-700.ttf') format('truetype');
}


/* ========================================
   1. CSS Variables & Design Tokens
   ======================================== */

/* 1.1 Light Mode (default) — Cool Neutrals */
:root {
    --nav-h: 64px;
    /* Cool Neutrals */
    --bg: #ffffff;
    --bg-subtle: #f5f6f8;
    --bg-muted: #eceef2;
    --border: #dcdde3;
    --border-strong: #b8bcc5;

    /* Text */
    --text: #1c1e26;
    --text-secondary: #606676;
    --text-tertiary: #959aa8;
    --text-inverse: #f4f5f7;

    /* Accent — Cool Steel Blue (single accent color) */
    --accent: #7a8fa6;
    --accent-hover: #657888;
    --accent-muted: rgba(122, 143, 166, 0.12);

    /* Interactive */
    --link: #1c1e26;
    --link-hover: var(--accent);

    /* Functional */
    --success: #4d7a5c;
    --success-bg: #edf4ee;
    --danger: #8a4a4a;
    --danger-bg: #f7eded;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.07);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.11);

    /* Spacing */
    --radius: 6px;
    --radius-sm: 4px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    /* Layout */
    --max-width: 1320px;
    --nav-height: 68px;

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;

    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;

    /* Opacity Helpers */
    --opacity-high: 0.88;
    --opacity-medium: 0.72;
    --opacity-low: 0.55;
    --opacity-faint: 0.35;
}

/* 1.2 Dark Mode — Cool Ink */
[data-theme="dark"],
.dark-mode {
    --bg: #0c0e14;
    --bg-subtle: #12141c;
    --bg-muted: #1a1d26;
    --border: #252836;
    --border-strong: #353848;

    --text: #e4e6ee;
    --text-secondary: #8289a0;
    --text-tertiary: #505668;
    --text-inverse: #1c1e26;

    --accent: #8fa6b8;
    --accent-hover: #a4b6c8;
    --accent-muted: rgba(143, 166, 184, 0.12);

    --link: #e4e6ee;
    --link-hover: var(--accent);

    --success: #5a9060;
    --success-bg: rgba(90, 144, 96, 0.12);
    --danger: #a85555;
    --danger-bg: rgba(168, 85, 85, 0.12);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 2px 8px rgba(0,0,0,0.32);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.38);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.48);
}

/* 1.3 CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--duration-normal) var(--ease-smooth), color var(--duration-normal) var(--ease-smooth);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
    color: var(--link-hover);
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Image loading state */
img[loading="lazy"] {
    background: var(--bg-muted);
    min-height: 100px;
}

img[loading="lazy"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-subtle) 50%, var(--bg-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

button {
    font-family: inherit;
    cursor: pointer;
}

input, textarea, select {
    font-family: inherit;
}

/* 1.4 Dark mode — auto-apply based on system preference */
@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) {
        color-scheme: dark;
    }
}
/* ========================================
   2. Layout Components
   ======================================== */

/* 2.1 Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 48px;
}

/* 2.2 Navigation Container (Admin) */
.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 48px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: 0.08em;
}

/* 2.3 Main Content */
.main {
    padding-top: var(--nav-height);
}

/* 2.4 Footer */
.footer {
    position: relative;
    background: var(--bg-muted);
    padding: 32px 0 calc(32px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
}

/* Dark mode footer */
[data-theme="dark"] .footer {
    background: rgba(10, 14, 26, 0.65);
    backdrop-filter: saturate(150%) blur(20px);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    letter-spacing: 0.3px;
}

[data-theme="dark"] .footer-content p {
    color: rgba(255, 255, 255, 0.38);
}

.footer-content .icp {
    margin-top: 8px;
}

.footer-content .icp a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

.footer-content .icp a:hover {
    color: var(--text-secondary);
}

[data-theme="dark"] .footer-content .icp a {
    color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .footer-content .icp a:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* 2.5 Admin Page Wrappers */
.admin-page {
    background: var(--bg-subtle);
    min-height: 100vh;
}

.admin-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background var(--duration-normal) var(--ease-smooth), border-color var(--duration-normal) var(--ease-smooth);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: all var(--duration-fast) var(--ease-smooth);
    text-decoration: none;
    cursor: pointer;
}

.nav-action-link:hover {
    color: var(--text);
    background: var(--bg-muted);
    border-color: var(--border);
}

.nav-action-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav-action-link.nav-action-primary {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}

.nav-action-link.nav-action-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--text-inverse);
}

.user-info {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    padding: 0 6px;
}

.admin-main {
    padding-top: calc(var(--nav-height) + 40px);
    padding-bottom: 60px;
}

/* ========================================
   3. Typography
   ======================================== */

/* 3.1 Headings */
h1, .h1 {
    font-size: clamp(1.875rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
}

h2, .h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text);
}

h3, .h3 {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

h4, .h4 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
}

/* 3.2 Body Text */
p {
    margin-bottom: 1em;
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-tertiary);
}
.text-success {
    color: var(--success);
    font-weight: 500;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.8125rem;
}

/* 3.3 Links */
.link-underline {
    position: relative;
    display: inline-block;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: width var(--duration-normal) var(--ease-smooth);
}

.link-underline:hover::after {
    width: 100%;
}

/* 3.4 Utility */
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }

/* ========================================
   4. Buttons & Forms
   ======================================== */

/* 4.1 Base Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    opacity: 0.88;
}

.btn:active {
    opacity: 0.75;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Loading button state */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid currentColor;
    border-color: var(--text-inverse) transparent var(--text-inverse) transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn.loading {
    color: var(--text-inverse);
}

/* Button Sizes */
.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

/* 4.2 Button Variants */
.btn-primary {
    background: var(--text);
    color: var(--text-inverse);
    border-color: var(--text);
}

.btn-primary:hover {
    opacity: 0.82;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--bg-muted);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    opacity: 1;
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover {
    opacity: 0.82;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--bg-subtle);
    color: var(--text);
    opacity: 1;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--text-tertiary);
    opacity: 1;
}

.btn-white {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

.btn-white:hover {
    background: var(--bg-subtle);
    opacity: 1;
    box-shadow: var(--shadow-sm);
}

.btn-outline-white {
    background: transparent;
    color: var(--text-inverse);
    border: 1.5px solid rgba(255,255,255,0.5);
}

.btn-outline-white:hover {
    background: rgba(255,255,255,0.12);
    opacity: 1;
}

/* 4.3 Form Elements */
.form-group {
    margin-bottom: 24px;
}
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}
.date-range-inputs .form-input {
    width: auto;
    flex: 1;
}
.date-range-inputs span {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Tip and empty text */
.section-tip {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.empty-tip {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    text-align: center;
    padding: 24px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: all var(--duration-fast) var(--ease-smooth);
    background: var(--bg);
    color: var(--text);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-tertiary);
    opacity: 1;
}

/* Form focus ring */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
}

/* Form validation error message */
.form-error {
    display: none;
    font-size: 0.8125rem;
    color: var(--danger);
    margin-top: 6px;
    padding: 8px 12px;
    background: var(--danger-bg);
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent);
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error .form-select {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-bg);
}

.form-group.has-error .form-error {
    display: block;
}

/* Required indicator */
.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

/* Character counter */
.char-counter {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    text-align: right;
    margin-top: 4px;
}

.char-counter.warning {
    color: var(--danger);
}

.char-counter.near-limit {
    color: var(--danger);
    font-weight: 500;
}

/* Form messages container */
.form-messages {
    margin-bottom: 20px;
}

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

/* 4.4 Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
}

/* ========================================
   5. Homepage
   ======================================== */

/* 5.1 Hero Section */
.hero {
    position: relative;
    height: 82vh;
    min-height: 560px;
    max-height: 960px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.38);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-inverse);
    max-width: 720px;
    padding: 0 40px;
}

.hero-title {
    font-family: 'Playfair Display', 'PingFang SC', serif;
    font-size: clamp(8rem, 20vw, 15rem);
    font-weight: 1000;
    font-style: italic;
    letter-spacing: 0.01em;
    line-height: 1;
    color: rgba(255, 255, 255, 0.83);
    text-shadow:
        0 3px 20px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
    transform: translateX(-8%);
    text-indent: -8%;
}

.hero-subtitle {
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    font-weight: 300;
    letter-spacing: 0.35em;
    color: rgba(255, 255, 255, 0.72);
    text-shadow: 0 1px 16px rgba(0, 0, 0, 0.35);
    text-transform: uppercase;
}

/* 5.2 Blog Section */
.blog-section {
    padding: 96px 0;
    background: var(--bg-subtle);
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 56px;
}

.section-tabs {
    display: flex;
    gap: 4px;
    background: var(--border);
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* 5.4 Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

/* 5.5 Blog Card */
.blog-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow var(--duration-normal) var(--ease-smooth), transform var(--duration-normal) var(--ease-smooth);
    border: 1px solid var(--border);
    cursor: pointer;
}

/* Stagger delays */
.blog-card:nth-child(1) { animation-delay: 0ms; }
.blog-card:nth-child(2) { animation-delay: 60ms; }
.blog-card:nth-child(3) { animation-delay: 120ms; }
.blog-card:nth-child(4) { animation-delay: 180ms; }
.blog-card:nth-child(5) { animation-delay: 240ms; }
.blog-card:nth-child(6) { animation-delay: 300ms; }

.blog-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.card-link {
    display: block;
}

.card-image {
    position: relative;
    height: 230px;
    overflow: hidden;
    background: var(--bg-muted);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.blog-card:hover .card-image img {
    transform: scale(1.04);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 55%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-smooth);
}

.blog-card:hover .card-overlay {
    opacity: 1;
}

.view-btn {
    background: rgba(255,255,255,0.95);
    color: var(--text);
    padding: 9px 22px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transform: translateY(8px);
    transition: all var(--duration-normal) var(--ease-smooth);
    cursor: pointer;
}

.view-btn:hover {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.view-btn:active {
    transform: translateY(0) scale(0.97);
}

.blog-card:hover .view-btn {
    transform: translateY(0);
}

.card-content {
    padding: 24px 28px 28px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.card-meta .location,
.card-meta .date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.card-meta .location {
    color: var(--accent);
    font-weight: 500;
}

.card-meta .location svg,
.card-meta .date svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.card-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.card-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.card-stats .has-location {
    color: var(--accent);
}

.card-stats .has-location svg {
    width: 13px;
    height: 13px;
}

/* Post type badge */
.post-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.post-type svg {
    width: 13px;
    height: 13px;
}

/* 5.6 Empty State */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-tertiary);
    grid-column: 1 / -1;
}

.empty-state svg {
    margin-bottom: 24px;
    opacity: 0.3;
    color: var(--text-tertiary);
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

/* Empty state with action */
.empty-state-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-state-icon {
    font-size: 3.5rem;
    opacity: 0.4;
    line-height: 1;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 320px;
}

/* Loading skeleton state */
.skeleton {
    background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-subtle) 50%, var(--bg-muted) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 0.75em;
}

.skeleton-image {
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
}

/* Error state with retry */
.error-state {
    text-align: center;
    padding: 60px 20px;
}

.error-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.error-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.error-state-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--text-inverse);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    z-index: 9999;
    display: none;
}

.offline-indicator.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Network error retry */
.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.retry-btn:hover {
    opacity: 0.88;
}

/* ========================================
   6. Blog Detail Page
   ======================================== */

/* 6.1 Blog Header */
.blog-header {
    position: relative;
    min-height: 70vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding-bottom: 60px;
}

.blog-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.68) 0%, rgba(0,0,0,0.28) 50%, rgba(0,0,0,0.08) 100%);
    display: flex;
    align-items: flex-end;
    padding-bottom: 40px;
}

.blog-meta-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.blog-meta-header .location,
.blog-meta-header .date {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
}

.blog-meta-header .location {
    color: var(--accent);
}

.blog-header h1 {
    color: var(--text-inverse);
    font-size: clamp(2.25rem, 5vw, 4rem);
    margin-bottom: 16px;
    text-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

.blog-description {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.82);
    max-width: 680px;
    line-height: 1.7;
    margin: 0;
}

/* 6.2 Blog Content Section */
.blog-content-section {
    padding: 80px 0;
}

.blog-text {
    max-width: 760px;
    margin: 0 auto 60px;
}

.blog-text p {
    font-size: 1.0625rem;
    line-height: 1.9;
    color: var(--text-secondary);
    margin-bottom: 1.6em;
}

.gallery-section {
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.75rem;
}

.photo-group {
    margin-bottom: 60px;
}

.group-title {
    font-size: 1.35rem;
    margin-bottom: 6px;
    color: var(--text);
}

.group-description {
    color: var(--text-tertiary);
    margin-bottom: 24px;
    font-size: 0.9375rem;
}

/* 6.3 Masonry Grid */
.masonry-grid {
    columns: 3;
    column-gap: 18px;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-normal) var(--ease-smooth), transform var(--duration-normal) var(--ease-smooth);
}

.masonry-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.masonry-item img {
    width: 100%;
    display: block;
    transition: transform var(--duration-slow) var(--ease-out);
}

.masonry-item:hover img {
    transform: scale(1.03);
}

.item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 14px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
    color: rgba(255,255,255,0.92);
    font-size: 0.875rem;
    opacity: 0;
    transform: translateY(6px);
    transition: all var(--duration-normal) var(--ease-smooth);
}

.masonry-item:hover .item-caption {
    opacity: 1;
    transform: translateY(0);
}

/* 6.4 Blog Navigation Footer */
.blog-nav-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 48px 0 calc(60px + env(safe-area-inset-bottom, 0px));
}

.blog-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
    letter-spacing: 0.02em;
}

.blog-nav-link:hover {
    color: var(--text-secondary);
}

.blog-nav-link svg {
    opacity: 0.6;
    transition: opacity var(--duration-fast) var(--ease-smooth);
}

.blog-nav-link:hover svg {
    opacity: 1;
}

.blog-nav-divider {
    color: var(--text-tertiary);
    opacity: 0.4;
    font-size: 1rem;
}

/* 6.5 Photo Detail Modal - Clean Design */
.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);

    /* Force dark theme */
    --bg: #0c0e14;
    --bg-subtle: #161822;
    --bg-muted: #1e2130;
    --border: #252836;
    --border-strong: #353848;
    --text: #e4e6ee;
    --text-secondary: #8289a0;
    --text-tertiary: #505668;
    --accent: #8fa6b8;
}

.photo-modal.active {
    display: flex;
    opacity: 1;
}

/* Modal open animation */
.photo-modal.active .photo-modal-backdrop {
    animation: modalFadeIn 0.3s var(--ease-out) both;
}
.photo-modal.active .photo-modal-container {
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Backdrop */
.photo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Main container */
.photo-modal-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Close button - 磨砂玻璃风格 */
.photo-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.photo-modal-close:hover {
    background: var(--bg);
    border-color: var(--accent);
    color: var(--accent);
}

/* Navigation buttons - 底部边缘，弱化展示 */
.photo-modal-nav {
    position: absolute;
    bottom: 12px;
    top: auto;
    transform: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.photo-modal-nav:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.85);
}

.photo-modal-nav:active {
    transform: scale(0.92);
}

.photo-modal-prev { left: 12px; }
.photo-modal-next { right: 12px; }

/* Content layout */
.photo-modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* Image area */
.photo-modal-image-area {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.photo-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), filter 0.28s ease;
    will-change: opacity, transform, filter;
}

.photo-modal-info-panel {
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.photo-modal.photo-switch-out-next .photo-modal-image {
    animation: photoSwitchOutNext 0.18s ease both;
}

.photo-modal.photo-switch-out-prev .photo-modal-image {
    animation: photoSwitchOutPrev 0.18s ease both;
}

.photo-modal.photo-switch-in-next .photo-modal-image {
    animation: photoSwitchInNext 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.photo-modal.photo-switch-in-prev .photo-modal-image {
    animation: photoSwitchInPrev 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.photo-modal.photo-switch-out-next .photo-modal-info-panel,
.photo-modal.photo-switch-out-prev .photo-modal-info-panel {
    opacity: 0;
    transform: translateY(8px);
}

.photo-modal.photo-switch-in-next .photo-modal-info-panel,
.photo-modal.photo-switch-in-prev .photo-modal-info-panel {
    animation: photoInfoSwitchIn 0.28s ease both;
}

@keyframes photoSwitchOutNext {
    from { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
    to { opacity: 0; transform: translateX(-34px) scale(0.985); filter: blur(5px); }
}

@keyframes photoSwitchOutPrev {
    from { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
    to { opacity: 0; transform: translateX(34px) scale(0.985); filter: blur(5px); }
}

@keyframes photoSwitchInNext {
    from { opacity: 0; transform: translateX(42px) scale(0.985); filter: blur(5px); }
    to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes photoSwitchInPrev {
    from { opacity: 0; transform: translateX(-42px) scale(0.985); filter: blur(5px); }
    to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes photoInfoSwitchIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Info panel - 紧凑磨砂玻璃风格 */
.photo-modal-info-panel {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-top: 1px solid var(--border);
    padding: 14px 16px;
    overflow-y: auto;
    max-height: 32vh;
    color: var(--text);
}

/* Title section */
.info-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.info-photo-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    flex: 1;
}

.info-like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 16px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    flex-shrink: 0;
}

.info-like-btn:hover {
    background: var(--bg-muted);
    border-color: var(--accent);
    color: var(--accent);
}

/* 点赞按钮 - 已点赞状态 */
.info-like-btn.liked {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.info-like-btn.liked svg {
    fill: var(--danger);
    stroke: var(--danger);
    animation: heartBeat 0.3s var(--ease-smooth);
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 点赞动画效果 */
.info-like-btn.like-animating {
    animation: likeBounce 0.6s ease-out;
}

@keyframes likeBounce {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
        background: var(--danger-bg);
    }
    50% {
        transform: scale(0.95);
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 冷却状态 */
.info-like-btn.cooldown {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Metadata grid - 紧凑两列 */
.info-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--bg-subtle);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.meta-icon-wrapper {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.meta-icon-wrapper svg {
    width: 12px;
    height: 12px;
}

.meta-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.meta-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.meta-value {
    font-size: 0.8125rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Actions */
.info-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.action-btn:hover {
    background: var(--bg-muted);
    border-color: var(--accent);
    color: var(--accent);
}

/* Desktop responsive */
@media (min-width: 769px) {
    .photo-modal-container {
        align-items: center;
        justify-content: center;
        padding: 40px;
    }

    .photo-modal-content {
        max-width: 960px;
        max-height: 90vh;
        flex-direction: column;
        border-radius: 16px;
        overflow: hidden;
    }

    .photo-modal-image-area {
        flex: 1;
        min-height: 300px;
    }

    .photo-modal-info-panel {
        max-height: 38vh;
        border-top: 1px solid var(--border);
        border-left: none;
        padding: 14px 20px;
    }

    .info-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .info-actions {
        flex-direction: row;
        margin-top: auto;
        padding-top: 10px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .photo-modal-nav {
        width: 40px;
        height: 40px;
    }

    .photo-modal-prev { left: 12px; }
    .photo-modal-next { right: 12px; }

    .photo-modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .photo-modal-content {
        border-radius: 0;
    }

    .photo-modal-image-area {
        flex: 1;
        min-height: 45vh;
    }

    .photo-modal-info-panel {
        padding: 12px 14px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        max-height: 42vh;
    }

    .info-meta-grid {
        grid-template-columns: 1fr;
    }

    .info-meta-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .meta-row {
        padding: 8px 10px;
    }

    .meta-icon-wrapper {
        width: 24px;
        height: 24px;
    }

    .meta-label {
        font-size: var(--text-xs);
    }

    .meta-value {
        font-size: var(--text-sm);
    }

    .action-btn {
        padding: 10px 14px;
        font-size: var(--text-sm);
    }
}

/* ========================================
   8. Login Page
   ======================================== */

/* 8.1 Login Page Layout */
.login-page {
    min-height: 100vh;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: var(--bg);
    border-radius: var(--radius-xl);
    padding: 44px 36px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--border);
}

.login-logo {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.login-logo svg {
    width: 52px;
    height: 52px;
}

.login-box h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 28px;
    color: var(--text);
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.875rem;
}

.login-form .btn {
    margin-top: 6px;
}

.login-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    transition: color var(--duration-fast) var(--ease-smooth);
}

.login-footer a:hover {
    color: var(--text-secondary);
}

/* 8.2 Login Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
    }
    .login-logo svg {
        width: 48px !important;
        height: 48px !important;
    }
    .login-box h1 {
        font-size: 1.25rem !important;
    }
}

/* ======================================== */

/* 9. Admin Pages */

.admin-header {
    background: var(--bg-muted);
    padding: 24px 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}
.admin-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.admin-header p {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg);
    padding: 22px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
}
.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card .stat-icon svg {
    width: 22px;
    height: 22px;
}
.stat-card .stat-icon.muted { background: var(--bg-muted); color: var(--text-tertiary); }
.stat-card .stat-icon.accent { background: var(--accent-muted); color: var(--accent); }
.stat-card .stat-info { flex: 1; }
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Admin Table */
.admin-table-container {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    margin: 0 auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.admin-table th {
    background: var(--bg-subtle);
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.admin-table td:first-child { vertical-align: middle; }
.admin-table .table-thumb {
    width: 72px;
    height: 52px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-table .table-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.admin-table .placeholder-thumb {
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-table td:nth-child(2) { min-width: 180px; }
.admin-table .table-title-link {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}
.admin-table .table-title-link:hover {
    color: var(--accent);
}
.admin-table .table-description {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.admin-table .location-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-muted);
    border-radius: 12px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 2px 4px 2px 0;
    white-space: nowrap;
    border: 1px solid var(--border);
}
.admin-table .location-tag-more {
    background: var(--border);
    color: var(--text-tertiary);
}
.admin-table .date-range {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr {
    transition: background var(--duration-fast) var(--ease-smooth);
}
.admin-table tbody tr:hover { background: var(--bg-subtle); }
.admin-table .title-cell {
    font-weight: 500;
    color: var(--text);
}
.admin-table .meta-cell {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}
.table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    color: var(--text-tertiary);
    background: transparent;
    text-decoration: none;
}
.action-btn:hover {
    background: var(--bg-muted);
    color: var(--text);
}
.action-btn.edit-btn:hover { background: var(--accent-muted); color: var(--accent); }
.action-btn.delete-btn:hover { background: var(--danger-bg); color: var(--danger); }
.action-btn svg { width: 15px; height: 15px; }

@media (max-width: 900px) {
    .admin-table { min-width: 680px; }
}

/* Settings Page */
.settings-section {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.settings-section h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.background-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

/* Blog Editor - Form Sections */
.blog-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.blog-form .form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.blog-form .form-actions .btn {
    min-width: 120px;
    justify-content: center;
}

.form-section {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.form-section > h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.form-section .form-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.form-section .form-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.form-section .form-header p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}
.form-section > h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .form-row.cols-3 { grid-template-columns: 1fr; }
    .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
}

/* Travel Type Selector */
.travel-fields { transition: all var(--duration-normal) var(--ease-smooth); }
.travel-fields.hidden { display: none; }

/* Location Search */
.location-search-wrapper { position: relative; }
.location-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.location-input-wrapper input { padding-right: 40px; }

/* Ensure form-input inside location wrapper doesn't get extra padding */
.location-input-wrapper .form-input {
    padding-right: 40px;
}
.location-search-icon {
    position: absolute;
    right: 12px;
    color: var(--text-tertiary);
    pointer-events: none;
    display: flex;
    align-items: center;
}
.location-search-icon.loading { animation: spin 1s linear infinite; }
.location-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}
.location-results.active { display: block; }
.location-results .empty-msg {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}
.location-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--duration-fast) var(--ease-smooth);
    display: flex;
    align-items: center;
    gap: 12px;
}
.location-item:last-child { border-bottom: none; }
.location-item:hover { background: var(--bg-subtle); }
.location-item .result-icon { font-size: 1.2rem; flex-shrink: 0; }
.location-item .result-info { flex: 1; }
.location-item .name {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}
.location-item .address {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}
.location-item .location-type {
    font-size: var(--text-sm);
    color: var(--accent);
    background: var(--accent-muted);
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
    display: inline-block;
}
.location-item.empty {
    color: var(--text-tertiary);
    justify-content: center;
    padding: 20px;
}

/* Selected Location Tags */
.selected-locations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    padding: 12px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.selected-location-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--text);
    color: var(--text-inverse);
    border-radius: 20px;
    font-size: var(--text-sm);
}
.selected-location-tag button {
    background: none;
    border: none;
    color: var(--text-inverse);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    margin-left: 4px;
    opacity: 0.7;
    transition: opacity var(--duration-fast);
}
.selected-location-tag button:hover { opacity: 1; }

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    background: var(--bg-subtle);
}
.upload-area:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
}
.upload-area.drag-over {
    border-color: var(--accent);
    background: var(--accent-muted);
    transform: scale(1.01);
}
.upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.3;
}
.upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}
.upload-hint {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}
.upload-area input[type="file"] { display: none; }

/* Preview Cards (newly uploaded, shown before save) */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-top: 16px;
    overflow: visible;
}
@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
}
.preview-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: box-shadow var(--duration-fast) var(--ease-smooth);
    overflow: visible;
}
.preview-card:hover {
    box-shadow: var(--shadow);
}
.preview-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 75px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-muted);
    position: relative;
}
.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.preview-info .form-input-sm {
    font-size: var(--text-sm);
    padding: 5px 8px;
}
.photo-location-search-wrapper {
    position: relative;
}
.photo-location-search-wrapper .photo-location-search {
    width: 100%;
    font-size: var(--text-sm);
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-muted);
    color: var(--text);
    transition: border-color var(--duration-fast) var(--ease-smooth);
    box-sizing: border-box;
}
.photo-location-search-wrapper .photo-location-search:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg);
}
.photo-location-results {
    position: fixed;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
.photo-location-results.show {
    display: block;
}
.preview-exif {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.preview-exif span {
    font-size: var(--text-sm);
    padding: 2px 6px;
    background: var(--bg-muted);
    border-radius: 4px;
    color: var(--text-secondary);
}
.preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}
.preview-actions .checkbox-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.preview-actions .btn {
    font-size: var(--text-sm);
    padding: 3px 8px;
    margin-left: auto;
}

.existing-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
@media (max-width: 640px) {
    .existing-images {
        grid-template-columns: 1fr;
    }
}

/* Vertical image card: photo top, info below */
.existing-image-card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--duration-fast) var(--ease-smooth);
}
.existing-image-card:hover {
    box-shadow: var(--shadow);
}

/* Top: thumbnail */
.existing-image-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-muted);
}
.existing-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.existing-image-thumb .cover-badge,
.existing-image-thumb .slideshow-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
}
.existing-image-thumb .cover-badge {
    left: 8px;
    right: auto;
    background: var(--accent);
    color: var(--text-inverse);
}

/* Bottom: info panel */
.existing-image-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px;
}

.existing-image-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.existing-image-location {
    margin-top: 6px;
}

.existing-image-info .form-group {
    margin-bottom: 0;
}
.existing-image-info .form-group label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-bottom: 2px;
    display: block;
}
.existing-image-info .form-group .form-input-sm {
    width: 100%;
    padding: 5px 8px;
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-muted);
    color: var(--text);
    transition: border-color var(--duration-fast);
}
.existing-image-info .form-group .form-input-sm:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg);
}

.existing-image-info .photo-location-search-wrapper {
    position: relative;
}
.existing-image-info .photo-location-search {
    width: 100%;
    padding: 5px 8px;
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-muted);
    color: var(--text);
    transition: border-color var(--duration-fast);
    box-sizing: border-box;
}
.existing-image-info .photo-location-search:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg);
}
.existing-image-info .photo-location-results {
    position: fixed;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
.existing-image-info .photo-location-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: var(--accent-muted);
    border-radius: 4px;
    font-size: var(--text-sm);
    color: var(--accent-hover);
    margin-top: 4px;
}
.existing-image-info .photo-location-display button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger);
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

/* Action buttons row */
.existing-image-info .image-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.existing-image-info .image-card-actions .checkbox-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.existing-image-info .image-card-actions .btn {
    font-size: var(--text-sm);
    padding: 4px 10px;
}

/* Image Picker */
.image-picker-section {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}
.image-picker-section h4 {
    font-size: 0.875rem;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.image-picker-section h4 .count {
    font-weight: normal;
    color: var(--text-tertiary);
}
.image-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px;
}
.image-picker-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--duration-fast) var(--ease-smooth);
}
.image-picker-item:hover { transform: scale(1.05); }
.image-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-picker-item .blog-tag {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-inverse);
    font-size: var(--text-xs);
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Group Section */
.group-section {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    border: 2px dashed var(--border);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
}
.group-section.active {
    border-color: var(--accent);
    border-style: solid;
    background: color-mix(in srgb, var(--accent) 4%, var(--bg-subtle));
}
.group-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 12px;
}
.group-header-row input {
    padding: 7px 10px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
}
.group-header-row input:focus {
    outline: none;
    border-color: var(--accent);
}
.group-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 40px;
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.group-image-tag {
    background: var(--text);
    color: var(--text-inverse);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: var(--text-sm);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.group-image-tag img {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    vertical-align: middle;
}
.group-image-tag button {
    background: none;
    border: none;
    color: var(--text-inverse);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.7;
}
.group-image-tag button:hover { opacity: 1; }
.add-group-btn {
    width: 100%;
    padding: 16px;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    transition: all var(--duration-fast) var(--ease-smooth);
}
.add-group-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Available Images */
.available-images-section {
    margin-top: 20px;
}
.available-images-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}
.available-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
}
.available-image {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--duration-fast) var(--ease-smooth);
    background: var(--bg-muted);
}
.available-image:hover { border-color: var(--accent); transform: scale(1.05); }
.available-image img { width: 100%; height: 100%; object-fit: cover; }
.available-image.used { opacity: 0.3; pointer-events: none; filter: grayscale(0.5); }

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--text-inverse);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Image Picker Modal */
.image-picker-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.image-picker-modal.show { display: flex; }
.picker-content {
    background: var(--bg);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-muted);
}
.picker-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.picker-header .close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-muted);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--duration-fast);
}
.picker-header .close-btn:hover { background: var(--border); color: var(--text); }
.picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.picker-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--duration-fast) var(--ease-smooth);
}
.picker-item:hover { transform: scale(1.03); border-color: var(--accent); }
.picker-item img { width: 100%; height: 100%; object-fit: cover; }
.picker-item .picker-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: var(--text-inverse);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.picker-item.selected { border-color: var(--accent); }
.picker-item.selected .picker-check { display: flex; }
.picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--bg-muted);
    gap: 12px;
}
.picker-footer .selected-count {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}
.picker-footer .selected-count strong { color: var(--accent); }

/* Hidden Active Button */
.btn-hidden-active { color: var(--accent); }
.btn-hidden-active svg { stroke: var(--accent); }

/* Admin Responsive */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-header { padding: 20px 24px; }
    .admin-header h1 { font-size: 1.25rem; }
    .stat-card { padding: 16px; }
    .stat-card .stat-value { font-size: 1.5rem; }
    .form-section { padding: 20px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .admin-header { padding: 16px 20px; }
}

/* ========================================
   13. Footer & Basement Door
   ======================================== */

/* 13.1 Basement Door */
.basement-door {
    position: absolute;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    right: 18px;
    width: 32px;
    height: 42px;
    z-index: 999;
    text-decoration: none;
    perspective: 500px;
    opacity: 0.62;
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

.basement-door:hover,
.basement-door.active,
.basement-door.touch-active {
    opacity: 1;
    transform: translateY(-2px) scale(1.04);
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.24));
}

.door-frame {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(119, 84, 69, 0.94) 0%, rgba(69, 42, 38, 0.98) 100%);
    border-radius: 7px 7px 2px 2px;
    border: 1px solid rgba(45, 32, 30, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 7px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -12px 20px rgba(0, 0, 0, 0.26);
    /* Spotlight mask - center opaque, edge transparent */
    mask-image: radial-gradient(circle 180px at var(--x, -200px) var(--y, -200px), black 0%, black 15%, transparent 50%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle 80px at var(--x, -200px) var(--y, -200px), black 0%, black 15%, transparent 50%, transparent 100%);
}

/* Door visible when active */
.basement-door.active .door-frame {
    opacity: 1;
    animation: flicker 0.15s infinite alternate;
}

/* Touch activated - door fully visible */
.basement-door.touch-active .door-frame {
    opacity: 1;
    animation: none;
}

/* Flicker animation */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

/* Door open animation */
.basement-door.opening .door-frame {
    animation: doorOpen 0.6s ease-in forwards !important;
}

@keyframes doorOpen {
    0% {
        transform: rotateY(0deg);
        opacity: 1;
    }
    30% {
        transform: rotateY(-30deg);
        opacity: 1;
    }
    100% {
        transform: rotateY(-90deg) translateZ(20px);
        opacity: 0;
    }
}

.door-vents {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vent-line {
    width: 17px;
    height: 1px;
    background: rgba(10, 8, 8, 0.72);
    border-radius: 1px;
}

.door-handle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 8px;
    background: linear-gradient(90deg, #7d756d, #4c4741);
    border-radius: 2px;
    transition: background 0.3s, box-shadow 0.3s;
}

.basement-door.active .door-handle,
.basement-door.touch-active .door-handle {
    background: linear-gradient(90deg, #d4a853, #a07830);
    box-shadow: 0 0 8px rgba(212, 168, 83, 0.6);
}

/* Door light leak effect */
.door-lights {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
}

.door-light {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 200, 100, 0.9), transparent);
    border-radius: 1px;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
}

.basement-door.active .door-light,
.basement-door.touch-active .door-light {
    width: 17px;
    opacity: 1;
    animation: lightFlicker 0.8s infinite alternate;
}

/* Each light flickers at different times */
.basement-door .door-light:nth-child(1) { animation-delay: 0s; }
.basement-door .door-light:nth-child(2) { animation-delay: 0.05s; }
.basement-door .door-light:nth-child(3) { animation-delay: 0.1s; }
.basement-door .door-light:nth-child(4) { animation-delay: 0.05s; }

@keyframes lightFlicker {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Door border glow layer */
.door-border-light {
    position: absolute;
    inset: 0;
    border-radius: 7px 7px 2px 2px;
    border: 1px solid rgba(255, 200, 100, 0.6);
    pointer-events: none;
    animation: borderFlicker 1.8s infinite alternate;
}

@keyframes borderFlicker {
    0% { opacity: 0.5; }
    100% { opacity: 0.7; }
}

/* ========================================
   13. Gallery Page (~200行)
   ======================================== */

/* 13.1 Gallery Header */
.gallery-header {
    padding: 60px 0 40px;
    text-align: center;
    background: var(--bg-subtle);
}

.gallery-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 12px;
}

.gallery-stats {
    font-size: 1rem;
    color: var(--text-tertiary);
}

/* 13.2 Gallery Grid */
.gallery-container {
    padding: 40px 0 80px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Gallery item fade-in (IntersectionObserver triggered) */
.gallery-item {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s var(--ease-smooth), transform 0.4s var(--ease-smooth);
}
.gallery-item.visible {
    opacity: 1;
    transform: scale(1);
}

/* 13.3 Gallery Item */
.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.gallery-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}

.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition: transform var(--duration-slow) var(--ease-smooth);
}

.gallery-item:hover img {
    transform: scale(1.04);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-smooth);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-inverse);
    margin-bottom: 6px;
    line-height: 1.3;
}

.gallery-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--text-sm);
    color: rgba(255,255,255,0.8);
}

.gallery-item-info svg {
    width: 14px;
    height: 14px;
}

/* 13.4 Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.95);
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 40px 20px 20px;
    color: var(--text-inverse);
}

.lightbox-meta {
    display: flex;
    gap: 20px;
    font-size: 0.875rem;
    opacity: 0.8;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-inverse);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration-fast) var(--ease-smooth);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-inverse);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.gallery-empty {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-tertiary);
    grid-column: 1 / -1;
}

/* ========================================
   Mapbox 地图样式
   ======================================== */

.map-fullscreen {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
}

#map {
    width: 100%;
    height: 100%;
}

/* Mapbox 控件样式（低调处理） */
.mapboxgl-ctrl-logo {
    opacity: 0.5;
    filter: invert(1);
}

.mapboxgl-ctrl-attrib {
    opacity: 0.5;
    font-size: 10px;
}

.mapboxgl-ctrl-attrib a {
    color: rgba(255,255,255,0.6);
}

/* Marker 气泡样式已内联在 map.ejs 中（动态创建） */

/* 信息卡样式 - 已内联在 map.ejs 中 */



/* ========================================
   11. Calendar Page (~290行)
   ======================================== */

/* 11.1 Calendar Layout */
.calendar-wrapper {
    padding: 96px 20px 40px;
    max-width: 1320px;
    margin: 0 auto;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
}

.calendar-header button {
    background: var(--text);
    border: none;
    color: var(--text-inverse);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all var(--duration-fast) var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-header button:hover {
    opacity: 0.75;
}

.calendar-header button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.calendar-year-title,
.calendar-header h1 {
    font-size: 2rem;
    font-weight: 300;
    margin: 0;
    color: var(--text);
    letter-spacing: 4px;
}

.calendar-stats {
    font-size: 0.9375rem;
    color: var(--text-tertiary);
}

.calendar-stats strong {
    color: var(--accent);
    font-weight: 600;
}

.calendar-year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.calendar-month {
    animation: fadeInUp 0.5s var(--ease-smooth) both;
}
.calendar-month:nth-child(1), .calendar-month:nth-child(5), .calendar-month:nth-child(9) { animation-delay: 0ms; }
.calendar-month:nth-child(2), .calendar-month:nth-child(6), .calendar-month:nth-child(10) { animation-delay: 80ms; }
.calendar-month:nth-child(3), .calendar-month:nth-child(7), .calendar-month:nth-child(11) { animation-delay: 160ms; }
.calendar-month:nth-child(4), .calendar-month:nth-child(8), .calendar-month:nth-child(12) { animation-delay: 240ms; }

.calendar-month {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: box-shadow var(--duration-normal) var(--ease-smooth), transform var(--duration-normal) var(--ease-smooth);
}

.calendar-month:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.calendar-month-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 12px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-weekday {
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    padding: 4px 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-smooth);
    color: var(--text-secondary);
    background: transparent;
}

.calendar-day:hover {
    background: var(--bg-muted);
    transform: scale(1.1);
}

.calendar-day.other-month {
    color: var(--text-tertiary);
    opacity: 0.35;
}

.calendar-day.other-month:hover {
    background: transparent;
    transform: none;
}

.calendar-day.today {
    background: var(--text);
    color: var(--text-inverse);
    font-weight: 600;
}

.calendar-day.has-photos {
    background: var(--accent-muted);
    color: var(--accent);
    font-weight: 500;
}

.calendar-day.has-photos:hover {
    background: var(--accent);
    color: var(--text-inverse);
    transform: scale(1.15);
}

.calendar-day.has-photos.today {
    background: var(--text);
    color: var(--text-inverse);
}

/* 11.4 Calendar Preview */
.calendar-preview {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    z-index: 1000;
    min-width: 320px;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.calendar-preview.active {
    display: block;
}

.calendar-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.calendar-preview-overlay.active {
    display: block;
}

.calendar-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.calendar-preview-date {
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
}

.calendar-preview-close {
    background: var(--bg-muted);
    border: none;
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    transition: background var(--duration-fast) var(--ease-smooth);
}

.calendar-preview-close:hover {
    background: var(--border);
}

.calendar-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.calendar-preview-list::-webkit-scrollbar {
    width: 5px;
}

.calendar-preview-list::-webkit-scrollbar-track {
    background: var(--bg-muted);
    border-radius: 3px;
}

.calendar-preview-list::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

.calendar-preview-item {
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-smooth);
    background: var(--bg-muted);
}

.calendar-preview-item:hover {
    transform: scale(1.04);
}

.calendar-preview-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.calendar-preview-item-title {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    padding: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
}

/* 11.5 Responsive */
@media (max-width: 1200px) {
    .calendar-year-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .calendar-year-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .calendar-year-grid {
        grid-template-columns: 1fr;
    }
    .calendar-wrapper {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ========================================
   15. Basement & 403 Pages (~200行)
   ======================================== */

/* 15.0 Basement Page - Full Body Reset (unique page) */
.basement-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.basement-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 16% 0%, rgba(191, 137, 76, 0.18), transparent 34%),
        radial-gradient(circle at 86% 12%, rgba(77, 119, 133, 0.16), transparent 32%),
        linear-gradient(180deg, #161719 0%, #111315 48%, #0a0b0c 100%);
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #efe8dc;
}

.basement-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 80%);
}

/* 地下室页面内的大门样式，仅限地下室页面 */
.basement-page .basement-door {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 80px;
    cursor: pointer;
    z-index: 1000;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.basement-page .basement-door:hover {
    opacity: 1;
    transform: scale(1.1);
}

.basement-page .door-frame {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #4a4a4a, #2d2d2d);
    border-radius: 8px 8px 0 0;
    border: 3px solid #333;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 0 20px rgba(0,0,0,0.5),
        0 5px 15px rgba(0,0,0,0.5);
}

.basement-page .door-handle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 20px;
    background: linear-gradient(90deg, #c0c0c0, #808080);
    border-radius: 2px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.basement-page .door-vents {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.basement-page .vent-line {
    width: 30px;
    height: 3px;
    background: #1a1a1a;
    border-radius: 1px;
}

/* 15.1 Error/403 Page */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

.error-container {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 90%;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.error-container h1 {
    font-size: clamp(5rem, 15vw, 120px);
    font-weight: 700;
    color: var(--accent);
    margin: 0;
    line-height: 1;
    letter-spacing: -4px;
}

.error-container h2 {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text-inverse);
    margin: 16px 0 12px;
    letter-spacing: 2px;
}

.error-container p {
    color: rgba(237, 234, 227, 0.6);
    font-size: 1rem;
    margin: 0 0 8px;
    line-height: 1.6;
}

.error-tip {
    font-size: 0.875rem;
    color: rgba(237, 234, 227, 0.4);
    margin-bottom: 32px;
}

/* 403 page uses gradient buttons since no global styles */
.error-page .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
    text-decoration: none;
}

.error-page .btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
    opacity: 0.9;
}

.error-page .btn-primary:hover {
    opacity: 1;
}

/* 15.2 Basement Page */
.basement-container {
    min-height: 100vh;
    padding: 110px 24px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.basement-container::before {
    content: '';
    position: absolute;
    top: -180px;
    left: 50%;
    width: min(820px, 90vw);
    height: 460px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(255, 213, 138, 0.18), transparent 68%);
    pointer-events: none;
}

.basement-hero {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    margin-bottom: 34px;
    text-align: left;
}

.basement-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: rgba(255, 214, 150, 0.7);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.basement-kicker::before {
    content: '';
    width: 34px;
    height: 1px;
    background: currentColor;
    opacity: 0.8;
}

.basement-title {
    font-size: clamp(2.35rem, 7vw, 5rem);
    line-height: 0.95;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    color: #fff8e9;
    letter-spacing: 0;
    text-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.basement-title::before {
    content: '';
    display: inline-block;
    width: clamp(34px, 7vw, 58px);
    height: clamp(34px, 7vw, 58px);
    background:
        linear-gradient(135deg, rgba(255, 205, 120, 0.95), rgba(136, 76, 44, 0.9));
    border-radius: 12px;
    box-shadow: 0 0 34px rgba(255, 189, 92, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: rotate(-5deg);
    opacity: 0.92;
}

.basement-subtitle {
    max-width: 520px;
    color: rgba(239, 232, 220, 0.58);
    font-size: 1rem;
    line-height: 1.8;
}

/* Links Grid */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.link-card {
    min-height: 188px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 22px 22px 52px;
    text-decoration: none;
    color: #efe8dc;
    backdrop-filter: blur(18px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 22px 44px rgba(0, 0, 0, 0.22);
    transition: box-shadow var(--duration-normal) var(--ease-smooth), transform var(--duration-normal) var(--ease-smooth), border-color var(--duration-normal) var(--ease-smooth), background var(--duration-normal) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 213, 138, 0), rgba(255, 213, 138, 0.85), rgba(255, 213, 138, 0));
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-smooth);
}

.link-card::after {
    content: '';
    position: absolute;
    right: -36px;
    bottom: -36px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 213, 138, 0.08);
    transition: transform var(--duration-normal) var(--ease-smooth), opacity var(--duration-normal) var(--ease-smooth);
}

.link-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 213, 138, 0.35);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 26px 58px rgba(0, 0, 0, 0.32);
}

.link-card:hover::before {
    opacity: 1;
}

.link-card:hover::after {
    opacity: 0.9;
    transform: scale(1.16);
}

.link-card-icon {
    font-size: 2.15rem;
    margin-bottom: 18px;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
}

.link-card-title {
    font-size: 1.08rem;
    font-weight: 600;
    margin-bottom: 9px;
    color: #fff8e9;
    letter-spacing: 0;
}

.link-card-desc {
    font-size: 0.9rem;
    color: rgba(239, 232, 220, 0.66);
    line-height: 1.65;
}

.link-card-date {
    position: absolute;
    left: 22px;
    bottom: 18px;
    font-size: 0.76rem;
    color: rgba(255, 213, 138, 0.55);
    letter-spacing: 0.03em;
}

/* Empty State */
.empty-basement {
    width: min(520px, 100%);
    text-align: center;
    padding: 56px 28px;
    color: rgba(239, 232, 220, 0.58);
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
    position: relative;
    z-index: 1;
}

.empty-basement-icon {
    font-size: 3.5rem;
    margin-bottom: 18px;
    opacity: 0.44;
}

/* Back Button */
.back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: rgba(239, 232, 220, 0.72);
    text-decoration: none;
    font-size: 0.86rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
    transition: color var(--duration-fast) var(--ease-smooth), border-color var(--duration-fast) var(--ease-smooth), transform var(--duration-fast) var(--ease-smooth), background var(--duration-fast) var(--ease-smooth);
    z-index: 100;
}

.back-btn:hover {
    color: #fff8e9;
    border-color: rgba(255, 213, 138, 0.28);
    background: rgba(255, 255, 255, 0.09);
    transform: translateX(-2px);
}

/* Add Link Section */
.add-link-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    width: 100%;
    max-width: 900px;
    text-align: center;
}

.add-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: var(--bg);
    border: 1px dashed var(--border-strong);
    border-radius: 25px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--duration-normal) var(--ease-smooth);
    cursor: pointer;
}

.add-link-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-subtle);
}

/* Admin Actions */
.admin-actions {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.admin-btn {
    padding: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.admin-btn:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.admin-btn.delete:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* 15.3 Responsive */
@media (max-width: 640px) {
    .error-container {
        padding: 40px 24px;
    }
    .error-container h1 {
        font-size: 100px;
    }
    .error-container h2 {
        font-size: 1.5rem;
    }
    .error-icon {
        font-size: 48px;
    }
}

/* ========================================
   16. Responsive & Utilities (~150行)
   ======================================== */

/* 16.1 Global Responsive Grid */
@media (max-width: 1024px) {
    .container {
        padding: 0 24px;
    }
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 24px;
    }
    .masonry-grid {
        columns: 2;
    }
}

@media (max-width: 900px) {
    .container {
        padding: 0 20px;
    }
    .modal-info-panel {
        width: 300px;
    }
    .admin-navbar .nav-container,
    .nav-container {
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    .blog-section {
        padding: 60px 0;
    }
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .section-header {
        margin-bottom: 40px;
    }
    .card-content {
        padding: 20px 24px 24px;
    }
    .card-content h3 {
        font-size: 1.25rem;
    }
    .masonry-grid {
        columns: 1;
    }
    .blog-content-section {
        padding: 40px 0;
    }
    .gallery-section h2 {
        font-size: 1.5rem;
    }
    .admin-main {
        padding-top: calc(var(--nav-height) + 20px);
    }
    .form-row.cols-2,
    .form-row.cols-3,
    .form-row.cols-4 {
        grid-template-columns: 1fr;
    }
    .calendar-year-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 12px;
    }
    .nav-links {
        gap: 12px;
    }
    .nav-links a {
        font-size: var(--text-sm);
    }
    .hero {
        min-height: 60vh;
    }
    .hero-content h1,
    .hero-content .hero-title {
        font-family: 'Playfair Display', 'PingFang SC', serif;
        font-style: italic;
        font-size: clamp(4rem, 14vw, 8rem);
        letter-spacing: 0.02em;
        transform: translateX(-1.5%);
        text-indent: -1.5%;
    }
    .hero-subtitle {
        font-size: var(--text-sm);
        letter-spacing: 0.2em;
    }
    .blog-section {
        padding: 40px 0;
    }
    .section-tabs {
        flex-wrap: wrap;
    }
    .tab-btn {
        padding: 8px 16px;
        font-size: var(--text-sm);
    }
    .card-image {
        height: 200px;
    }
    .card-meta {
        gap: 10px;
    }
    .card-meta .location,
    .card-meta .date {
        font-size: var(--text-sm);
    }
    .card-stats {
        gap: 12px;
    }
    .card-stats span {
        font-size: var(--text-sm);
    }
    .blog-header {
        min-height: 50vh;
        padding-bottom: 40px;
    }
    .blog-meta-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .blog-text {
        margin-bottom: 40px;
    }
    .gallery-section h2 {
        margin-bottom: 24px;
    }
    .blog-nav-footer {
        padding: 40px 0 48px;
    }
    .modal-content {
        flex-direction: column;
    }
    .photo-meta-grid {
        gap: 12px;
    }
    .modal-actions {
        gap: 8px;
    }
    .login-box {
        padding: 32px 20px;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .calendar-year-grid {
        grid-template-columns: 1fr;
    }
    .calendar-month {
        padding: 16px;
    }
    .basement-title {
        font-size: 1.75rem;
    }
    .back-btn {
        top: 20px;
        left: 16px;
    }
    .admin-actions {
        top: 20px;
        right: 16px;
    }
}

/* 13.5 Gallery Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    .gallery-item img {
        height: 180px;
    }
    .gallery-item-overlay {
        opacity: 1;
    }
}

/* 16.2 Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ========================================
   18. Standalone Navigation (Map/Journals Pages)
   ======================================== */

.nav-logo-standalone {
    position: fixed;
    top: var(--space-2);
    left: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px;
    color: var(--text);
    text-decoration: none;
    z-index: 1030;
    transition: opacity var(--duration-fast) var(--ease-smooth);
}

@media (min-width: 768px) {
    .nav-logo-standalone {
        left: var(--space-8);
    }
}

.nav-logo-standalone:hover {
    opacity: 0.75;
}

.nav-logo-standalone {
    color: var(--text);
}

.nav-logo-standalone span {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.nav-pills-standalone {
    position: fixed;
    top: var(--space-2);
    right: var(--space-6);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 1030;
}

/* Mobile toggle button */
.nav-mobile-toggle {
    display: none;
    position: fixed;
    top: var(--space-2);
    right: var(--space-6);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-xl);
    cursor: pointer;
    z-index: 1031;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.nav-mobile-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text);
}

.nav-mobile-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .nav-mobile-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nav-mobile-toggle {
    background-color: rgba(30, 30, 30, 0.7);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .nav-mobile-toggle svg {
    color: rgba(255, 255, 255, 0.95);
}

/* Mobile: hide nav pills by default, show toggle */
@media (max-width: 767px) {
    .nav-mobile-toggle {
        display: flex;
    }

    .nav-pills-standalone {
        top: 52px;
        right: var(--space-6);
        width: 160px;
        flex-direction: column;
        gap: 2px;
        padding: 6px;
        border-radius: var(--radius-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px) scale(0.95);
        transform-origin: top right;
        transition: all var(--duration-normal) var(--ease-out);
        max-height: 70vh;
        overflow-y: auto;
    }

    .nav-pills-standalone.nav-expanded {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        z-index: 1032;
    }

    .nav-mobile-toggle.hidden {
        display: none;
    }

    .nav-pill {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
        border-radius: var(--radius-md);
        font-size: 0.875rem;
        opacity: 0;
        transform: translateX(10px);
        transition: all var(--duration-fast) var(--ease-out);
    }

    .nav-pills-standalone.nav-expanded .nav-pill {
        opacity: 1;
        transform: translateX(0);
    }

    /* Stagger animation for each item */
    .nav-pills-standalone.nav-expanded .nav-pill:nth-child(1) { transition-delay: 0.05s; }
    .nav-pills-standalone.nav-expanded .nav-pill:nth-child(2) { transition-delay: 0.08s; }
    .nav-pills-standalone.nav-expanded .nav-pill:nth-child(3) { transition-delay: 0.11s; }
    .nav-pills-standalone.nav-expanded .nav-pill:nth-child(4) { transition-delay: 0.14s; }
    .nav-pills-standalone.nav-expanded .nav-pill:nth-child(5) { transition-delay: 0.17s; }
}

@media (min-width: 768px) {
    .nav-pills-standalone {
        right: var(--space-8);
    }
}

[data-theme="dark"] .nav-pills-standalone {
    background: rgba(30, 30, 30, 0.7);
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-3) var(--space-4);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--duration-fast) var(--ease-smooth);
}

/* Ensure span is always visible on mobile */
.nav-pill span {
    display: inline;
}

.nav-pill {
    color: var(--text);
}

.nav-pill:hover {
    color: var(--text);
    background-color: rgba(0, 0, 0, 0.06);
}

.nav-pill.active {
    color: var(--text);
    background-color: rgba(0, 0, 0, 0.08);
}

/* 搜索按钮样式与其他导航药丸一致 */
.nav-pill#searchToggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
}

.nav-pill#searchToggle:hover {
    color: var(--text);
    background-color: rgba(0, 0, 0, 0.06);
}

.nav-pill svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ========================================
   Search Overlay
   ======================================== */

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: transform var(--duration-normal) var(--ease-out);
}

.search-overlay.active .search-container {
    transform: translateY(0) scale(1);
}

.search-input {
    width: 100%;
    padding: 20px 60px 20px 24px;
    font-size: 1.1rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text);
    outline: none;
}

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

.search-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-smooth);
}

.search-close:hover {
    background: var(--border);
    color: var(--text);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid var(--border);
}

.search-result-item {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background var(--duration-fast) var(--ease-smooth);
}

.search-result-item:hover {
    background: var(--bg-subtle);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.search-result-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.search-result-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-no-results {
    padding: 32px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

[data-theme="dark"] .search-container {
    background: var(--bg-subtle);
}

@media (max-width: 640px) {
    .search-overlay {
        padding-top: 10vh;
        align-items: flex-end;
    }

    .search-container {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 70vh;
        display: flex;
        flex-direction: column;
    }

    .search-results {
        flex: 1;
        overflow-y: auto;
    }

    .search-input {
        padding: 16px 60px 16px 20px;
        font-size: 1rem;
    }
}

/* ========================================
   Blog Magnet Section
   ======================================== */

.blog-magnets-section {
    padding: 40px 24px;
    max-width: 900px;
    margin: 0 auto;
}

.blog-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.blog-magnets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.blog-magnet-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-subtle);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.blog-magnet-card:hover {
    background: var(--bg-muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.blog-magnet-card img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.blog-magnet-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.blog-magnet-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.blog-magnet-location {
    font-size: 12px;
    color: var(--text-tertiary);
}

@media (max-width: 600px) {
    .blog-magnets-section {
        padding: 24px 16px;
    }
    .blog-magnet-card {
        padding: 12px;
    }
    .blog-magnet-card img {
        width: 80px;
        height: 80px;
    }
}
