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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    color: white;
    margin-bottom: 40px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

h1 {
    font-size: 2.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    margin-bottom: 30px;
}

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

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

input, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s;
    font-family: inherit;
}

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

textarea {
    resize: vertical;
    min-height: 80px;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102,126,234,0.3);
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.vocab-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vocab-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.vocab-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
    border-left-color: #667eea;
}

.vocab-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.vocab-word {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.vocab-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 1.1em;
}

.icon-btn:hover {
    background: rgba(102,126,234,0.1);
}

.review-btn {
    color: #28a745;
}

.delete-btn {
    color: #dc3545;
}

.vocab-meaning {
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

.vocab-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #999;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.need-review {
    border-left-color: #ffc107;
    background: #fff9e6;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

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

.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    line-height: 1.6;
}

.login-container {
    max-width: 450px;
    margin: 0 auto;
    margin-top: 80px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-card {
    margin-bottom: 0;
}

/* ========================================
   新功能样式：多含义和例句支持
   ======================================== */

/* 表单标题 */
.form-title {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #333;
}

/* 含义容器 */
.meanings-container {
    margin-bottom: 20px;
}

/* 含义卡片 */
.meaning-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.meaning-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #d0d0d0;
}

.meaning-number {
    font-size: 1.1em;
    font-weight: 600;
    color: #667eea;
}

.meaning-card .input-group {
    margin-bottom: 15px;
}

/* 例句容器 */
.examples-container {
    margin-top: 15px;
    padding-left: 15px;
    border-left: 3px solid #e0e0e0;
}

.example-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    position: relative;
}

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

.example-number {
    font-size: 0.9em;
    font-weight: 500;
    color: #888;
}

.example-item input {
    margin-bottom: 8px;
}

.example-item input:last-child {
    margin-bottom: 0;
}

/* 按钮样式 */
.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 10px;
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
    width: auto;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220,53,69,0.3);
}

.btn-remove {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #ff5252;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 25px 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-footer .btn,
.modal-footer .btn-secondary {
    width: auto;
    margin: 0;
}

.examples-section {
    margin-top: 20px;
}

.examples-section > label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #555;
}

/* 词汇列表中的含义显示 */
.meanings-list {
    margin-top: 15px;
}

.meaning-item {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.meaning-item:last-child {
    border-bottom: none;
}

.meaning-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.meaning-text {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.meaning-actions {
    display: flex;
    gap: 8px;
}

.examples-list {
    margin-top: 8px;
    padding-left: 20px;
}

.example-display {
    padding: 8px 0;
    color: #666;
    line-height: 1.6;
}

.example-en {
    color: #333;
    margin-bottom: 4px;
}

.example-zh {
    color: #888;
    font-size: 0.95em;
    font-style: italic;
}

.example-display::before {
    content: "💬 ";
    margin-right: 5px;
}

/* 含义数量徽章 */
.meaning-count-badge {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 10px;
}

/* 展开/收起按钮 */
.btn-toggle {
    background: #f0f0f0;
    color: #667eea;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle:hover {
    background: #e0e0e0;
}

/* 词汇项展开状态 */
.vocab-item.expanded {
    background: #fff;
    border: 2px solid #667eea;
}

.vocab-item.expanded .vocab-meaning {
    display: none;
}

/* 分隔线 */
.meaning-divider {
    border: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
    margin: 20px 0;
}

/* 空状态提示 */
.no-examples {
    color: #999;
    font-style: italic;
    font-size: 0.9em;
    padding-left: 20px;
}

/* 词汇项底部操作栏 */
.vocab-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.vocab-footer button {
    flex: 1;
    min-width: 120px;
}

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

    .card {
        padding: 20px;
    }

    .vocab-header {
        flex-direction: column;
        gap: 10px;
    }

    .tabs {
        overflow-x: auto;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .meaning-card {
        padding: 15px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-actions {
        width: 100%;
    }

    .modal-footer .btn,
    .modal-footer .btn-secondary {
        width: 100%;
    }

    .vocab-footer button {
        min-width: 100px;
        font-size: 0.9em;
    }
}