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

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-shapes { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.shape { position: absolute; border-radius: 50%; opacity: 0.08; animation: float 20s ease-in-out infinite; }
.shape-1 { width: 400px; height: 400px; background: linear-gradient(135deg, #a78bfa, #6366f1); top: -100px; left: -100px; }
.shape-2 { width: 300px; height: 300px; background: linear-gradient(135deg, #f472b6, #ec4899); top: 50%; right: -80px; animation-delay: -5s; }
.shape-3 { width: 250px; height: 250px; background: linear-gradient(135deg, #34d399, #10b981); bottom: -60px; left: 30%; animation-delay: -10s; }
.shape-4 { width: 200px; height: 200px; background: linear-gradient(135deg, #fbbf24, #f59e0b); top: 20%; left: 60%; animation-delay: -3s; }
.shape-5 { width: 350px; height: 350px; background: linear-gradient(135deg, #60a5fa, #3b82f6); bottom: 10%; right: 20%; animation-delay: -8s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.03); }
}

.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* Side panels */
.side-panel { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; padding: 20px 0; position: sticky; top: 0; height: 100vh; }
.side-left { border-right: 1px solid rgba(255,255,255,0.06); }
.side-right { border-left: 1px solid rgba(255,255,255,0.06); }

.side-header { display: flex; align-items: center; gap: 8px; padding: 0 16px 14px; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.side-icon { font-size: 14px; }
.side-left .side-icon { color: #34d399; }
.side-right .side-icon { color: #f87171; }
.side-title { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.7); }
.side-count { margin-left: auto; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 10px; }

.side-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.side-list::-webkit-scrollbar { width: 3px; }
.side-list::-webkit-scrollbar-track { background: transparent; }
.side-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.word-item { padding: 10px 16px; cursor: pointer; transition: background 0.15s; border-left: 3px solid transparent; }
.word-item:hover { background: rgba(255,255,255,0.04); }
.side-left .word-item { border-left-color: rgba(52, 211, 153, 0.3); }
.side-right .word-item { border-left-color: rgba(248, 113, 113, 0.3); }
.word-item-en { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.8); margin-bottom: 2px; }
.word-item-cn { font-size: 12px; color: rgba(255,255,255,0.35); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-empty { text-align: center; padding: 40px 16px; font-size: 13px; color: rgba(255,255,255,0.15); }

/* Center */
.center-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 30px 24px; min-width: 0; }

header { text-align: center; margin-bottom: 28px; width: 100%; max-width: 560px; }
.logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; }
.logo-icon { font-size: 32px; filter: drop-shadow(0 2px 8px rgba(167, 139, 250, 0.5)); }
header h1 { color: #fff; font-size: 26px; font-weight: 700; letter-spacing: 1px; background: linear-gradient(135deg, #e0e7ff, #c7d2fe, #a5b4fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Search */
.search-box { position: relative; margin-bottom: 16px; }
#search-input {
  width: 100%;
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
#search-input::placeholder { color: rgba(255,255,255,0.3); }
#search-input:focus { border-color: rgba(129, 140, 248, 0.5); background: rgba(255,255,255,0.09); }

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(30, 27, 60, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  margin-top: 4px;
  display: none;
  z-index: 100;
}
.search-results.show { display: block; }
.search-results::-webkit-scrollbar { width: 3px; }
.search-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.search-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: rgba(129, 140, 248, 0.15); }
.search-item-en { font-size: 15px; font-weight: 600; color: #e0e7ff; }
.search-item-cn { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.search-empty { padding: 20px; text-align: center; font-size: 13px; color: rgba(255,255,255,0.25); }

.stats { width: 100%; }
.stats-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#progress-text { font-size: 13px; color: rgba(255,255,255,0.6); font-weight: 500; }
.streak { font-size: 12px; color: #fbbf24; font-weight: 600; opacity: 0; transition: opacity 0.3s; }
.streak.visible { opacity: 1; }
.progress-bar { height: 5px; background: rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #818cf8, #a78bfa, #c084fc); border-radius: 10px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); width: 0%; box-shadow: 0 0 12px rgba(167, 139, 250, 0.6); }

/* Card */
.card { position: relative; background: rgba(255,255,255,0.06); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.1); border-radius: 28px; overflow: visible; width: 100%; max-width: 560px; box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1); animation: cardIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both; }
.card-glow { position: absolute; top: -1px; left: -1px; right: -1px; height: 2px; background: linear-gradient(90deg, transparent, #818cf8, #a78bfa, #c084fc, transparent); opacity: 0.8; border-radius: 28px 28px 0 0; }

.word-display { padding: 70px 40px; text-align: center; font-size: 52px; font-weight: 700; color: #fff; min-height: 220px; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; transition: background 0.2s; letter-spacing: 1px; text-shadow: 0 2px 20px rgba(167, 139, 250, 0.3); position: relative; }
.word-display:hover { background: rgba(255,255,255,0.03); }
.word-display::after { content: '点击查看详情'; position: absolute; bottom: 16px; font-size: 12px; font-weight: 400; color: rgba(255,255,255,0.2); letter-spacing: 1px; }

/* Detail panel */
.detail-panel { max-height: 0; overflow: hidden; transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.5s cubic-bezier(0.4, 0, 0.2, 1); background: rgba(0,0,0,0.2); border-top: 1px solid rgba(255,255,255,0.06); }
.detail-panel.open { max-height: 600px; padding: 28px 32px; overflow-y: auto; }

.detail-section { margin-bottom: 20px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-label { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: #818cf8; margin-bottom: 8px; }

.phonetic { font-size: 22px; color: rgba(255,255,255,0.7); font-style: italic; font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', sans-serif; }
.meaning { font-size: 20px; color: #e0e7ff; line-height: 1.7; font-weight: 500; }
.example { font-size: 18px; color: rgba(255,255,255,0.6); line-height: 1.8; padding-left: 16px; border-left: 3px solid #818cf8; word-break: break-word; }
.example em { color: #a78bfa; font-style: italic; }
.usage { font-size: 16px; color: rgba(255,255,255,0.4); line-height: 1.7; word-break: break-word; }

/* Buttons */
.controls { display: flex; gap: 16px; margin-top: 24px; justify-content: center; width: 100%; max-width: 560px; }

.btn { padding: 18px 40px; border: none; border-radius: 18px; font-size: 17px; font-weight: 600; cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; gap: 10px; letter-spacing: 0.5px; position: relative; overflow: hidden; }
.btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent); opacity: 0; transition: opacity 0.25s; }
.btn:hover::before { opacity: 1; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.btn:active { transform: translateY(0) scale(0.97); box-shadow: 0 2px 10px rgba(0,0,0,0.2); }

.btn-key { font-size: 13px; padding: 3px 8px; background: rgba(255,255,255,0.2); border-radius: 6px; font-weight: 700; }

.btn-know { background: linear-gradient(135deg, #34d399, #10b981); color: #fff; box-shadow: 0 4px 15px rgba(52, 211, 153, 0.3); }
.btn-know:hover { box-shadow: 0 8px 25px rgba(52, 211, 153, 0.45); }
.btn-dontknow { background: linear-gradient(135deg, #f87171, #ef4444); color: #fff; box-shadow: 0 4px 15px rgba(248, 113, 113, 0.3); }
.btn-dontknow:hover { box-shadow: 0 8px 25px rgba(248, 113, 113, 0.45); }

.btn-next { background: linear-gradient(135deg, #818cf8, #6366f1); color: #fff; width: 100%; max-width: 560px; justify-content: center; padding: 20px 40px; font-size: 18px; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3); }
.btn-next:hover { box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45); }
.btn-arrow { font-size: 20px; transition: transform 0.2s; }
.btn-next:hover .btn-arrow { transform: translateX(4px); }

.nav-controls { margin-top: 18px; width: 100%; max-width: 560px; }

footer { display: flex; gap: 10px; margin-top: 22px; justify-content: center; }
.btn-reset, .btn-focus { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.1); padding: 10px 20px; font-size: 13px; font-weight: 500; }
.btn-reset:hover, .btn-focus:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.2); }
.btn-icon-sm { font-size: 14px; }

.tip-bar { text-align: center; margin-top: 18px; font-size: 12px; color: rgba(255,255,255,0.2); letter-spacing: 0.5px; }
kbd { display: inline-block; padding: 3px 8px; font-size: 11px; font-family: inherit; color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 5px; margin: 0 2px; }

@keyframes cardIn { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes wordFade { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
.word-display.animate { animation: wordFade 0.3s ease-out; }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
.word-item.new-left { animation: slideInLeft 0.3s ease-out; }
.word-item.new-right { animation: slideInRight 0.3s ease-out; }

@media (max-width: 900px) { .side-panel { display: none; } }
@media (max-width: 600px) {
  .center-area { padding: 20px 16px; }
  header h1 { font-size: 22px; }
  .word-display { font-size: 38px; padding: 50px 24px; min-height: 180px; }
  .btn { padding: 15px 28px; font-size: 15px; }
  .detail-panel.open { padding: 22px 24px; }
  .phonetic { font-size: 18px; }
  .meaning { font-size: 17px; }
  .example { font-size: 16px; }
  .usage { font-size: 14px; }
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Background themes - change every 100 words */
body.theme-0 { background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%); }
body.theme-1 { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
body.theme-2 { background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 50%, #2d4059 100%); }
body.theme-3 { background: linear-gradient(135deg, #1b0a2e 0%, #2d1b4e 50%, #4a2c6e 100%); }
body.theme-4 { background: linear-gradient(135deg, #0a192f 0%, #112240 50%, #233554 100%); }
body.theme-5 { background: linear-gradient(135deg, #1a0000 0%, #3d0000 50%, #5c1a1a 100%); }
body.theme-6 { background: linear-gradient(135deg, #001a1a 0%, #003333 50%, #0d4d4d 100%); }
body.theme-7 { background: linear-gradient(135deg, #1a1a00 0%, #333300 50%, #4d4d0d 100%); }
body.theme-8 { background: linear-gradient(135deg, #2d1f3d 0%, #1a1a2e 50%, #16213e 100%); }
body.theme-9 { background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%); }

body { transition: background 1.2s ease; }

/* Footer buttons */
.btn-stats, .btn-export { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.1); padding: 10px 16px; font-size: 13px; font-weight: 500; }
.btn-stats:hover, .btn-export:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.2); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal {
  background: rgba(30, 27, 60, 0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.3s ease-out;
}
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-header h2 { font-size: 20px; color: #e0e7ff; font-weight: 700; }
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

.modal-body { padding: 24px 28px 28px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }

.stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
}
.stat-number { font-size: 28px; font-weight: 700; color: #e0e7ff; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: rgba(255,255,255,0.35); }

.stat-green .stat-number { color: #34d399; }
.stat-red .stat-number { color: #f87171; }
.stat-blue .stat-number { color: #818cf8; }

.stat-section { margin-bottom: 20px; }
.stat-section:last-child { margin-bottom: 0; }
.stat-section h3 { font-size: 14px; color: rgba(255,255,255,0.5); font-weight: 600; margin-bottom: 12px; letter-spacing: 0.5px; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  margin-bottom: 6px;
}
.stat-row span:first-child { font-size: 14px; color: rgba(255,255,255,0.5); }
.stat-row span:last-child { font-size: 14px; font-weight: 600; color: #e0e7ff; }

/* Calendar */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.03);
}
.cal-day.active { background: rgba(129, 140, 248, 0.3); color: #e0e7ff; }
.cal-day.today { border: 1px solid rgba(129, 140, 248, 0.5); }
.cal-header { font-size: 10px; color: rgba(255,255,255,0.2); text-align: center; padding: 4px 0; }
