:root {
    --bg-color: #F2F2F7;
    --card-bg: #FFFFFF;
    --text-main: #1C1C1E;
    --text-secondary: #8E8E93;
    --border-color: #E5E5EA;
    --accent-color: #007AFF;
    --radius-lg: 16px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.history-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.history-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background-color: #F9F9F9;
}

.history-item.active {
    background-color: #E5F1FF;
}

.history-item.active .history-date {
    color: var(--accent-color);
    font-weight: 600;
}

.history-date {
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.history-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Main Content */
.content {
    flex: 1;
    padding: 32px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.title-container {
    display: flex;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    padding: 8px;
    margin-right: 12px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.btn {
    display: inline-block;
    padding: 10px 16px;
    background-color: var(--card-bg);
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.btn:hover {
    background-color: #F9F9F9;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.summary-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    padding: 20px;
    margin-bottom: 0;
}

.summary-title {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

.chart-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Works Grid */
.works-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

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

.work-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.work-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.work-title {
    font-size: 16px;
    font-weight: 600;
}

.work-type {
    font-size: 12px;
    padding: 4px 8px;
    background-color: var(--bg-color);
    color: var(--text-secondary);
    border-radius: 4px;
    font-weight: 500;
}

.work-stats {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
}

.work-images {
    padding: 16px 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.thumb-wrapper {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: zoom-in;
    display: block;
}

.fullscreen-landscape-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.fullscreen-landscape-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.lightbox-content.rotate-landscape {
    transform: rotate(90deg);
    max-width: 90vh;
    max-height: 90vw;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    .fullscreen-landscape-btn {
        display: flex;
    }
    .content-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }
    .content-header > .header-actions {
        align-self: flex-start;
        padding-left: 52px;
    }
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    .sidebar.active {
        left: 0;
    }
    .content {
        padding: 20px;
        width: 100%;
    }
}
