@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
    --primary-color: #0d6efd;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #343a40;
    --text-light: #6c757d;
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-color);
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}
.logo {
    font-size: 1.3em;
    font-weight: 700;
}
.logo i {
    margin-right: 8px;
    color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 40px 0;
}
.hero-section h1 {
    font-size: 2em;
    margin-bottom: 15px;
}
.hero-section p {
    font-size: 1em;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Converter Box */
.converter-box {
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 16px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Tabs */
.tabs {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-button {
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}
.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.tab-button i {
    margin-right: 6px;
}

.tab-content {
    display: none;
    padding: 16px 0;
}
.tab-content.active {
    display: block;
}
#svg-input {
    width: 100%;
    height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    font-family: monospace;
    font-size: 0.9em;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}
.drop-zone.dragover {
    background-color: #e9ecef;
}
.drop-zone-icon {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.drop-zone-text {
    font-size: 1.1em;
    font-weight: 500;
    margin: 0 0 5px;
}
.drop-zone-subtext {
    color: var(--text-light);
    margin: 0 0 16px;
    font-size: 0.9em;
}

/* Settings & Preview */
.settings-and-preview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 16px 0;
}
.settings-section h2, .preview-section h2 {
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 16px;
}
.setting {
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.setting label {
    font-weight: 500;
    min-width: 70px;
    font-size: 0.95em;
}
.setting input[type="range"] {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
}
.setting input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}
.setting input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}
.setting > span {
    margin-left: 8px;
    font-weight: 500;
    font-size: 0.9em;
    min-width: 30px;
    text-align: right;
}

.checkbox-label {
    font-weight: 400;
    cursor: pointer;
    font-size: 0.9em;
}

/* Custom Radio Buttons */
.format-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.format-options input[type="radio"] {
    display: none;
}
.format-options label {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    min-width: auto;
}
.format-options input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Preview Area */
.preview-area {
    min-height: 250px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    overflow: hidden;
    padding: 10px;
}
.preview-area img, .preview-area svg {
    max-width: 100%;
    max-height: 100%;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    cursor: pointer;
    transition: background-color 0.3s;
}
.btn-primary:hover {
    background-color: #0b5ed7;
}
.btn-primary-full {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    margin-top: 16px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.btn-primary-full:hover {
    background-color: #0b5ed7;
}

/* Features */
.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: center;
    padding: 30px 0;
}
.feature-icon {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 12px;
}
.feature-card h3 {
    font-size: 1.1em;
    margin-bottom: 8px;
}
.feature-card p {
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.9em;
}

/* Error Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}
.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.modal-content p {
    margin: 0 0 16px;
    font-size: 1em;
}

/* 媒体查询 - 平板和手机适配 */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.7em;
    }
    .hero-section p {
        font-size: 0.95em;
    }
    .converter-box {
        padding: 12px;
    }
    .tab-button {
        font-size: 0.9em;
        padding: 10px 12px;
    }
    #svg-input {
        height: 180px;
    }
    .drop-zone {
        padding: 20px 15px;
    }
    .drop-zone-icon {
        font-size: 2em;
    }
    .settings-section h2, .preview-section h2 {
        font-size: 1.1em;
    }
    .preview-area {
        min-height: 220px;
    }
    .btn-primary-full {
        padding: 10px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .page-container {
        padding: 0 12px;
    }
    .main-header {
        padding: 12px 0;
    }
    .logo {
        font-size: 1.2em;
    }
    .hero-section {
        padding: 30px 0;
    }
    .hero-section h1 {
        font-size: 1.5em;
        margin-bottom: 10px;
    }
    .converter-box {
        margin-bottom: 30px;
    }
    .settings-and-preview {
        gap: 16px;
    }
    .setting {
        margin-bottom: 12px;
    }
    .setting label {
        min-width: 60px;
        font-size: 0.9em;
    }
    .format-options {
        gap: 8px;
    }
    .format-options label {
        padding: 5px 10px;
        font-size: 0.85em;
    }
    .modal-content {
        padding: 20px 16px;
    }
    .features-section {
        gap: 16px;
        padding: 20px 0;
    }
}

/* 大屏幕适配 */
@media (min-width: 769px) {
    .settings-and-preview {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

/* 横向手机优化 */
@media (max-height: 480px) and (orientation: landscape) {
    .converter-box {
        margin-bottom: 20px;
    }
    .preview-area {
        min-height: 150px;
    }
    .features-section {
        padding: 20px 0;
    }
}

/* 禁用文本选择，提升用户体验 */
.drop-zone, .tab-button, .btn-primary, .btn-primary-full {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 焦点样式优化 */
button:focus, input:focus, textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 动画优化 */
.tab-button, .format-options label, .btn-primary, .btn-primary-full {
    transition: all 0.2s ease;
}

/* 确保图片在小屏幕上正确显示 */
img, svg {
    max-width: 100%;
    height: auto;
}

/* 页脚样式 - 优化居中显示 */
.main-footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    text-align: center;
}

.footer-content p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9em;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}

/* 响应式页脚 */
@media (max-width: 768px) {
    .main-footer {
        padding: 16px 0;
        margin-top: 30px;
    }
    
    .footer-content {
        padding: 0 12px;
    }
    
    .footer-content p {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .main-footer {
        padding: 12px 0;
        margin-top: 20px;
    }
    
    .footer-content {
        padding: 0 10px;
    }
    
    .footer-content p {
        font-size: 0.8em;
        line-height: 1.4;
    }
}