/* ========================================
   背单词应用 - 样式文件
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

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;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

html {
    overflow: hidden;
}

::-webkit-scrollbar {
    display: none;
}

.header {
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
    color: white;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}

.last-word {
    padding: 8px 0;
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 50px;
    visibility: visible;
}

.last-word.hidden {
    opacity: 0;
}

.last-word-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.last-word-english {
    font-size: 18px;
    font-weight: 600;
}

.last-word-chinese {
    font-size: 15px;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.last-word-type {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
}

.settings-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    align-self: stretch;
}

.stats {
    display: flex;
    justify-content: space-around;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 12px;
    color: white;
    font-size: 14px;
    margin-top: 10px;
}

.container {
    width: 100%;
    max-width: 400px;
    height: 60vh;
    min-height: 400px;
    position: relative;
}

.card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 25px;
    padding-top: 35px;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.card-0 {
    transform: scale(1);
    z-index: 3;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-1 {
    transform: scale(0.96) translateY(20px);
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-2 {
    transform: scale(0.92) translateY(40px);
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card.swiping-up {
    transform: translateY(-150%) rotate(-5deg) scale(1) !important;
    z-index: 10 !important;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.card.swiping-down {
    transform: translateY(150%) rotate(5deg) scale(1) !important;
    z-index: 10 !important;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.word {
    font-size: 42px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    text-align: left;
    width: 100%;
}

.translation {
    font-size: 22px;
    color: #666;
    text-align: left;
    line-height: 1.5;
    width: 100%;
}

.translation-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.word-type-wrapper {
    flex-shrink: 0;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
}

.word-type {
    display: flex;
    align-items: center;
    background: #f0f0f0;
    color: #666;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    min-height: 26px;
}

.translation-text {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
}

.divider-line {
    width: 100%;
    height: 1px;
    background: #eee;
    margin-top: 15px;
    margin-bottom: 12px;
}

.phrases {
    width: 100%;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.phrases::-webkit-scrollbar {
    display: none;
}

.phrase-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.phrase-text {
    font-size: 16px;
    color: #333;
    font-style: italic;
}

.phrase-translation {
    font-size: 14px;
    color: #666;
    text-align: left;
}

.actions {
    position: fixed;
    bottom: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: transform 0.2s;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.action-btn:focus, .action-btn:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.down-btn {
    background: #f39c12;
}

.up-btn {
    background: #2ecc71;
}

.reset-btn {
    background: #e74c3c;
}

.action-btn:active {
    transform: scale(0.95);
}

.swipe-hint {
    position: fixed;
    bottom: 130px;
    color: white;
    font-size: 14px;
    opacity: 0.8;
    text-align: center;
}

.loading {
    color: white;
    font-size: 18px;
}

.empty-state {
    text-align: center;
    color: white;
}

.empty-state h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 30px;
    opacity: 0.9;
}

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

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 360px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.modal-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.modal-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}

.modal-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.modal-btn-primary {
    background: #667eea;
    color: white;
}