/* components.css - 卡片样式、按钮、复选框、下拉菜单、弹窗等组件 */

.wordlist-select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    height: 44px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    color: #1e293b;
    min-width: 160px;
}

.wordlist-select-btn span {
    color: inherit;
}

.wordlist-arrow {
    font-size: 10px;
    color: #64748b;
}

.wordlist-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 320px;
    max-width: 90vw;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 999;
    margin-top: 4px;
    overflow: hidden;
}

.wordlist-dropdown.show {
    display: block;
}

.wordlist-item {
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.wordlist-item:hover {
    background: #f8fafc;
}

.wordlist-item.active {
    background: #f1f5f9;
}

.wordlist-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wordlist-item-name {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    line-height: 1.4;
}

.wordlist-item-desc {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.4;
}

.wordlist-item-status {
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}

.wordlist-item-status.purchased {
    color: #64748b;
}

.wordlist-item-status.locked {
    color: #f59e0b;
}

.wordlist-purchase-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 12px;
    background: #f59e0b;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.wordlist-purchase-btn:hover {
    background: #d97706;
}

.word-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    padding: 20px 24px 16px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    min-height: 220px;
    height: 220px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: transform 180ms var(--ease-out-quart), opacity 160ms linear, box-shadow 180ms var(--ease-out-quart);
}

.word-card > .level-tag,
.word-card > .mastery-label {
    flex-shrink: 0;
}

.word-card > .word-row {
    flex: 0 0 auto;
    margin-top: 16px;
}

.word-card > .mean-display {
    flex: 0 0 auto;
    height: 36px;
    margin-top: 4px;
}

.word-card > .extra-meanings-display {
    flex: 1;
    min-height: 0;
    margin-bottom: 4px;
}

.word-card > .btn-audio {
    flex-shrink: 0;
    margin-top: auto;
}

.word-card:hover {
    transform: translateY(-2px);
}

.word-card.fading {
    opacity: 0.16;
    transform: translate3d(0, -12px, 0) scale(0.975);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    pointer-events: none;
    will-change: transform, opacity;
    transition: transform 180ms var(--ease-out-expo), opacity 160ms linear, box-shadow 180ms var(--ease-out-expo) !important;
}

.word-card.hidden-slot {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.word-card.collapse {
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    overflow: hidden;
    border: none;
    box-shadow: none;
    transition: height 0.3s ease-out, margin 0.3s ease-out, padding 0.3s ease-out, opacity 0.3s ease-out !important;
}

.level-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 22px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--level-color);
}

.mastery-label {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px;
    margin: -10px;
    z-index: 5;
}

/* 自定义 checkbox 样式 - 支持动画 */
.mastery-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.mastery-checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mastery-checkbox-custom::after {
    content: '';
    background: transparent;
    transition: all 0.15s ease;
}

.mastery-label input:checked + .mastery-checkbox-custom {
    background: var(--success);
    border-color: var(--success);
}

.mastery-label input:checked + .mastery-checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 15px;
    font-weight: bold;
    line-height: 1;
    animation: checkmarkPop 0.3s var(--ease-out-quart);
}

.word-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    overflow: hidden;
}

.word-display {
    font-size: 2.65rem;
    font-weight: 700;
    color: #0f172a;
    padding-top: 5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: inline-block;
}

.pos-display {
    font-style: italic;
    color: #94a3b8;
    font-size: 1.5rem;
    font-family: serif;
}

.mean-display {
    color: #dc2626;
    font-size: 20px;
    font-weight: 600;
    height: 36px;
    display: flex;
    align-items: center;
}

.extra-meanings-display {
    color: #dc2626;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.extra-meaning-item {
    margin-right: 8px;
}

.btn-audio {
    background: #eff6ff;
    color: var(--primary);
    width: 100%;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    font-size: 22px;
    font-weight: 600;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    flex-shrink: 0;
    margin-top: auto;
}

.btn-main {
    background: #1e293b;
    color: white;
}

.btn-print {
    background: #75BB67;
    color: white;
}

/* 激活码界面样式 */
.activation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2d3748;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234a5568' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.activation-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.activation-card h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.activation-card p {
    color: #64748b;
    margin-bottom: 24px;
}

.license-input {
    width: 100%;
    padding: 14px;
    font-size: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 3px;
    font-family: monospace;
    text-transform: uppercase;
}

.license-input:focus {
    outline: none;
    border-color: #2563eb;
}

.btn-activate {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-activate:hover {
    background: #1d4ed8;
}

.activation-note {
    font-size: 14px;
    margin-top: 16px;
    color: #64748b;
}

.activation-note a {
    color: #2563eb;
    cursor: pointer;
}

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10002;
}

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

.confirm-card {
    background: white;
    border-radius: 16px;
    width: min(520px, 92vw);
    padding: 18px 18px 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    border: 1px solid rgba(15,23,42,0.08);
}

.confirm-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
}

.confirm-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #475569;
    margin: 0 0 14px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-btn {
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.confirm-btn.cancel {
    background: #f1f5f9;
    color: #0f172a;
}

.confirm-btn.confirm {
    background: #2563eb;
    color: white;
}

/* 同步指示器 */
.sync-indicator {
    font-size: inherit;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-left: 8px;
}

.sync-indicator.visible {
    opacity: 1;
}

.sync-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    animation: syncPulse 1.5s ease-in-out infinite;
}

.sync-indicator.synced .dot {
    background: #16a34a;
    animation: none;
}

.sync-indicator.synced {
    opacity: 1;
}

/* 作者信息样式 */
.author-info a {
    color: #64748b;
    text-decoration: none;
}

.author-info a:hover {
    text-decoration: underline;
}

/* 打印隐藏元素 */
.print-header {
    display: none;
}

.print-instruction {
    display: none;
}

.pdf-only {
    display: none;
}
