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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 32px 24px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 32px;
    font-size: 28px;
}

.btn {
    width: 100%;
    padding: 16px;
    border: 2px solid #000;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s;
    background: #fff;
    color: #000;
}

.btn:hover {
    background: #f0f0f0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #fff;
    color: #000;
}

.btn-secondary {
    background: #fff;
    color: #000;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #000;
    border-radius: 8px;
    font-size: 18px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #000;
}

.input-group input:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 24px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 8px;
}

.history-item-latest {
    border: 2px solid #000;
    background: #fff;
}

.history-item .word {
    font-weight: 600;
    color: #333;
}

.history-item .similarity {
    font-weight: 700;
    font-size: 18px;
}

.similarity-high {
    color: #10b981;
}

.similarity-medium {
    color: #f59e0b;
}

.similarity-low {
    color: #ef4444;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
}

.modal h2 {
    margin-bottom: 20px;
    color: #333;
}

.modal .hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.success-message {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 24px;
}

.success-message h2 {
    font-size: 32px;
    margin-bottom: 8px;
}

.back-btn {
    display: inline-block;
    text-align: center;
    padding: 12px 24px;
    background: #fff;
    color: #000;
    text-decoration: none;
    border: 2px solid #000;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 24px;
}

.back-btn:hover {
    background: #f0f0f0;
}
