/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 主要转换区域 */
.converter-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: start;
}

/* 输入和输出区域 */
.input-section, .output-section {
    display: flex;
    flex-direction: column;
}

.input-header, .output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.input-header h2, .output-header h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: #444;
}

.char-count {
    font-size: 0.9rem;
    color: #666;
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
}

/* 文本输入框 */
#input-text {
    width: 100%;
    height: 300px;
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafafa;
}

#input-text:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

/* 输出区域 */
.output-content {
    min-height: 300px;
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    background: #f9f9f9;
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

#refresh-examples {
    transition: all 0.15s ease;
}

#refresh-examples:hover {
    background: #4CAF50;
    color: white;
}

#refresh-examples:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

/* 控制区域 */
.control-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

.swap-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-button:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* 模式选择器 */
.mode-selector {
    display: flex;
    background: #f0f0f0;
    border-radius: 25px;
    padding: 0.25rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-text {
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
}

.radio-option input[type="radio"]:checked + .radio-text {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 转换按钮 */
.convert-button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.convert-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.convert-button:active {
    transform: translateY(0);
}

/* 示例区域 */
.examples-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.examples-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.examples-section h3 {
    color: #444;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
}

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

.example-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    font-family: inherit;
    transform: translateY(0);
}

.example-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #4CAF50;
}

.toast.error {
    background: #f44336;
}

.toast.info {
    background: #2196F3;
}

/* 页脚 */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 968px) {
    .converter-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .control-section {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .container {
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .converter-section {
        padding: 1rem;
    }

    #input-text, .output-content {
        height: 200px;
        min-height: 200px;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }
} 