/* CSS Variables - Dark Theme from demo2.html */
:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(148, 163, 184, 0.1);
    --primary-color: #06b6d4;
    --primary-glow: rgba(6, 182, 212, 0.5);
    --secondary-color: #6366f1;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --success-color: #10b981;
    --paper-bg: #fffdf5;
    --paper-line: #e2e8f0;
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.8);
    flex-shrink: 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    font-size: 0.8rem;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
    border: 1px solid var(--card-border);
    padding: 2px 8px;
    border-radius: 12px;
}

/* Main Layout */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    height: calc(100vh - 70px - 50px); /* 减去header和footer的高度 */
    overflow: hidden;
}

@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
        overflow-y: auto;
        height: auto;
    }
    body {
        height: auto;
        overflow: auto;
    }
}

/* Sidebar */
.sidebar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    
    /* 自定义滚动条样式 - 与预览区域一致 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(6, 182, 212, 0.3);
    border-radius: 4px;
}

.input-group {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.control-group {
    flex-shrink: 0;
}

.actions {
    flex-shrink: 0;
    margin-top: auto;
}

.section-title {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Input Tabs */
.input-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0.8rem;
}

.input-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.input-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
}

.input-tab.active {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Input Area */
textarea {
    width: 100%;
    min-height: 120px;
    max-height: 300px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.5;
    overflow-y: auto;
    overflow-x: hidden;
    
    /* 自定义滚动条样式 - 与预览区域一致 */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: transparent;
}

textarea::-webkit-scrollbar-thumb {
    background-color: rgba(6, 182, 212, 0.3);
    border-radius: 4px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.stats-bar strong {
    color: var(--primary-color);
}

/* Error Hints */
.error-hints {
    margin-bottom: 0.5rem;
    padding: 8px 12px;
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid rgba(239, 68, 68, 0.5);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #fca5a5;
}

.error-hints.has-errors {
    background-color: rgba(239, 68, 68, 0.15);
    border-left-color: rgba(239, 68, 68, 0.7);
}

.error-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 4px;
}

.error-item:last-child {
    margin-bottom: 0;
}

.error-icon {
    color: #fca5a5;
    font-weight: bold;
    flex-shrink: 0;
}

/* AI Upload Area */
.ai-upload-area {
    position: relative;
    min-height: 150px;
    border: 2px dashed var(--card-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.ai-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(6, 182, 212, 0.05);
}

.ai-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(6, 182, 212, 0.1);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
}

.upload-placeholder svg {
    margin-bottom: 1rem;
    color: var(--primary-color);
    opacity: 0.6;
}

.upload-placeholder p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.upload-hint {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    opacity: 0.7;
}

.image-preview {
    position: relative;
    width: 100%;
    max-height: 300px;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: block;
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.remove-image:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

/* API Key Config */
.api-key-config {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
}

.api-key-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.6rem;
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
}

.api-key-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.api-key-hint a {
    text-decoration: none;
}

.api-key-hint a:hover {
    text-decoration: underline;
}

/* Controls */
.control-row {
    margin-bottom: 0.8rem;
}

label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    font-size: 0.9rem;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.btn {
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0891b2);
    color: #fff;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

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

.btn-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Preview Container */
.preview-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.preview-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.4);
    z-index: 10;
    flex-shrink: 0;
}

.preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.2);
    
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.preview-body::-webkit-scrollbar {
    width: 8px;
}

.preview-body::-webkit-scrollbar-track {
    background: transparent;
}

.preview-body::-webkit-scrollbar-thumb {
    background-color: rgba(6, 182, 212, 0.3);
    border-radius: 4px;
}

/* Page Navigation */
.page-nav-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    min-width: 36px;
    height: 32px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

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

.page-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
}

/* Copybook Container */
.copybook-container {
    min-height: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-snap-type: y proximity;
    scroll-padding: 20px;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    opacity: 0.7;
    border: 2px dashed var(--card-border);
    border-radius: 8px;
    padding: 2rem;
    width: 100%;
    min-height: 400px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Copybook Styles */
.copybook-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 4mm auto;
    padding: 6mm;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    transform-origin: top center;
    scroll-snap-align: start;
    scroll-margin: 10px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4mm;
    color: #2c3e50;
    font-size: 12px;
}

.page-footer {
    text-align: center;
    margin-top: 4mm;
    padding-top: 2mm;
    border-top: 1px dashed #ddd;
    color: #7f8c8d;
    font-size: 11px;
}

.word-row {
    margin-bottom: 3mm;
    page-break-inside: avoid;
}

.cn-label {
    font-size: 11px;
    color: #2c3e50;
    margin-top: 1mm;
}

.grid-container {
    position: relative;
    margin-bottom: 1mm;
    flex: 1;
}

.grid-lines {
    position: relative;
    height: var(--grid-height, 40px);
}

.grid-lines::before,
.grid-lines::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
}

.grid-lines .line-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    border-top: 1px solid #3498db;
}

.grid-lines .line-cap {
    position: absolute;
    top: 33.33%;
    left: 0;
    right: 0;
    border-top: 1px dashed #85c1e9;
}

.grid-lines .line-base {
    position: absolute;
    top: 66.66%;
    left: 0;
    right: 0;
    border-top: 2px solid #3498db;
}

.grid-lines .line-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px dashed #85c1e9;
}

.letters-container {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 66.66%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 3mm;
}

.letter-group {
    display: flex;
    justify-content: flex-start;
    margin-right: 4mm;
}

.word-text {
    letter-spacing: 0;
    display: inline-block;
    line-height: 1;
    transform: translateY(0.18em);
}

.dark {
    color: #2c3e50;
    opacity: 1;
}

.light {
    color: #bdc3c7;
    opacity: 0.7;
}

/* Screen scaling for preview */
@media screen {
    .copybook-page {
        transform: scale(0.7);
        margin-bottom: calc(-90mm + 4mm);
    }

    .copybook-page:last-child {
        margin-bottom: -90mm;
    }
}

@media screen and (max-width: 1400px) {
    .copybook-page {
        transform: scale(0.6);
        margin-bottom: -120mm;
    }
}

@media screen and (max-width: 1200px) {
    .copybook-page {
        transform: scale(0.5);
        margin-bottom: -150mm;
    }
}

@media screen and (max-width: 900px) {
    .copybook-page {
        transform: scale(0.8);
        margin-bottom: -60mm;
    }
}

@media screen and (max-width: 600px) {
    .copybook-page {
        transform: scale(0.4);
        margin-bottom: -180mm;
    }
}

/* Print Styles */
@page {
    margin: 0;
    size: A4;
}

@media print {
    /* 隐藏所有不需要打印的元素 */
    header,
    .sidebar,
    .preview-header,
    .placeholder {
        display: none !important;
    }

    /* 确保容器可见，即使父元素被隐藏 */
    .preview-container,
    .preview-body {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        width: 100%;
        height: auto;
    }

    main {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100%;
        height: auto;
    }

    .copybook-container {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background-color: transparent !important;
        min-height: auto !important;
        overflow: visible !important;
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
    }

    .copybook-page {
        box-shadow: none !important;
        page-break-after: always;
        page-break-before: auto;
        page-break-inside: avoid;
        break-inside: avoid;
        margin: 0 auto !important;
        padding: 6mm !important;
        width: 210mm !important;
        max-width: 210mm !important;
        min-height: 297mm !important;
        height: auto !important;
        transform: none !important;
        box-sizing: border-box !important;
        position: relative !important;
        display: block !important;
        background-color: white !important;
    }

    .copybook-page:first-child {
        page-break-before: auto;
    }

    .copybook-page .word-row {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .copybook-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }

    .word-row {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* 确保所有字帖内容可见 */
    .copybook-page * {
        visibility: visible !important;
        color: #000 !important;
    }

    .page-header,
    .page-footer {
        color: #2c3e50 !important;
    }

    .cn-label {
        color: #2c3e50 !important;
    }

    .word-text.dark {
        color: #2c3e50 !important;
    }

    .word-text.light {
        color: #bdc3c7 !important;
    }

    /* 确保网格线可见 */
    .grid-lines .line-top,
    .grid-lines .line-base {
        border-color: #3498db !important;
    }

    .grid-lines .line-cap,
    .grid-lines .line-bottom {
        border-color: #85c1e9 !important;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(6, 182, 212, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
    }
}

.generating {
    animation: pulse 1.5s infinite;
}

/* 设置弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    backdrop-filter: blur(12px);
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 600;
}

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

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
}

.settings-section {
    margin-bottom: 1.5rem;
}

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

/* Toast通知样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 450px;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
}

.toast.success::before {
    background: var(--success-color);
}

.toast.warning::before {
    background: #f59e0b;
}

.toast.error::before {
    background: #ef4444;
}

.toast.info::before {
    background: var(--primary-color);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-message {
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    animation: toastProgress linear;
}

.toast.success .toast-progress {
    background: var(--success-color);
}

.toast.warning .toast-progress {
    background: #f59e0b;
}

.toast.error .toast-progress {
    background: #ef4444;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@media (max-width: 600px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
    
    @keyframes toastSlideIn {
        from {
            transform: translateY(-100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    @keyframes toastSlideOut {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100px);
            opacity: 0;
        }
    }
}
