@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens (Figma Stone & Amber theme) ───────── */
:root {
    /* Backgrounds */
    --bg:          #FAF9F6;   /* Alabaster warm cream */
    --bg-subtle:   #F5F4F0;   /* Sandstone warm stone */
    --bg-section:  #EAE8E3;   /* Sandstone deep stone */
    --card-bg:     #FFFFFF;   /* Crisp white for pop card backdrops */

    /* Borders */
    --border:      #E7E5E4;   /* Stone-200 */
    --border-dark: #D6D3D1;   /* Stone-300 */

    /* Brand */
    --primary:       #B45309;   /* Amber-700 */
    --primary-hover: #92400E;   /* Amber-800 */
    --primary-light: #FEF3C7;   /* Amber-100 */

    /* Text */
    --text-main:   #1C1917;   /* Stone-900 */
    --text-sub:    #44403C;   /* Stone-700 */
    --text-muted:  #78716C;   /* Stone-500 */

    /* Functional */
    --success:      #15803D;   /* Green-700 */
    --danger:       #B91C1C;   /* Red-700 */
    --info:         #0369A1;   /* Sky-700 */
    --accent-blue:  #0369A1;

    /* Admin sidebar */
    --sidebar-bg:     #1C1917; /* Stone-900 */
    --sidebar-border: #292524; /* Stone-800 */
    --sidebar-text:   #A8A29E; /* Stone-400 */
    --sidebar-active: #B45309; /* Amber-700 */

    /* Radii */
    --radius-sm: 6px;
    --radius:    8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow:    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-subtle);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; }
img, video { max-width: 100%; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Typography ─────────────────────────────────────────────────── */
h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.1rem; font-weight: 600; }

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 28px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.2);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-dark);
    color: var(--text-main);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.btn-ghost {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }

/* ─── Navigation (public) ────────────────────────────────────────── */
nav {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    gap: 16px;
}
.logo {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    flex-shrink: 0;
}
.logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.logo-svg, .logo-img {
    height: 64px;
    width: auto;
    display: block;
}
.footer-logo-svg, .footer-logo-img {
    height: 68px;
}
.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-left: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: font-size 0.2s;
}
.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}
.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-sub);
}
.nav-links a:hover { color: var(--primary); }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
    display: none;
    position: fixed;
    top: 80px;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    z-index: 999;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-sub);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: none; margin-top: 8px; }
.mobile-nav a:hover { color: var(--primary); }

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background:
        linear-gradient(rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.4) 100%),
        url('../uploads/hero.png')
        no-repeat center center / cover;
    padding: 140px 0 150px;
    position: relative;
    overflow: hidden;
}
.hero-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}
.hero-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 70px;
}
.hero .container { text-align: center; }
.hero h1 {
    font-size: clamp(2.2rem, 7vw, 4.5rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero p {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: rgba(255,255,255,0.85);
    max-width: 560px;
    margin: 0 auto 40px;
}
.hero-btns {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Stats ──────────────────────────────────────────────────────── */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin: -70px auto 60px;
    position: relative;
    z-index: 10;
    overflow: hidden;
}
.stat-item {
    padding: 40px 24px;
    text-align: center;
    border-right: 1px solid var(--border);
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.stat-item:last-child { border-right: none; }
.stat-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.98);
}
.stat-item h3 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.stat-item p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 8px;
    font-weight: 500;
}

/* ─── Section Title ──────────────────────────────────────────────── */
.section-title {
    text-align: center;
    margin-bottom: 48px;
}
.section-title h2 {
    color: var(--text-main);
    margin-bottom: 12px;
}
.section-title p {
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    font-size: 0.95rem;
}
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 12px;
}

/* ─── Project Grid ───────────────────────────────────────────────── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 80px;
}
.project-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.project-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.project-card img {
    width: 100%;
    height: 230px;
    object-fit: cover;
}
.project-info { padding: 20px; }
.project-tag {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 600;
}
.project-tag.status-完工 { border-color: var(--success); color: var(--success); }
.project-tag.status-施工 { border-color: #f59e0b; color: #f59e0b; }
.project-tag.status-設計 { border-color: var(--info); color: var(--info); }
.project-info h3 { color: var(--text-main); font-size: 1rem; }

/* ─── Services ───────────────────────────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 80px;
}
.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.service-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}
.service-icon { font-size: 2.5rem; margin-bottom: 16px; }
.service-card h3 { margin-bottom: 10px; color: var(--text-main); }
.service-card p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.6; }

/* ─── Contact Cards ────────────────────────────────────────────────── */
.contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}
.contact-info-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.contact-info-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}
.contact-icon { font-size: 2rem; margin-bottom: 14px; }
.contact-info-card h3 { margin-bottom: 10px; color: var(--text-main); font-size: 1rem; }
.contact-info-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
@media (max-width: 640px) {
    .contact-cards { grid-template-columns: 1fr; }
}
@media (min-width: 641px) and (max-width: 900px) {
    .contact-cards { grid-template-columns: 1fr 1fr; }
}

/* ─── Footer ─────────────────────────────────────────────────────── */
footer {
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    padding: 64px 0 32px;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { color: var(--text-muted); line-height: 1.7; max-width: 100%; }
.footer-col h4 { color: var(--text-main); font-weight: 600; margin-bottom: 20px; font-size: 0.9rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col ul a { color: var(--text-muted); }
.footer-col ul a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    text-align: center;
    color: var(--text-muted);
}

/* ─── Progress Bar ───────────────────────────────────────────────── */
.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-section);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #F5A623);
    border-radius: 4px;
    transition: width 0.8s ease;
}

/* ─── Milestones ─────────────────────────────────────────────────── */
.milestones-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 52px 0 16px;
    overflow-x: auto;
}
.milestones-line {
    position: absolute;
    top: 64px;
    left: 5%; right: 5%;
    height: 2px;
    background: var(--border);
    z-index: 1;
}
.milestone-node {
    position: relative;
    z-index: 2;
    padding: 0 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
}
.node-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    margin-bottom: 10px;
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 2px var(--border);
    transition: all 0.3s;
}
.node-dot.completed {
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(200,148,10,0.2);
}
.node-dot.active {
    background: var(--info);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}
.node-label { font-size: 0.7rem; color: var(--text-muted); text-align: center; font-weight: 500; }

/* ─── Badges ─────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-green  { background: rgba(34,197,94,0.12);  color: #15803d; }
.badge-yellow { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-blue   { background: rgba(59,130,246,0.12); color: #1d4ed8; }

/* ─── Form elements ──────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-sub);
    font-size: 0.875rem;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200,148,10,0.1);
}
select.form-control { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; line-height: 1.6; }

/* ─── Admin Layout ───────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Mobile top bar — hidden on desktop, shown on small screens */
.admin-topbar {
    display: none;
    padding: 0 20px;
    height: 64px;
    background: #fff;
    border-bottom: 2px solid var(--border);
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: var(--shadow-sm);
}

/* Dark sidebar (keeps contrast) */
.admin-sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 0 8px 24px;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-logo {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 24px 14px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 12px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
    transition: all 0.15s;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.admin-nav-item.active { background: var(--sidebar-active); color: #fff; }
.admin-nav-item.danger { color: #F87171; }
.admin-nav-item.danger:hover { background: rgba(239,68,68,0.1); }

/* Light main area */
.admin-main {
    margin-left: 240px;
    padding: 40px 48px;
    flex: 1;
    min-height: 100vh;
    background: var(--bg-subtle);
    min-width: 0;
}

/* Admin table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-section);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-subtle); }

/* Mobile admin */
.admin-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    color: var(--text-main);
}

/* ─── Utility ────────────────────────────────────────────────── */
.divider { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.text-muted  { color: var(--text-muted); }
.text-primary { color: var(--primary); }

/* ─── Animations ────────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate {
    opacity: 0;
    animation: fadeUp 0.65s ease forwards;
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .nav-links, nav > .container > .btn { display: none; }
    .hamburger { display: flex; z-index: 1001; }

    /* Logo: scale down for tablet/mobile */
    .logo-svg, .logo-img { height: 48px; }
    .logo-text { font-size: 0.95rem; }

    .stats { grid-template-columns: 1fr; margin: -40px auto 40px; }
    .stat-item { border-right: none; border-bottom: 1px solid var(--border); padding: 28px 24px; }
    .stat-item:last-child { border-bottom: none; }

    .project-grid { grid-template-columns: 1fr 1fr; }
    .services-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-logo-svg, .footer-logo-img { height: 52px; }

    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; padding: 80px 20px 40px; }
    .admin-menu-btn { display: block; }
    .admin-topbar { display: flex !important; }
}

@media (max-width: 640px) {
    /* Nav */
    nav .container { height: 68px; }
    .logo-svg, .logo-img { height: 42px; }
    .logo-text { font-size: 0.85rem; }
    .mobile-nav { top: 68px; }
    .stats { margin: -30px auto 30px; }

    /* Hero */
    .hero { padding: 108px 0 60px; }
    .hero h1 { font-size: clamp(1.8rem, 9vw, 2.8rem); }
    .hero p { font-size: 0.95rem; padding: 0 8px; }
    .hero-btns { flex-direction: column; align-items: stretch; padding: 0 24px; }
    .hero-btns .btn { text-align: center; padding: 14px 20px; font-size: 1rem; }

    /* Stats */
    .stats { margin: 40px 0; }
    .stat-item { padding: 24px 16px; }

    /* Grids */
    .project-grid { grid-template-columns: 1fr; gap: 16px; }
    .services-grid { grid-template-columns: 1fr; gap: 14px; }
    .service-card { padding: 24px 20px; }

    /* Contact */
    #contact { padding: 60px 0; }
    .contact-cards { grid-template-columns: 1fr; gap: 14px; }
    .contact-info-card { padding: 24px 20px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-logo-svg, .footer-logo-img { height: 46px; }
    .footer-brand p { max-width: none; }
    footer { padding: 48px 0 24px; }

    /* Section titles */
    .section-title { margin-bottom: 32px; }
    section { padding-top: 64px; }

    /* Milestones */
    .milestones-container { gap: 0; }
    .node-label { font-size: 0.6rem; }

    /* Admin */
    .admin-main { padding: 70px 16px 40px; }
}

@media (max-width: 400px) {
    nav .container { height: 64px; }
    .logo-svg, .logo-img { height: 38px; }
    .logo-text { font-size: 0.72rem; white-space: nowrap; }
    .mobile-nav { top: 64px; }
    .hero { padding: 104px 0 48px; }
    .hero-btns { padding: 0 12px; }
    .container { padding: 0 16px; }
}


/* ─── Admin Responsive Layouts ───────────────────────────────────── */
.admin-form-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.admin-dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .admin-form-layout, 
    .admin-dashboard-layout {
        grid-template-columns: 1fr;
    }
}

.code-block {
    background: var(--bg-section);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--primary);
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
}

/* ─── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: #fff;
    width: 100%;
    max-width: 920px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoomIn 0.3s ease;
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #f5f5f4;
    border: none;
    font-size: 28px;
    font-weight: 300;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s, transform 0.2s;
}
.modal-close:hover {
    background: #e7e5e4;
    transform: rotate(90deg);
}
.modal-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    height: 100%;
    overflow-y: auto;
}
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
}
.modal-gallery {
    padding: 24px;
    background: #fafaf9;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (max-width: 768px) {
    .modal-gallery {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}
.main-image-container {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    overflow: hidden;
    background: #e7e5e4;
    border: 1px solid var(--border);
}
.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumbnail-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.thumbnail-item {
    width: 64px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    flex-shrink: 0;
}
.thumbnail-item.active {
    border-color: var(--primary);
}
.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.modal-info {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.modal-info h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.3;
}
.modal-meta {
    display: flex;
    gap: 12px;
    font-size: 0.825rem;
    color: var(--text-muted);
}
.modal-meta span {
    background: #f5f5f4;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}
#modal-description {
    font-size: 0.95rem;
    color: var(--text-sub);
    line-height: 1.8;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
    .hero-divider svg {
        height: 30px;
    }
}
