:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.025em;
}

.brand-tagline {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

.hero-section {
    text-align: center;
    margin-bottom: 48px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.tool-section {
    margin-bottom: 48px;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 320px 1fr;
    gap: 24px;
    align-items: start;
}

.input-panel,
.output-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.input-textarea,
.output-textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.8;
    font-family: 'Times New Roman', Georgia, serif;
    resize: vertical;
    transition: border-color 0.2s;
}

.input-textarea:focus,
.output-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-textarea {
    background: #fff;
    color: var(--text-primary);
}

.output-textarea {
    background: #fafbfc;
    color: var(--text-primary);
}

.input-stats {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.control-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 100px;
}

.format-selector {
    margin-bottom: 24px;
}

.format-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.format-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.format-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.options-section {
    margin-bottom: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.options-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.option-group {
    margin-bottom: 16px;
}

.option-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.option-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.option-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
    border-color: var(--secondary-color);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.corrections-summary {
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #065f46;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.features-section {
    margin-top: 64px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: #fff;
}

.feature-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    text-decoration: underline;
}

.footer-divider {
    color: var(--border-color);
}

.footer-copyright {
    color: var(--text-secondary);
}

.highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 2px;
    padding: 0 2px;
}

.privacy-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 48px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.privacy-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 32px;
    text-align: center;
    letter-spacing: -0.025em;
}

.privacy-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.privacy-updated {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--border-color);
}

.privacy-section {
    margin-bottom: 32px;
}

.privacy-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.privacy-section p {
    margin-bottom: 12px;
}

.privacy-section ul {
    margin-left: 24px;
    margin-top: 8px;
}

.privacy-section li {
    margin-bottom: 8px;
}

.privacy-highlight {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}

.privacy-highlight p {
    margin: 0;
    font-weight: 500;
}

.privacy-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.privacy-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .privacy-container {
        padding: 24px;
        border-radius: 8px;
    }

    .privacy-title {
        font-size: 28px;
    }

    .privacy-section h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .privacy-container {
        padding: 16px;
    }

    .privacy-title {
        font-size: 24px;
    }
}

@media (max-width: 1200px) {
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .control-panel {
        position: static;
        order: -1;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .input-textarea,
    .output-textarea {
        min-height: 300px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .nav-brand {
        text-align: center;
    }

    .nav-content {
        flex-direction: column;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 26px;
    }

    .container {
        padding: 0 16px;
    }

    .input-panel,
    .output-panel,
    .control-panel {
        padding: 16px;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 15px;
    }
}
