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

/* 根变量定义 */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #e0e7ff;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --background-color: #f9fafb;
    --border-color: #d1d5db;
    --success-color: #10b981;
    --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);
    --border-radius: 0.5rem;
    --transition: all 0.2s ease-in-out;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 800px;
    background-color: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    position: relative;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--text-light);
    font-size: 1rem;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 输入区域样式 */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
}

/* 文本输入框样式 */
.text-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    line-height: 1.5;
    transition: var(--transition);
    resize: vertical;
    min-height: 100px;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.text-input::placeholder {
    color: var(--text-light);
}

/* 结果输入框特殊样式 */
.result-container {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.result-input {
    flex: 1;
    background-color: #f9fafb;
    cursor: default;
}

/* 复制按钮样式 */
.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    height: fit-content;
}

.copy-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.copy-btn:active {
    transform: translateY(0);
}

/* 结果提示样式 */
.result-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    text-align: right;
    font-style: italic;
}

/* 提示消息样式 */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background-color: var(--success-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.toast.hidden {
    display: none;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .result-container {
        flex-direction: column;
    }
    
    .copy-btn {
        align-self: flex-end;
        width: auto;
    }
    
    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .text-input {
        min-height: 80px;
    }
}