/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 语言切换器样式 */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-current {
    color: #ffffff;
    font-weight: 600;
}

.lang-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.lang-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.lang-separator {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0.25rem;
}

/* 主内容区域 */
.main {
    padding: 2rem 0;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #0056b3;
    background-color: #f8f9ff;
}

.upload-area.dragover {
    border-color: #28a745;
    background-color: #f0fff4;
    transform: scale(1.02);
}

.upload-content {
    max-width: 400px;
    margin: 0 auto;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-area h3 {
    margin-bottom: 0.5rem;
    color: #007bff;
}

.upload-area p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    background: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

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

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 工具栏 */
.toolbar {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.separator {
    color: #dee2e6;
    margin: 0 0.5rem;
}

/* 内容区域 */
.content-area {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.images-container {
    flex: 1;
    min-width: 0;
}

/* 图片网格 */
.images-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 200px;
}

.image-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    transition: all 0.2s ease;
    cursor: pointer;
}

.image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.image-item.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.image-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* 图片项头部 */
.image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(5px);
}

.image-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.image-delete {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-delete:hover {
    background: #c82333;
}

/* 图片预览 */
.image-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* 图片信息 */
.image-info {
    padding: 0.75rem;
    background: white;
}

.image-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #007bff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-info p {
    font-size: 0.8rem;
    color: #666;
    margin: 0.125rem 0;
}

/* 侧边操作面板 */
.side-panel {
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.panel-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.panel-header h3 {
    margin-bottom: 0.25rem;
    color: #007bff;
}

.selected-count {
    font-size: 0.9rem;
    color: #666;
}

.panel-section {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

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

.panel-section h4 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1rem;
}

/* 格式转换控件 */
.format-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.format-controls label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.format-controls select {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

.quality-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quality-control input[type="range"] {
    width: 100%;
}

/* 水印控件 */
.watermark-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.watermark-type {
    display: flex;
    gap: 1rem;
}

.watermark-type label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.watermark-style {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 1rem;
}

.watermark-style label {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.watermark-style input[type="range"] {
    flex: 1;
}

.watermark-style input[type="color"] {
    /* width: 40px; */
    flex: 1;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.watermark-style span {
    min-width: 40px;
    font-size: 0.8rem;
    color: #666;
}

#watermarkText {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* 位置选择器 */
.position-grid label {
    margin-bottom: 0.5rem;
    display: block;
}

.position-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    width: 120px;
    margin: 0 auto;
}

.position-btn {
    width: 35px;
    height: 35px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.position-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.position-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}



/* 模态窗口 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #007bff;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 1rem;
    text-align: center;
}

#previewImage {
    max-width: 80vw;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.image-info {
    text-align: left;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.image-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.image-info strong {
    color: #007bff;
    min-width: 60px;
    display: inline-block;
}

/* 进度条 */
.progress-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.progress-overlay.show {
    display: flex;
}

.progress-modal {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.progress-modal h3 {
    margin-bottom: 1rem;
    color: #007bff;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.image-item {
    animation: slideIn 0.3s ease forwards;
}

/* 空状态 */
.images-grid:empty::after {
    content: "暂无图片，请上传图片";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 工具提示 */
[title] {
    position: relative;
}

/* 拖拽指示器 */
.drag-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,123,255,0.1);
    border: 2px dashed #007bff;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    color: #007bff;
    font-weight: bold;
    pointer-events: none;
}

.drag-indicator.show {
    display: flex;
}


@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 图片格式科普部分样式 */
.format-guide {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 5rem 0;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.format-guide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.format-guide .container {
    position: relative;
    z-index: 1;
}

.format-guide h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: -0.5px;
}

.guide-intro {
    text-align: center;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    line-height: 1.7;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.format-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.format-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.format-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.15),
        0 4px 16px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 1);
}

.format-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f3f4;
}

.format-header h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #2c3e50;
    letter-spacing: -0.3px;
}

.format-badge {
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.format-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.format-badge:hover::before {
    left: 100%;
}

.format-badge.jpeg {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.format-badge.png {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.format-badge.webp {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.format-badge.bmp {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.format-badge.gif {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #2d3436;
}

.format-description {
    font-size: 1.1rem;
    color: #495057;
    margin-bottom: 1.5rem;
    font-weight: 500;
    line-height: 1.6;
}

.format-features {
    list-style: none;
    margin-bottom: 2rem;
}

.format-features li {
    padding: 0.6rem 0;
    font-size: 0.95rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
    line-height: 1.5;
}

.format-features li:hover {
    color: #495057;
}

.format-features li:before {
    margin-right: 0.75rem;
    font-weight: bold;
    font-size: 1rem;
}

.format-use-case {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1.25rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    font-size: 0.95rem;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
}

.format-use-case::before {
    content: '💡';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.2rem;
    opacity: 0.7;
}

.format-use-case strong {
    color: #2c3e50;
    font-weight: 600;
}

/* 格式对比表 */
.format-comparison {
    margin-bottom: 4rem;
}

.format-comparison h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2.5rem;
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: -0.3px;
}

.comparison-table {
    overflow-x: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(233, 236, 239, 0.5);
}

.comparison-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    position: relative;
}

.comparison-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3), transparent);
}

.comparison-table tr {
    transition: all 0.2s ease;
}

.comparison-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

.comparison-table td:first-child {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1rem;
}

/* 选择建议 */
.format-tips h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2.5rem;
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: -0.3px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tip-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.tip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.tip-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 15px 50px rgba(0,0,0,0.15),
        0 4px 16px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 1);
}

.tip-card h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tip-card p {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

.tip-card strong {
    color: #667eea;
    font-weight: 700;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .format-guide {
        padding: 3rem 0;
    }

    .format-guide h2 {
        font-size: 2rem;
    }

    .format-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .format-card {
        padding: 1.5rem;
    }

    .format-header h3 {
        font-size: 1.4rem;
    }

    .comparison-table {
        font-size: 0.85rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 1rem 0.75rem;
    }

    .tips-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .tip-card {
        padding: 1.5rem;
    }

    .format-comparison h3,
    .format-tips h3 {
        font-size: 1.7rem;
    }
}

@media (max-width: 480px) {
    .format-guide {
        padding: 2rem 0;
    }

    .format-guide h2 {
        font-size: 1.7rem;
    }

    .guide-intro {
        font-size: 1rem;
        margin-bottom: 2.5rem;
    }

    .format-card {
        padding: 1.25rem;
    }

    .format-header h3 {
        font-size: 1.2rem;
    }

    .format-badge {
        padding: 0.3rem 0.8rem;
        font-size: 0.65rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .tip-card {
        padding: 1.25rem;
    }

    .tip-card h4 {
        font-size: 1.1rem;
    }

    .format-comparison h3,
    .format-tips h3 {
        font-size: 1.5rem;
    }
}

/* RTL (Right-to-Left) 布局支持 - 阿拉伯语 */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .header .container {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .language-switcher {
    flex-direction: row-reverse;
}

[dir="rtl"] .option-tabs {
    flex-direction: row-reverse;
}

[dir="rtl"] .format-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .type-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .transform-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .action-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .control-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .preview-item {
    text-align: right;
}

[dir="rtl"] .format-card {
    text-align: right;
}

[dir="rtl"] .recommendation-item {
    text-align: right;
}

[dir="rtl"] .formats-overview {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

[dir="rtl"] .recommendations-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* RTL 移动端适配 */
@media (max-width: 768px) {
    [dir="rtl"] .header .container {
        flex-direction: column;
        text-align: center;
    }

    [dir="rtl"] .header-info {
        justify-content: center;
        margin-top: 0.5rem;
    }

    [dir="rtl"] .language-switcher {
        justify-content: center;
    }
}
