[v-cloak] { display: none; }

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

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2d3748;
    height: 100vh;
    overflow: hidden;
    background-color: #e2e8f0;
}

#app { display: flex; height: 100vh; }

/* Sidebar */
.sidebar {
    width: 320px;
    background-color: #fff;
    border-right: 1px solid #e2e8f0;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

.sidebar-collapsed .sidebar { width: 0; padding: 0; border: none; overflow: hidden; }

.sidebar-header { margin-bottom: 20px; }
.title { font-size: 20px; font-weight: 600; color: #2b6cb0; text-align: center; }

.section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf2f7;
}

.section h3 { font-size: 15px; margin-bottom: 12px; color: #4a5568; display: flex; justify-content: space-between; align-items: center;}
.data-status { font-size: 13px; color: #48bb78; font-weight: normal; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 4px; font-size: 13px; color: #4a5568; }
.form-group input[type="number"], .form-group select {
    width: 100%; padding: 8px 10px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 14px; outline: none;
    color: #4a5568; background-color: #fff;
}
.form-group input:focus, .form-group select:focus, textarea:focus { border-color: #4299e1; box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2); }

.theme-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px !important;
    cursor: pointer;
}

.toggle-group { display: flex; justify-content: space-between; align-items: center; }
.toggle-group label { margin-bottom: 0; }

.actions-group { display: flex; gap: 8px; margin-bottom: 12px; }
.actions-group .btn { flex: 1; padding: 8px; font-size: 13px; }

.text-import-area { margin-top: 12px; }
.text-import-area label { display: block; font-size: 12px; color: #718096; margin-bottom: 4px; }
.text-import-area textarea {
    width: 100%; padding: 8px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 13px; resize: vertical; margin-bottom: 8px; outline: none;
}
.text-import-area textarea::placeholder {
    color: #cbd5e0; /* 调整占位符颜色变淡 */
}

.btn {
    padding: 8px 16px; background-color: #edf2f7; border: 1px solid #cbd5e0; border-radius: 4px;
    font-size: 14px; cursor: pointer; transition: all 0.2s; color: #4a5568; text-align: center;
}
.btn:hover { background-color: #e2e8f0; }
.btn-sm { padding: 6px 12px; font-size: 12px; width: 100%; }
.btn-outline { background-color: transparent; color: #4299e1; border-color: #4299e1; }
.btn-outline:hover { background-color: #ebf8ff; }

/* 导入按钮专属样式 */
.import-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background-color: #4a5568; /* 深灰色背景 */
    border: none;
    border-radius: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn-action .icon {
    font-size: 16px;
}
.btn-action:hover {
    background-color: #2d3748; /* 悬浮时更深 */
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}
.btn-action:active {
    transform: translateY(0);
}

.btn-primary { background-color: #4299e1; color: white; border-color: #3182ce; }
.btn-primary:hover { background-color: #3182ce; }
.btn-primary:disabled { background-color: #a0aec0; border-color: #a0aec0; cursor: not-allowed; }
.btn-large { padding: 12px; font-size: 16px; font-weight: bold; width: 100%; border-radius: 6px;}
.btn-purple { background-color: #9f7aea; color: white; border-color: #805ad5; }
.btn-purple:hover { background-color: #805ad5; }

.actions { margin-top: auto; }
.sidebar-tip { font-size: 12px; color: #a0aec0; text-align: center; margin-top: 8px; }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #48bb78; }
input:focus + .slider { box-shadow: 0 0 1px #48bb78; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 20px; }
.slider.round:before { border-radius: 50%; }

/* Main Content */
.main-content {
    flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden;
    background-color: var(--bg-color, #e2e8f0);
    background-image: var(--bg-image, none);
    background-size: var(--bg-size, auto);
    transition: background 0.3s ease;
}

/* Components Theme overrides */
.main-content .btn-primary, .main-content .btn-purple {
    background-color: var(--primary-color, #9f7aea);
    border-color: var(--primary-hover, #805ad5);
    color: white;
}
.main-content .btn-primary:hover, .main-content .btn-purple:hover {
    background-color: var(--primary-hover, #805ad5);
}
.main-content .btn-outline {
    color: var(--primary-color, #9f7aea);
    border-color: var(--primary-color, #9f7aea);
}
.main-content .btn-outline:hover {
    background-color: var(--stat-bg, #faf5ff);
}
.main-content .modal-content h2 {
    color: var(--primary-color, #9f7aea);
}

/* Themes */
.theme-dot {
    --bg-color: #e2e8f0;
    --bg-image: radial-gradient(#cbd5e0 2px, transparent 2px);
    --bg-size: 30px 30px;
    --primary-color: #9f7aea;
    --primary-hover: #805ad5;
    --card-en-bg: #faf5ff;
    --card-en-text: #6b46c1;
    --card-zh-bg: #ffffff;
    --card-zh-text: #2d3748;
    --card-border-hover: #d6bcfa;
    --card-selected-bg: #f3e8ff;
    --stat-color: #805ad5;
    --stat-bg: #faf5ff;
    --stat-border: #e9d8fd;
}

.theme-grid {
    --bg-color: #e2e8f0;
    --bg-image: linear-gradient(#cbd5e0 1px, transparent 1px), linear-gradient(90deg, #cbd5e0 1px, transparent 1px);
    --bg-size: 30px 30px;
    --primary-color: #4299e1;
    --primary-hover: #3182ce;
    --card-en-bg: #ebf8ff;
    --card-en-text: #2b6cb0;
    --card-zh-bg: #ffffff;
    --card-zh-text: #2d3748;
    --card-border-hover: #bee3f8;
    --card-selected-bg: #e6fffa;
    --stat-color: #3182ce;
    --stat-bg: #ebf8ff;
    --stat-border: #bee3f8;
}

.theme-paper {
    --bg-color: #d8cdba;
    --bg-image: linear-gradient(transparent 95%, #bdae93 95%);
    --bg-size: 100% 30px;
    --primary-color: #dd6b20;
    --primary-hover: #c05621;
    --card-en-bg: #feebc8;
    --card-en-text: #9c4221;
    --card-zh-bg: #fffaf0;
    --card-zh-text: #4a5568;
    --card-border-hover: #fbd38d;
    --card-selected-bg: #fffff0;
    --stat-color: #dd6b20;
    --stat-bg: #feebc8;
    --stat-border: #fbd38d;
}

.theme-yuanshan {
    --bg-color: #8fb2c9;
    --bg-image: none;
    --bg-size: auto;
    --primary-color: #2b6cb0;
    --primary-hover: #2c5282;
    --card-en-bg: #e2e8f0;
    --card-en-text: #2a4365;
    --card-zh-bg: #f7fafc;
    --card-zh-text: #1a202c;
    --card-border-hover: #bee3f8;
    --card-selected-bg: #edf2f7;
    --stat-color: #2b6cb0;
    --stat-bg: #ebf8ff;
    --stat-border: #bee3f8;
}

.theme-zhuting {
    --bg-color: #a9be9f;
    --bg-image: none;
    --bg-size: auto;
    --primary-color: #38a169;
    --primary-hover: #2f855a;
    --card-en-bg: #f0fff4;
    --card-en-text: #22543d;
    --card-zh-bg: #ffffff;
    --card-zh-text: #2d3748;
    --card-border-hover: #c6f6d5;
    --card-selected-bg: #e6fffa;
    --stat-color: #38a169;
    --stat-bg: #f0fff4;
    --stat-border: #c6f6d5;
}

.theme-ouhe {
    --bg-color: #e4c6d0;
    --bg-image: none;
    --bg-size: auto;
    --primary-color: #d53f8c;
    --primary-hover: #b83280;
    --card-en-bg: #fff5f7;
    --card-en-text: #702459;
    --card-zh-bg: #ffffff;
    --card-zh-text: #2d3748;
    --card-border-hover: #fed7e2;
    --card-selected-bg: #fff1f2;
    --stat-color: #d53f8c;
    --stat-bg: #fff5f7;
    --stat-border: #fed7e2;
}

.toggle-sidebar-btn {
    position: absolute; top: 50%; left: 0; transform: translateY(-50%); z-index: 10;
    background-color: #fff; border: 1px solid #e2e8f0; border-left: none; box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    cursor: pointer; color: #4a5568; display: flex; align-items: center; justify-content: center;
    padding: 12px 4px; border-radius: 0 8px 8px 0; transition: all 0.2s;
}
.toggle-sidebar-btn:hover { background-color: #f7fafc; color: #2b6cb0; box-shadow: 4px 0 6px rgba(0,0,0,0.1); }

.game-container {
    flex: 1; padding: 30px 40px; display: flex; flex-direction: column; overflow-y: auto; align-items: center;
}

.pk-container {
    width: 95%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}
.pk-header {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    border: 3px solid #fff;
    backdrop-filter: blur(10px);
}
.pk-header-side { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 18px; }
.pk-header .stat-item { font-size: 18px; font-weight: 700; display: flex; gap: 8px; align-items: center; justify-content: center; text-align: center; }
.pk-header .stat-item .label { color: #718096; }
.pk-header .stat-item .value { color: #2d3748; background: #f7fafc; border: 2px solid #e2e8f0; border-radius: 10px; padding: 2px 10px; }
.pk-boards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
}
.pk-side {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    position: relative;
}
.pk-win {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #dc2626;
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 6px 18px rgba(220,38,38,0.35);
    pointer-events: none;
    z-index: 3;
}
.pk-win.finished {
    color: #ff5722;
    text-shadow: 0 6px 18px rgba(255,87,34,0.35);
}
.pk-title {
    font-size: 18px;
    font-weight: 800;
    color: #4a5568;
    margin-bottom: 10px;
    text-align: center;
}
.pk-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}
.pk-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.confetti-container {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}
.confetti { position: absolute; top: -30px; animation-name: confetti-fall; animation-timing-function: linear; animation-fill-mode: forwards; }
.confetti-inner {
    width: 10px;
    height: 14px;
    border-radius: 3px;
    opacity: 0.95;
    animation-name: confetti-sway, confetti-rotate;
    animation-timing-function: ease-in-out, linear;
    animation-iteration-count: infinite, infinite;
    animation-direction: alternate, normal;
}
@keyframes confetti-fall {
    0% { transform: translateY(-20px); }
    100% { transform: translateY(110%); }
}
@keyframes confetti-sway {
    0% { transform: translateX(-14px); }
    100% { transform: translateX(14px); }
}
@keyframes confetti-rotate {
    0% { rotate: 0deg; }
    100% { rotate: 360deg; }
}

.game-header {
    width: 95%; max-width: none; margin-bottom: 30px; background: rgba(255, 255, 255, 0.9); padding: 15px 40px;
    border-radius: 20px; box-shadow: 0 8px 16px rgba(0,0,0,0.06); display: flex; justify-content: center; align-items: center;
    border: 3px solid #fff;
    backdrop-filter: blur(10px);
}

.stats { display: flex; gap: 40px; }
.stat-item { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: #4a5568;}

.game-footer {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex; 
    justify-content: center;
    z-index: 50;
    pointer-events: none; /* 让容器不阻挡点击事件 */
}

.btn-restart {
    pointer-events: auto; /* 恢复按钮本身的点击事件 */
    padding: 12px 30px; /* 稍微减小一点内边距以适应两个按钮 */
    font-size: 18px;
    font-weight: bold;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* 通用阴影 */
}

.btn-restart.btn-outline {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-restart.btn-outline:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    background-color: var(--stat-bg, #faf5ff);
}

.stat-item .value { color: var(--stat-color, #805ad5); font-variant-numeric: tabular-nums; background: var(--stat-bg, #faf5ff); padding: 4px 16px; border-radius: 12px; border: 2px solid var(--stat-border, #e9d8fd);}
.stat-item .warning { color: #e53e3e; background: #fff5f5; border-color: #fed7d7;}
.stat-item .combo { color: #dd6b20; font-size: 26px; font-style: italic; animation: pop 0.3s ease; background: #fffff0; border-color: #fbd38d;}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.game-board {
    width: 95%; max-width: none; flex: 1; display: flex; justify-content: center; align-items: center; /* 改为 center 使整个网格在可用空间内垂直居中 */
    padding-bottom: 80px; /* 为底部的悬浮按钮留出空间 */
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    width: 100%;
    align-content: center; /* 网格内容垂直居中 */
}

.card {
    height: 80px;
    border-radius: 16px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 4px solid transparent;
    user-select: none;
    position: relative;
    overflow: hidden;
}

/* 英文卡片背景与样式 */
.card-en {
    background-color: var(--card-en-bg, #faf5ff);
    color: var(--card-en-text, #4a5568);
}
.card-en .card-text {
    font-weight: 800;
}

/* 中文卡片背景与样式 */
.card-zh {
    background-color: var(--card-zh-bg, #fffaf0);
    color: var(--card-zh-text, #2d3748);
}
.card-zh .cn-text {
    font-weight: 700;
}

.card:hover:not(.matched) {
    transform: translateY(-6px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.12);
    border-color: var(--card-border-hover, #d6bcfa);
}

.card.selected {
    border: 4px solid var(--primary-color, #9f7aea); /* 选中时加粗边框 */
    background-color: var(--card-selected-bg, #f3e8ff);
    transform: scale(1.08);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.card.error {
    border-color: #fc8181;
    background-color: #fff5f5;
    animation: shake 0.4s ease-in-out;
}

.card.matched {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

.card-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding-top: 4px; /* 微调使其视觉上稍微偏下一点 */
}

.card-text {
    font-size: 32px;
    font-weight: 800;
    color: inherit;
    text-align: center;
    padding: 0 10px;
    word-break: break-word;
    letter-spacing: 1px;
}

.cn-text {
    font-size: 28px;
    color: inherit;
    letter-spacing: 2px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Vue List Transitions */
.card-list-move, .card-list-enter-active, .card-list-leave-active {
    transition: all 0.5s ease;
}
.card-list-enter-from, .card-list-leave-to {
    opacity: 0;
    transform: scale(0.5);
}
.card-list-leave-active {
    position: absolute;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center; 
    color: #a0aec0;
}
.empty-state .icon { font-size: 80px; margin-bottom: 24px; opacity: 0.6;}
.empty-state h3 { font-size: 28px; color: #4a5568; margin-bottom: 12px; font-weight: bold;}
.empty-state p { font-size: 18px; color: #718096; }

/* Modal */
.game-over-modal {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 100;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white; padding: 40px; border-radius: 16px; text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 400px; width: 90%;
}
/* PK 模式弹窗加宽、减小内边距 */
.pk-container .modal-content {
    max-width: 520px;
    padding: 28px;
}

.modal-content h2 { font-size: 32px; color: var(--primary-color, #2b6cb0); margin-bottom: 24px; }
.result-stats { margin-bottom: 30px; font-size: 18px; color: #4a5568; line-height: 1.8; text-align: left; background: #f7fafc; padding: 20px; border-radius: 8px;}
.result-stats strong { color: #2d3748; font-size: 20px;}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
