/* 玉米语言加密系统 - 屎黄色主题样式 */

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

body {
    font-family: 'Microsoft YaHei', 'SimHei', 'Arial', sans-serif;
    background: linear-gradient(135deg, #f4e04d 0%, #d4af37 25%, #b8860b 50%, #daa520 75%, #f4e04d 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: #5d4e37;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 随机玉米图片容器 */
#corn-images-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-corn {
    position: absolute;
    width: 60px;
    height: 60px;
    opacity: 0.3;
    animation: float 8s ease-in-out infinite;
    transition: all 0.3s ease;
}

.floating-corn:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
    75% { transform: translateY(-30px) rotate(270deg); }
}

/* 主容器 */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: #8b4513;
}

.header h1 {
    font-size: 3.5rem;
    margin: 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    animation: titleGlow 4s ease-in-out infinite alternate;
    background: linear-gradient(45deg, #8b4513, #d2691e, #cd853f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.3rem;
    margin: 1.5rem 0;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out;
}

@keyframes titleGlow {
    from {
        text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
        transform: scale(1);
    }
    to {
        text-shadow: 3px 3px 12px rgba(139, 69, 19, 0.6);
        transform: scale(1.02);
    }
}

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

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(212, 175, 55, 0.3);
    transition: all 0.4s ease;
    animation: slideInUp 0.8s ease-out;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    border-color: rgba(212, 175, 55, 0.6);
}

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

.card h2 {
    color: #8b4513;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #d4af37, #b8860b);
    border-radius: 2px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: #8b4513;
    font-weight: bold;
    font-size: 1.1rem;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 1rem;
    border: 3px solid #d4af37;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #b8860b;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3);
    background: rgba(255, 255, 255, 1);
    transform: scale(1.02);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

/* 密钥输入组 */
.key-input-group {
    display: flex;
    gap: 0.5rem;
}

.key-input-group .form-input {
    flex: 1;
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, #d4af37, #b8860b);
    color: white;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #b8860b, #9a7209);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.btn-secondary {
    background: #f4e04d;
    color: #8b4513;
    border: 2px solid #d4af37;
}

.btn-secondary:hover {
    background: #d4af37;
    color: white;
    transform: translateY(-3px);
}

.btn-small {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    min-width: auto;
    flex: none;
}

/* 输出区域 */
.output-content {
    background: rgba(255, 255, 255, 0.98);
    border: 3px solid #d4af37;
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 120px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    line-height: 1.8;
    word-break: break-all;
    white-space: pre-wrap;
    transition: all 0.3s ease;
}

.output-content:hover {
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

/* 玉米文本样式 */
.corn-text {
    color: #d2691e;
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* 消息样式 */
#message-container {
    margin: 1rem 0;
}

.message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 0.5rem 0;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.error-message {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border-left: 5px solid #c62828;
}

.success-message {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border-left: 5px solid #2e7d32;
}

.info-message {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border-left: 5px solid #1565c0;
}

/* 说明和示例区域 */
.instructions, .examples {
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    padding-left: 2rem;
}

.instructions li::before {
    content: '🌽';
    position: absolute;
    left: 0;
    top: 0.8rem;
}

.example-item {
    background: rgba(244, 224, 77, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    border-left: 5px solid #d4af37;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 2rem;
    color: #8b4513;
    opacity: 0.8;
    margin-top: 3rem;
}

/* 演示版特殊样式 */
.demo-info {
    background: rgba(244, 224, 77, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 5px solid #d4af37;
}

.demo-info p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #8b4513;
}

.demo-info ul {
    list-style: none;
    padding: 0;
}

.demo-info li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 2rem;
}

.demo-info li::before {
    position: absolute;
    left: 0;
    top: 0.5rem;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.feature-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item h3 {
    color: #8b4513;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-item p {
    color: #5d4e37;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .example-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 1rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        flex: none;
    }

    .key-input-group {
        flex-direction: column;
    }

    .header h1 {
        font-size: 2rem;
    }

    .feature-item {
        padding: 1rem;
    }
}
