:root {
    /* Neo-Brutalism Color Palette */
    --primary: #000000;
    --primary-dark: #333333;
    --accent-yellow: #FFEB3B;
    --accent-pink: #FF4081;
    --accent-blue: #00E5FF;
    --bg-color: #F0F0F0;
    --card-bg: #FFFFFF;
    --text-main: #000000;
    --text-secondary: #555555;
    --border-color: #000000;
    --success: #00E676;
    --warning: #FFC400;
    --error: #FF1744;
    --info: #2979FF;

    /* Layout & Spacing */
    --header-height: 60px;
    --action-bar-height: 80px;
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);

    /* Design Tokens */
    --border-width: 3px;
    --shadow-offset: 4px;
    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Legacy/Compatibility Variables */
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(#ccc 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
}

/* Helper Utilities */
.mobile-only {
    display: flex !important;
}

.desktop-only {
    display: none !important;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: flex !important;
    }
}

/* ========== 侧边菜单 ========== */
.side-menu {
    position: fixed;
    top: 0;
    left: -70%;
    bottom: 0;
    width: 70%;
    max-width: 280px;
    background: var(--card-bg);
    z-index: 200;
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
    border-right: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-offset) 0 0 0 rgba(0, 0, 0, 0.1);
}

.side-menu.active {
    transform: translateX(100%);
    box-shadow: 100vw 0 0 rgba(0, 0, 0, 0.5);
}

.menu-header {
    padding: 20px;
    padding-top: calc(20px + var(--safe-area-inset-top));
    border-bottom: var(--border-width) solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent-yellow);
}

.menu-header h2 {
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: var(--border-width) solid var(--border-color);
    background: white;
    border-radius: var(--radius-small);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 0 0 var(--border-color);
}

.close-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 0 var(--border-color);
}

.menu-nav {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-medium);
    text-decoration: none;
    color: var(--text-main);
    background: white;
    font-weight: 700;
    transition: var(--transition-fast);
    box-shadow: 4px 4px 0 0 var(--border-color);
}

.menu-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 0 var(--border-color);
    background: var(--accent-blue);
}

.menu-item:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 0 var(--border-color);
}

.item-icon {
    font-size: 24px;
}

.item-text {
    font-size: 18px;
}

.menu-footer {
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-area-inset-bottom));
    border-top: var(--border-width) solid var(--border-color);
    background: var(--bg-color);
}

.queue-status {
    display: flex;
    gap: 16px;
}

.status-item {
    flex: 1;
    text-align: center;
    background: white;
    padding: 10px;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-small);
    box-shadow: 2px 2px 0 0 var(--border-color);
}

.status-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-value {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-main);
}

/* ========== 历史记录面板 ========== */
.history-panel {
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    width: 100%;
    background: white;
    z-index: 200;
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.history-panel.active {
    transform: translateX(-100%);
}

.panel-management-links {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.management-link {
    flex: 1;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    text-align: center;
    font-size: 13px;
    transition: all 0.2s;
}

.management-link:hover {
    background: var(--accent-blue);
    color: var(--text-main);
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 0 var(--border-color);
}

.panel-header {
    padding: 20px;
    padding-top: calc(20px + var(--safe-area-inset-top));
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.history-list {
    padding: 16px;
}

.history-item {
    background: var(--gray-50);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.history-template {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
    flex: 1;
    text-align: center;
}

.history-images-container {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.history-original,
.history-result {
    flex: 1;
    position: relative;
}

.image-label {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 1;
}

.history-original img,
.history-result img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.history-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 120px;
    background: var(--gray-100);
    border-radius: 8px;
}

.history-progress .progress-bar {
    width: 80%;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.history-progress .progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s linear;
}

.history-progress .progress-text {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-600);
}

.set-example-btn {
    width: 100%;
    padding: 8px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.set-example-btn:active {
    opacity: 0.7;
}

/* ========== 分页控件 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-top: 1px solid var(--gray-200);
    position: sticky;
    bottom: 0;
}

.page-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn:not(:disabled):active {
    transform: scale(0.95);
}

.page-info {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.history-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.history-status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.history-status.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.history-status.processing {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.history-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.history-time {
    font-size: 12px;
    color: var(--gray-500);
}

.history-image {
    width: 100%;
    height: 200px;
    background: var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
}

.history-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== 模态框 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-medium);
    padding: 24px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 8px 8px 0 0 var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}

.modal-body {
    margin-bottom: 20px;
}

/* ========== 进度条 ========== */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    height: 12px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.1s linear;
    border-right: 2px solid var(--border-color);
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

/* ========== 加载动画 ========== */
.generating-animation {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.dot {
    width: 12px;
    height: 12px;
    background: var(--text-main);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
    border: 2px solid var(--border-color);
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========== 图片查看器 ========== */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 400;
    display: flex;
    flex-direction: column;
}

.viewer-header {
    padding: 16px;
    padding-top: calc(16px + var(--safe-area-inset-top));
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

.viewer-header .close-btn,
.download-btn {
    width: 40px;
    height: 40px;
    background: white;
    color: black;
    border: 2px solid black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 2px 0 0 black;
}

.viewer-header .close-btn:active,
.download-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 0 black;
}

.viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 4px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* ========== Toast提示 ========== */
.toast {
    position: fixed;
    top: calc(var(--header-height) + 20px + var(--safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text-main);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    z-index: 500;
    opacity: 0;
    transition: all 0.3s ease;
    border: 2px solid white;
    box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.2);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ========== 遮罩层 ========== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
    backdrop-filter: blur(2px);
}

.overlay.active {
    display: block;
}

/* ========== 动画 ========== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 分享功能 ========== */
.share-btn {
    background: var(--accent-blue);
    color: black;
    border: var(--border-width) solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 12px;
    transition: all 0.3s ease;
    font-weight: 700;
    box-shadow: 4px 4px 0 0 var(--border-color);
}

.share-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 0 var(--border-color);
}

.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.share-card {
    background: white;
    border-radius: 24px;
    width: 80vw;
    height: 80vh;
    max-width: 1200px;
    max-height: 800px;
    position: relative;
    box-shadow: 8px 8px 0 0 black;
    border: 4px solid black;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.share-card-content {
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.share-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: 2px solid black;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 1;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    box-shadow: 2px 2px 0 0 black;
}

.share-close-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 0 black;
}

.share-title {
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    color: black;
    margin-bottom: 20px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 var(--accent-yellow);
}

.share-comparison {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 10px;
}

.share-image-container {
    flex: 1;
    max-width: 45%;
    text-align: center;
}

.share-label {
    font-size: 18px;
    font-weight: 800;
    color: black;
    margin-bottom: 15px;
    background: var(--accent-yellow);
    display: inline-block;
    padding: 4px 8px;
    border: 2px solid black;
    transform: rotate(-2deg);
}

.share-image {
    width: 100%;
    height: auto;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 4px 4px 0 0 black;
    border: 2px solid black;
}

.share-footer {
    text-align: center;
    padding: 15px 20px;
    background: var(--bg-color);
    border-top: 3px solid black;
    margin: 0 -40px -40px;
}

.share-template {
    font-size: 16px;
    color: black;
    font-weight: 800;
    margin-bottom: 5px;
}

.share-time {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ========== 文本/HTML 输出样式 ========== */
.text-output-modal .modal-content,
.text-modal-content {
    max-width: 800px;
    width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.text-output-content {
    padding: 20px;
    background: var(--bg-color);
    border-radius: var(--radius-small);
    max-height: 60vh;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.6;
    font-size: 14px;
    color: var(--text-main);
    border: var(--border-width) solid var(--border-color);
    box-shadow: inset 4px 4px 0 0 rgba(0, 0, 0, 0.05);
}

.text-output-content h1,
.text-output-content h2,
.text-output-content h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 800;
    color: var(--text-main);
}

.text-output-content h1 {
    font-size: 1.5em;
    border-bottom: 2px solid var(--border-color);
}

.text-output-content h2 {
    font-size: 1.3em;
}

.text-output-content h3 {
    font-size: 1.1em;
}

.text-output-content p {
    margin-bottom: 1em;
}

.text-output-content code {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

.text-output-content pre {
    background: black;
    color: white;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    border: 2px solid var(--border-color);
}

.text-output-content a {
    color: var(--info);
    text-decoration: underline;
    font-weight: 700;
}

.text-output-content ul,
.text-output-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.text-output-content li {
    margin-bottom: 0.5em;
}

/* HTML 输出模态框 */
.html-output-modal .modal-content,
.html-modal-content {
    width: 95vw;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.html-output-frame {
    flex: 1;
    width: 100%;
    min-height: 300px;
    border: var(--border-width) solid var(--border-color);
    border-radius: 8px;
    background: white;
}

/* 模态框底部 */
.modal-footer {
    padding: 16px 24px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-color);
    border-radius: 0 0 16px 16px;
}

/* 复制按钮 */
.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-yellow);
    color: black;
    border: var(--border-width) solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: var(--transition-fast);
    box-shadow: 4px 4px 0 0 var(--border-color);
}

.copy-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 0 var(--border-color);
}

.copy-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 0 var(--border-color);
}

/* 输出类型徽章 */
.output-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.output-type-badge.image {
    background: var(--info);
    color: white;
}

.output-type-badge.text {
    background: var(--success);
    color: black;
}

.output-type-badge.html {
    background: var(--warning);
    color: black;
}

/* 历史记录文本预览 */
.history-text-preview {
    padding: 12px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.history-text-preview p {
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.view-text-btn,
.view-html-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.view-text-btn:hover,
.view-html-btn:hover {
    background: var(--primary-dark);
}

/* HTML 预览容器 */
.history-html-preview {
    padding: 12px;
    text-align: center;
}

/* Badge */
.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid black;
    padding: 0 4px;
}

/* Help Item */
.help-item {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-small);
    box-shadow: 2px 2px 0 0 var(--border-color);
}

.help-item h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
}

.help-item p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 历史记录项的输出类型指示 */
.history-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ========== 响应式调整 ========== */
@media (max-width: 480px) {

    .text-modal-content,
    .html-modal-content {
        margin: 8px;
        max-height: calc(100vh - 16px);
        width: calc(100vw - 16px);
    }

    .text-output-content {
        max-height: 50vh;
        font-size: 14px;
        padding: 16px;
    }

    .html-output-frame {
        min-height: 200px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    .copy-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .share-card {
        width: 90vw;
        height: 85vh;
        max-width: none;
        max-height: none;
    }

    .share-card-content {
        padding: 20px;
    }

    .share-title {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .share-comparison {
        flex-direction: column;
        gap: 10px;
    }

    .share-image-container {
        max-width: 100%;
    }

    .share-label {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .share-image {
        max-height: 25vh;
    }

    .share-footer {
        margin: 0 -20px -20px;
        padding: 12px 15px;
    }

    .share-template {
        font-size: 14px;
    }

    .share-time {
        font-size: 12px;
    }
}

/* ========== PC / Desktop Support ========== */
@media (min-width: 768px) {
    :root {
        --header-height: 72px;
    }

    body {
        background-size: 40px 40px;
    }

    .mobile-header {
        padding: 0 32px;
        background: rgba(255, 255, 255, 0.9);
        border-bottom: var(--border-width) solid var(--border-color);
    }

    .header-center {
        text-align: left;
    }

    .app-title {
        font-size: 24px;
    }

    .mobile-main {
        max-width: 1000px;
        margin: 0 auto;
        padding-top: calc(var(--header-height) + 32px);
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        align-items: start;
    }

    .content-section {
        margin: 0;
        height: 100%;
    }

    #modeSection {
        grid-column: 1 / -1;
    }

    #uploadSection {
        grid-column: 1 / -1;
    }

    .template-selector {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        align-items: start;
    }

    .template-preview {
        margin: 0;
        max-width: none;
        grid-column: 2;
        grid-row: 1 / span 3;
    }

    .template-dropdown,
    .template-description,
    .prompt-section {
        grid-column: 1;
    }

    .action-bar {
        position: static;
        background: transparent;
        border: none;
        padding: 24px 0;
        grid-column: 1 / -1;
        max-width: 400px;
        margin: 0 auto;
    }

    .generate-btn {
        height: 56px;
        font-size: 20px;
        box-shadow: 6px 6px 0 0 var(--border-color);
    }

    .generate-btn:not(:disabled):active {
        transform: translate(6px, 6px);
    }

    .side-menu {
        width: 300px;
        left: -300px;
        border-right: var(--border-width) solid var(--border-color);
        box-shadow: 4px 0 0 0 rgba(0, 0, 0, 0.1);
    }

    .side-menu.active {
        transform: translateX(300px);
    }

    .history-panel {
        width: 400px;
        right: -400px;
        left: auto;
        border-left: var(--border-width) solid var(--border-color);
        box-shadow: -4px 0 0 0 rgba(0, 0, 0, 0.1);
    }

    .history-panel.active {
        transform: translateX(-400px);
    }

    .modal-content {
        max-width: 600px;
        border: var(--border-width) solid var(--border-color);
        box-shadow: 8px 8px 0 0 var(--border-color);
        border-radius: var(--radius-large);
    }

    /* Desktop Nav Styles */
    .desktop-nav {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1;
        justify-content: center;
    }

    .nav-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        border: var(--border-width) solid var(--border-color);
        border-radius: var(--radius-small);
        background: white;
        color: var(--text-main);
        text-decoration: none;
        font-weight: 800;
        font-size: 14px;
        text-transform: uppercase;
        box-shadow: 3px 3px 0 0 var(--border-color);
        transition: var(--transition-fast);
        white-space: nowrap;
    }

    .nav-item .nav-icon {
        font-size: 18px;
    }

    .nav-item:hover {
        background: var(--accent-yellow);
        transform: translate(-1px, -1px);
        box-shadow: 4px 4px 0 0 var(--border-color);
    }

    .nav-item.active {
        background: var(--accent-pink);
        color: white;
        transform: translate(1px, 1px);
        box-shadow: 1px 1px 0 0 var(--border-color);
    }

    .desktop-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
    }

    .logo-icon {
        font-size: 24px;
        filter: drop-shadow(2px 2px 0 var(--border-color));
    }
}

/* Mobile Nav Adjustments */
@media (max-width: 767px) {
    .nav-text {
        display: none !important;
    }

    .nav-item {
        padding: 6px !important;
        min-width: 36px;
        justify-content: center;
        gap: 0;
    }

    .desktop-logo .app-title {
        display: none;
    }

    .mobile-header {
        padding: 0 10px !important;
    }
}

@media (min-width: 1200px) {
    .mobile-main {
        max-width: 1200px;
    }
}