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

body {
    font-family: 'Noto Sans JP', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 700;
    margin-bottom: 8px;
    color: #34495e;
}

select, input[type="number"] {
    padding: 10px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

select:focus, input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-label {
    display: inline-block;
    margin-left: 5px;
}

.generate-btn {
    grid-column: span 2;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

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

.output-section {
    margin-bottom: 30px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

h2 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.output-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.word-count {
    color: #7f8c8d;
    font-size: 14px;
}

.copy-btn {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #2980b9;
}

.output {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.8;
}

.output:focus {
    outline: none;
    border-color: #3498db;
}

.placeholder {
    color: #adb5bd;
    font-style: italic;
}

.format-options {
    margin-bottom: 30px;
}

h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.format-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.format-btn {
    padding: 8px 16px;
    background: #ecf0f1;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.format-btn:hover {
    background: #3498db;
    color: white;
}

.format-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.history-section {
    margin-top: 30px;
}

.history {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover {
    background: #e9ecef;
}

.history-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.history-time {
    color: #7f8c8d;
    font-size: 12px;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: #7f8c8d;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .controls {
        grid-template-columns: 1fr;
    }
    
    .generate-btn {
        grid-column: span 1;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}