/* Apple Style Suno Prompt Builder */

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

:root {
    --bg-primary: #F5F5F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #E5E5EA;
    --border-color: rgba(0, 0, 0, 0.1);
    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.6);
    --text-tertiary: rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-lg: 18px;
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --font-title-size: 36px;
    --font-body-size: 15px;
    --card-padding: 24px;
    --element-gap: 16px;
    --logo-size: 80px;
    --accent-color: #007AFF;
}

[data-theme="dark"] {
    --bg-primary: #1C1C1E;
    --bg-secondary: #000000;
    --bg-tertiary: #2C2C2E;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: var(--spacing-lg);
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.visual-editor-toggle {
    position: fixed;
    top: calc(var(--spacing-lg) + 54px);
    right: var(--spacing-lg);
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.visual-editor-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .theme-icon::before {
    content: "☀️";
}

/* Page Header */
.page-hero {
    max-width: 1800px;
    margin: 0 auto var(--spacing-xl);
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: var(--spacing-lg);
    align-items: stretch;
}

.page-header {
    padding: var(--card-padding, var(--spacing-xl)) var(--card-padding, var(--spacing-xl));
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--element-gap, var(--spacing-lg));
}

.header-content {
    text-align: center;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.page-title {
    font-size: var(--font-title-size, 36px);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    text-align: center;
}

.page-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    max-width: 100%;
}

/* Social Share Buttons */
.social-share-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

.social-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.social-share-btn:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.social-share-btn svg {
    width: 20px;
    height: 20px;
}

.social-share-btn.twitter {
    background: #000000;
    color: #FFFFFF;
    border-color: #000000;
}

.social-share-btn.twitter:hover {
    background: #333333;
    transform: translateY(-2px) scale(1.05);
}

.social-share-btn.facebook {
    background: #1877F2;
    color: #FFFFFF;
    border-color: #1877F2;
}

.social-share-btn.facebook:hover {
    background: #1565C0;
    transform: translateY(-2px) scale(1.05);
}

.social-share-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #FFFFFF;
    border: none;
}

.social-share-btn.instagram:hover {
    opacity: 0.9;
    transform: translateY(-2px) scale(1.05);
}

.social-share-btn.tiktok {
    background: #000000;
    color: #FFFFFF;
    border-color: #000000;
}

.social-share-btn.tiktok:hover {
    background: #333333;
    transform: translateY(-2px) scale(1.05);
}

.social-share-btn.reddit {
    background: #FF4500;
    color: #FFFFFF;
    border-color: #FF4500;
}

.social-share-btn.reddit:hover {
    background: #E63900;
    transform: translateY(-2px) scale(1.05);
}

.social-share-btn.linkedin {
    background: #0077B5;
    color: #FFFFFF;
    border-color: #0077B5;
}

.social-share-btn.linkedin:hover {
    background: #005885;
    transform: translateY(-2px) scale(1.05);
}

.social-share-btn.youtube {
    background: #FF0000;
    color: #FFFFFF;
    border-color: #FF0000;
}

.social-share-btn.youtube:hover {
    background: #CC0000;
    transform: translateY(-2px) scale(1.05);
}

.header-nav {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link:active {
    color: var(--text-primary);
}

.hero-info {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    height: 100%;
    justify-content: space-between;
}

.hero-text {
    font-size: 16px;
    color: var(--text-secondary);
}

.hero-points {
    margin: 0;
    padding-left: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.hero-points li + li {
    margin-top: var(--spacing-xs);
}

.hero-actions {
    margin-top: var(--spacing-md);
}

.hero-btn {
    max-width: fit-content;
}

.guide-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.guide-header h1 {
    margin: 0 0 var(--spacing-sm);
    font-size: 32px;
}

.guide-subtitle {
    color: var(--text-secondary);
    margin: 0;
}

.guide-back {
    margin: 0 0 var(--spacing-sm);
    font-size: 14px;
}

.guide-back a {
    color: var(--text-secondary);
    text-decoration: none;
}

.guide-back a:hover {
    text-decoration: underline;
}

.guide-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.guide-section h2 {
    margin: 0;
    font-size: 22px;
}

.guide-section p,
.guide-section ul,
.guide-section ol {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.guide-section ul,
.guide-section ol {
    padding-left: var(--spacing-lg);
}

.guide-footer {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

.container {
    display: grid;
    grid-template-columns: 350px 1.1fr 380px;
    gap: var(--spacing-lg);
    max-width: 1800px;
    margin: 0 auto;
    min-height: 600px;
    height: auto;
    padding-bottom: var(--spacing-xl);
    align-items: stretch;
}

.panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    height: 100%;
}

.panel-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin: 0;
}

/* Live Preview Toggle */
.live-preview-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    user-select: none;
}

.live-preview-toggle input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    border: 1px solid var(--border-color);
}

.live-preview-toggle input[type="checkbox"]:checked {
    background: var(--text-primary);
}

.live-preview-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-secondary);
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.live-preview-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Left Panel - Settings */
.left-panel {
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    position: sticky;
    top: 120px;
    align-self: start;
}

.settings-search-container {
    position: relative;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.settings-search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-right: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.settings-search-input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: calc(var(--spacing-md) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-sections {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    flex: 1;
}

.form-section {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: var(--spacing-xs) 0;
}

.section-header-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.section-drag-handle {
    font-size: 18px;
    color: var(--text-tertiary);
    cursor: grab;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: var(--radius);
    border: 1px dashed transparent;
    transition: all 0.2s ease;
}

.section-drag-handle:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.form-section.dragging {
    opacity: 0.65;
    border-style: dashed;
}

.section-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-action-btn:hover {
    opacity: 1;
    background: var(--bg-tertiary);
}

.section-action-btn.pin-btn {
    opacity: 0.5;
}

.form-section.pinned .section-action-btn.pin-btn {
    opacity: 1;
}

.form-section-header .toggle-icon {
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    margin-left: var(--spacing-xs);
}

.form-section-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.form-section-content {
    margin-top: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-section-content.collapsed {
    display: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select, input[type="text"] {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    font-family: inherit;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

select:hover, input[type="text"]:hover {
    border-color: var(--text-secondary);
}

.lyric-preset-group {
    display: grid;
    gap: var(--spacing-sm);
}

.lyric-preset-btn {
    justify-self: start;
}

.field-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0;
}

.lyric-summary-actions {
    margin-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.lyric-summary-btn {
    flex: none;
    min-width: 0;
    width: fit-content;
}

.lyric-preview-card {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.lyric-preview-header {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.lyric-preview-title h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.lyric-preview-output {
    background: var(--bg-primary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    font-family: 'SF Mono', 'SF Pro Display', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    min-height: 96px;
    white-space: pre-wrap;
}

.lyric-preview-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.lyric-preview-btn {
    flex: none;
    min-width: auto;
}

.text-input, .textarea-input {
    font-family: inherit;
    font-size: 15px;
}

.textarea-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    resize: vertical;
    min-height: 96px;
    transition: all 0.2s ease;
}

.textarea-input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.slider-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    text-align: right;
}

/* World Music Nested Structure */
.world-music-nested {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.world-music-nested select {
    margin-top: var(--spacing-xs);
}

/* Center Panel - Output */
.center-panel {
    display: flex;
    flex-direction: column;
    padding-bottom: var(--spacing-xl);
}

.progress-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    margin: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
}

.progress-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.progress-header p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-percentage {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0A84FF 0%, #30D158 100%);
    transition: width 0.3s ease;
}

.progress-fill.progress-low {
    background: linear-gradient(90deg, #FF3B30 0%, #FF9500 100%);
}

.progress-fill.progress-medium {
    background: linear-gradient(90deg, #FFB300 0%, #FFD60A 100%);
}

.progress-fill.progress-good {
    background: linear-gradient(90deg, #0A84FF 0%, #30D158 100%);
}

.progress-message {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.output-container {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    flex: 1;
    overflow: hidden;
}

.prompt-block {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
}

.prompt-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.prompt-block-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-block {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.preview-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-stats {
    font-size: 12px;
    color: var(--text-tertiary);
}

.preview-content {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    background: var(--bg-primary);
    max-height: 240px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "SF Mono", "Monaco", monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.preview-section {
    margin-bottom: var(--spacing-sm);
}

.preview-section:last-child {
    margin-bottom: 0;
}

.preview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    display: inline-block;
    margin-bottom: 4px;
}

.preview-text {
    background: rgba(0,0,0,0.04);
    padding: 6px 8px;
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
    white-space: pre-wrap;
}

[data-theme="dark"] .preview-text {
    background: rgba(255,255,255,0.04);
}

.preview-placeholder {
    margin: 0;
    color: var(--text-secondary);
}

.quick-presets-inline {
    margin-top: var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.preset-gallery-inline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1400px) {
    .preset-gallery-inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .preset-gallery-inline {
        grid-template-columns: 1fr;
    }
}

.btn-copy-inline {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.btn-copy-inline svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.btn-copy-inline:hover {
    background: var(--bg-primary);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.copy-icon {
    font-size: 14px;
}

.textarea-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.prompt-textarea {
    width: 100%;
    flex: 1;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Mono", "Monaco", monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    resize: none;
    transition: all 0.2s ease;
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.character-counter {
    position: absolute;
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.character-counter.warning {
    color: #FF9500;
}

.character-counter.error {
    color: #FF3B30;
}

.button-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-lg);
}

.button-dropdown > button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
}

.site-footer {
    margin-top: var(--spacing-xl);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
    height: 44px;
}

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

.btn-primary:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-tertiary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-tertiary:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.random-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dice-icon {
    font-size: 16px;
    line-height: 1;
}

/* Button Dropdown */
.button-dropdown {
    position: relative;
    flex: 0 0 auto;
    min-width: 120px;
}

.button-dropdown .btn {
    width: auto;
    min-width: 120px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    overflow: hidden;
}

.dropdown-menu.active {
    display: flex;
    flex-direction: column;
}

.dropdown-menu button {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
}

.dropdown-menu button:hover {
    background: var(--bg-primary);
}

/* Right Panel - Tips & History */
.right-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 6px 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
}

.panel-header {
    position: relative;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.tips-content {
    padding: var(--spacing-lg);
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.tips-list li {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-left: var(--spacing-lg);
    position: relative;
}

.tips-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-tertiary);
    font-size: 18px;
    line-height: 1.4;
}

/* Templates */
.templates-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.templates-intro {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.templates-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.template-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-item:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.template-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.template-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.template-item-category {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

.template-item-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: var(--spacing-xs);
}

.template-item-preview {
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
    margin-top: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Presets */
.presets-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    gap: var(--spacing-md);
}

.preset-gallery {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.preset-gallery-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--spacing-md);
}

.preset-gallery-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.preset-gallery-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.preset-gallery-search input {
    width: 260px;
    max-width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    font-family: inherit;
    font-size: 14px;
}

.preset-gallery-search input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.preset-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.preset-filter-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-filter-btn.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-secondary);
}

.preset-gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

@media (min-width: 1500px) {
    .preset-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.preset-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.preset-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.preset-card h4 {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
}

.preset-card-category {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preset-card-description {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.preset-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.preset-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.preset-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
}

.preset-card-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.preset-card button {
    align-self: flex-end;
    padding: 6px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.preset-card button:hover {
    background: var(--text-primary);
    color: var(--bg-secondary);
}

.preset-gallery-empty {
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.whats-new-modal-content {
    max-width: 720px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
}

.whats-new-body {
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.modal-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.changelog-entry {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.changelog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-new {
    background: rgba(0, 122, 255, 0.12);
    color: #007AFF;
}

.badge-pro {
    background: rgba(88, 86, 214, 0.12);
    color: #5856D6;
}

.badge-announcement {
    background: rgba(255, 149, 0, 0.15);
    color: #FF9500;
}

.changelog-entry h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

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

.changelog-entry ul {
    margin: 0;
    padding-left: var(--spacing-lg);
    color: var(--text-secondary);
}

.changelog-entry li + li {
    margin-top: 4px;
}

.presets-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-md);
}

.presets-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.preset-category-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    padding-left: var(--spacing-xs);
}

.preset-category-header:first-child {
    margin-top: 0;
}

.preset-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.preset-item:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
}

.preset-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.preset-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.preset-meta {
    font-size: 11px;
    color: var(--text-tertiary);
}

.preset-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.preset-action-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: auto;
}

.preset-action-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.preset-action-btn.load-btn:hover {
    background: var(--text-primary);
    color: var(--bg-secondary);
    border-color: var(--text-primary);
}

.preset-action-btn.delete-btn:hover {
    background: #FF3B30;
    color: #FFFFFF;
    border-color: #FF3B30;
}

.presets-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-tertiary);
}

.presets-empty p {
    margin: 0;
    font-size: 14px;
}

.presets-empty-sub {
    font-size: 12px;
    margin-top: var(--spacing-xs);
    color: var(--text-tertiary);
}

/* History */
.history-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

#filter-favorites-btn.active {
    background: var(--text-primary);
    color: var(--bg-secondary);
    border-color: var(--text-primary);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    min-width: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.history-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.history-item:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.history-item-date {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-item-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.history-item-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-item-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.history-item-btn.favorite {
    color: #FF9500;
}

.history-item-btn.favorite.active {
    color: #FF3B30;
}

.history-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-tertiary);
    flex: 1;
}

.history-empty p {
    font-size: 14px;
    margin-bottom: var(--spacing-xs);
}

.history-empty-sub {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Shortcuts */
.shortcuts-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.shortcuts-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-primary);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-xs);
}

.shortcut-item span {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shortcut-item span small {
    font-size: 11px;
    color: var(--text-tertiary);
}

kbd {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Mono", "Monaco", monospace;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 24px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .page-hero {
        grid-template-columns: 1fr;
    }

    .container {
        grid-template-columns: 1fr 1.1fr 0.9fr;
    }
}

@media (max-width: 968px) {
    .page-hero {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .page-header {
        margin-bottom: 0;
        padding: var(--spacing-lg) var(--spacing-md);
        align-items: center;
        text-align: center;
    }

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

    .hero-info {
        padding: var(--spacing-lg);
    }

    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        min-height: auto;
    }

    .panel {
        min-height: 400px;
        max-height: none;
    }

    .left-panel {
        order: 1;
    }

    .center-panel {
        order: 2;
    }

    .right-panel {
        order: 3;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    body {
        padding: var(--spacing-sm);
    }

    .page-hero {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }

    .page-header {
        padding: var(--spacing-md) var(--spacing-sm);
    }

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

    .header-content {
        margin-bottom: 0;
    }

    .page-subtitle {
        font-size: 14px;
    }

    .social-share-buttons {
        gap: var(--spacing-xs);
        margin-top: var(--spacing-sm);
    }

    .social-share-btn {
        width: 44px;
        height: 44px;
    }

    .social-share-btn svg {
        width: 18px;
        height: 18px;
    }

    .container {
        gap: var(--spacing-md);
        height: auto;
    }

    .panel {
        max-height: none;
    }

    .panel-header {
        padding: var(--spacing-md);
    }

    .panel-header h2 {
        font-size: 18px;
    }

    .output-container {
        padding: var(--spacing-md);
    }

    .tips-content,
    .hero-info {
        padding: var(--spacing-md);
    }

    .theme-toggle {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    background: var(--bg-primary);
}

/* Analysis Results */
.analysis-section {
    margin-bottom: var(--spacing-lg);
}

.analysis-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.analysis-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-primary);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-xs);
}

.analysis-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.analysis-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.analysis-stat-value.good {
    color: #34C759;
}

.analysis-stat-value.warning {
    color: #FF9500;
}

.analysis-stat-value.error {
    color: #FF3B30;
}

.analysis-suggestions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analysis-suggestions li {
    padding: var(--spacing-sm);
    background: var(--bg-primary);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-xs);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
}

.analysis-suggestions li::before {
    content: "💡";
    font-size: 16px;
}

.optimization-preview {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.optimization-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.optimization-preview-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "SF Mono", "Monaco", monospace;
}

.optimization-savings {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-left: var(--spacing-xs);
}

.optimization-savings.positive {
    background: #34C759;
    color: #FFFFFF;
}

/* Footer */
.site-footer {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
    text-align: center;
}

.footer-copyright {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.footer-disclaimer {
    font-size: 10px;
    line-height: 1.5;
    color: var(--text-tertiary);
    max-width: 700px;
}

.footer-disclaimer p {
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    font-size: 12px;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

.footer-links span {
    color: var(--text-tertiary);
}

@media (max-width: 768px) {
    .site-footer {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .footer-copyright {
        font-size: 10px;
    }
    
    .footer-disclaimer {
        font-size: 9px;
    }
}

/* ==================== FEEDBACK SYSTEM STYLES ==================== */

.feedback-modal {
    z-index: 2000;
}

.feedback-modal-content {
    max-width: 400px;
    width: 90%;
    padding: 0;
    animation: feedbackSlideIn 0.3s ease;
}

@keyframes feedbackSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.feedback-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
}

.feedback-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.feedback-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.feedback-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.feedback-body {
    padding: var(--spacing-lg);
}

.feedback-options {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.feedback-option {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.feedback-option:hover {
    transform: scale(1.1);
    border-color: var(--text-primary);
    background: var(--bg-tertiary);
}

.feedback-option.selected {
    border-color: var(--text-primary);
    background: var(--text-primary);
    color: var(--bg-secondary);
    transform: scale(1.15);
}

.feedback-comment {
    margin-top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.feedback-comment textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    resize: vertical;
    min-height: 80px;
}

.feedback-comment textarea:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    min-width: auto;
}

/* Subtle Feedback Button */
.subtle-feedback {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    animation: subtleFadeIn 0.5s ease;
}

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

.subtle-feedback-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.subtle-feedback-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
    background: var(--bg-tertiary);
}

/* Toast Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.feedback-toast {
    font-size: 14px;
    color: var(--text-primary);
}

.feedback-inline-card {
    margin: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.feedback-inline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
}

.feedback-inline-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.feedback-inline-dismiss {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    border-radius: var(--radius);
    padding: 2px 6px;
    transition: all 0.2s ease;
}

.feedback-inline-dismiss:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.feedback-inline-text {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.feedback-inline-card .feedback-options {
    justify-content: space-between;
}

.feedback-inline-card .feedback-option {
    flex: 1;
}

.feedback-inline-comment textarea {
    width: 100%;
}

@media (max-width: 640px) {
    .feedback-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .feedback-options {
        gap: var(--spacing-sm);
    }
    
    .feedback-option {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .subtle-feedback {
        bottom: 16px;
        right: 16px;
    }
    
    .subtle-feedback-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* ==================== SHARE SYSTEM STYLES ==================== */

.share-icon {
    margin-right: 4px;
}

.share-icon-small {
    margin-right: 6px;
    font-size: 16px;
}

.share-dropdown {
    min-width: 200px;
}

.share-option {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
    width: 100%;
}

.share-option:hover {
    background: var(--bg-primary);
}


.share-modal {
    z-index: 2000;
}

.share-modal-content {
    max-width: 500px;
    width: 90%;
    animation: feedbackSlideIn 0.3s ease;
}

.share-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.share-url-container {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.share-url-input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Mono", "Monaco", monospace;
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-url-input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.share-social-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.share-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-social-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.share-social-btn.twitter:hover {
    background: #1DA1F2;
    color: #FFFFFF;
    border-color: #1DA1F2;
}

.share-social-btn.facebook:hover {
    background: #1877F2;
    color: #FFFFFF;
    border-color: #1877F2;
}

.share-social-btn.reddit:hover {
    background: #FF4500;
    color: #FFFFFF;
    border-color: #FF4500;
}

.share-social-btn.linkedin:hover {
    background: #0077B5;
    color: #FFFFFF;
    border-color: #0077B5;
}

.share-social-btn span {
    font-size: 18px;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow-md);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 280px;
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-icon {
    font-size: 18px;
    font-weight: 600;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
    line-height: 1.4;
}

.toast-success {
    border-left: 3px solid #34C759;
}

.toast-success .toast-icon {
    background: #34C759;
    color: #FFFFFF;
}

.toast-error {
    border-left: 3px solid #FF3B30;
}

.toast-error .toast-icon {
    background: #FF3B30;
    color: #FFFFFF;
}

.toast-info {
    border-left: 3px solid #007AFF;
}

.toast-info .toast-icon {
    background: #007AFF;
    color: #FFFFFF;
}

.toast-warning {
    border-left: 3px solid #FF9500;
}

.toast-warning .toast-icon {
    background: #FF9500;
    color: #FFFFFF;
}

/* Notification Animation (legacy support) */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

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

.share-notification.success {
    border-left: 3px solid #34C759;
}

.share-notification.error {
    border-left: 3px solid #FF3B30;
}

.share-notification.info {
    border-left: 3px solid #007AFF;
}

@media (max-width: 640px) {
    .share-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .share-url-container {
        flex-direction: column;
    }
    
    .share-social-buttons {
        grid-template-columns: 1fr;
    }
    
    .share-social-btn {
        width: 100%;
    }
}

/* ==================== VISUAL EDITOR STYLES ==================== */

.visual-editor-modal {
    z-index: 3000;
}

.visual-editor-content {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.visual-editor-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.editor-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-md);
}

.editor-section:last-child {
    border-bottom: none;
}

.editor-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-md) 0;
}

.editor-controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.control-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group input[type="color"] {
    width: 100%;
    height: 48px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    background: transparent;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.control-group-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.control-group-row input[type="range"] {
    flex: 1;
}

@media (max-width: 640px) {
    .visual-editor-toggle {
        top: calc(var(--spacing-sm) + 54px);
        right: var(--spacing-sm);
    }
    
    .visual-editor-content {
        width: 95%;
    }
}

