/* Minimalist Reading Flow UI */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --card: #ffffff;
  --text: #09090b;
  --muted: #71717a;
  --border: #e4e4e7;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
  --accent: #3b82f6;
  --radius: 8px;
  --control-h: 34px;
  --content-max: 780px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --surface: #18181b;
    --card: #18181b;
    --text: #fafafa;
    --muted: #a1a1aa;
    --border: #27272a;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.5);
  }
}

body.dark-theme {
  --bg: #09090b;
  --surface: #18181b;
  --card: #18181b;
  --text: #fafafa;
  --muted: #a1a1aa;
  --border: #27272a;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.5);
}

body.light-theme {
  --bg: #ffffff;
  --surface: #ffffff;
  --card: #ffffff;
  --text: #09090b;
  --muted: #71717a;
  --border: #e4e4e7;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

*{box-sizing:border-box}
html,body{height:100%}
[hidden]{display:none !important}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Microsoft YaHei",sans-serif;
  color:var(--text);
  background:var(--bg);
  min-height:100vh;
  padding:20px;
  position:relative;
}

#bg-canvas{
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
}

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

.hero{padding:40px 0 24px;text-align:center;position:relative}
.hero h1{
  font-size:2.5rem;
  color:var(--text);
  font-weight:600;
  margin:0 0 10px;
  letter-spacing:-0.02em;
}
.hero p{color:var(--muted);margin:0;font-size:16px;font-weight:400}

.back-inline{display:inline-flex;align-items:center;gap:6px;height:var(--control-h);padding:0 12px;border-radius:8px;border:1px solid var(--border);background:var(--surface);box-shadow:var(--shadow);color:inherit;flex:0 0 auto;}
.back-inline svg{width:14px;height:14px}
.back-inline[aria-pressed="true"]{background:var(--surface);color:var(--text);border-color:var(--text)}
.back-inline.icon-only{padding:0 10px}
.back-inline.icon-only svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6}

.segmented{display:inline-flex;gap:4px;background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:4px;margin-top:14px;}
.segmented .seg{appearance:none;border:1px solid transparent;background:transparent;color:var(--text);font-size:12px;padding:8px 12px;border-radius:8px;cursor:pointer;text-decoration:none;transition:all .15s ease; white-space:nowrap}
.segmented .seg.active{background:var(--bg);border-color:var(--text);box-shadow:var(--shadow);font-weight:600}
.segmented.tiny{padding:2px;gap:2px}
.segmented.tiny .seg{font-size:11px;padding:6px 8px}

.segmented.tabs{
  padding:6px;
  gap:4px;
  margin-top:20px;
  display:inline-flex;
  background:var(--surface);
  border-radius:8px;
  border:1px solid var(--border);
}
.seg-wrap{max-width:var(--content-max); margin:0 auto; display:flex; justify-content:center}
.segmented.tabs .seg{
  font-size:13px;
  font-weight:500;
  padding:10px 20px;
  border-radius:8px;
  border:1px solid transparent;
  transition:all .2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  letter-spacing:0.3px;
}
.segmented.tabs .seg:hover{
  background:var(--bg);
  transform:scale(1.02);
}
.segmented.tabs .seg.active{
  background:var(--bg);
  color:var(--text);
  border-color:var(--text);
  box-shadow:var(--shadow);
  font-weight:600;
}

@media (max-width: 768px){
  .hero{padding:40px 0 20px}
  .hero h1{font-size:42px}
  .hero .subtitle{font-size:14px}
  .segmented.tabs{
    gap:2px;
    padding:4px;
    margin-top:16px;
  }
  .segmented.tabs .seg{
    font-size:12px;
    padding:8px 16px;
  }
  .lessons-grid{grid-template-columns:1fr;gap:6px}
  .lesson-item{padding:16px}
  .lesson-title{font-size:16px}
}

.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px;padding:26px 0 64px}
.card{position:relative;border:1px solid var(--border);background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;transition:transform .2s ease, box-shadow .2s ease}
.card:hover{transform:translateY(-4px)}
.card img{width:100%;height:160px;object-fit:cover;display:block;opacity:.9}
.card .body{padding:14px 14px 16px}
.card .title{font-weight:700;margin:6px 0 4px}
.card .sub{font-size:12px;color:var(--muted)}

.last-seen-section{margin-bottom:20px; padding:8px 4px;}

.lessons{padding:10px 0 40px; max-width:var(--content-max); margin:0 auto}

.lessons-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:8px}
.lesson-item{
  background:var(--surface);
  border-radius:8px;
  border:1px solid var(--border);
  padding:20px;
  text-decoration:none;
  color:inherit;
  transition:all .2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.lesson-item:hover{
  transform:scale(1.02);
  box-shadow:0 8px 25px rgba(0,0,0,0.12);
  border-color:var(--border);
}
.lesson-item:active{
  transform:scale(1.01);
}
.lesson-content{display:flex;flex-direction:column;justify-content:center;flex:1;min-width:0;height:100%}
.lesson-num{
  font-size:11px;
  font-weight:600;
  color:var(--muted);
  letter-spacing:0.5px;
  text-transform:uppercase;
  margin-bottom:4px;
}
.lesson-title{
  font-size:17px;
  font-weight:600;
  line-height:1.3;
  color:var(--text);
}

.fav-btn{
  flex:0 0 auto;
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  color:var(--muted);
  opacity:0;
  transition:all .2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor:pointer;
  padding:0;
  margin:0;
  border:none;
  outline:none;
  border-radius:8px;
}
.lesson-item:hover .fav-btn{opacity:0.5}
.fav-btn:hover{
  opacity:1;
  color:var(--text);
  background:var(--surface);
  transform:scale(1.1);
}
.fav-btn.active{
  opacity:1;
  color:var(--text);
}
.fav-btn.active:hover{
  background:var(--surface);
}
.fav-btn svg{width:18px;height:18px;fill:currentColor}

.toolbar{position:sticky;top:0;z-index:10;background:transparent;padding:6px 0 4px;border-bottom:none}
.toolbar .row{display:flex;align-items:center;justify-content:flex-end;gap:10px}
.toolbar .info{display:flex;align-items:center;gap:10px}
.toolbar .title{font-weight:700}
.toolbar .sub{font-size:12px;color:var(--muted)}
.controls{display:flex;align-items:center;gap:8px}
.btn{appearance:none;border:1px solid var(--border);background:var(--surface);color:inherit;border-radius:8px;padding:6px 10px;cursor:pointer;box-shadow:var(--shadow)}
.btn:hover{transform:translateY(-1px)}

.sentences{padding:20px 0 40px; max-width:var(--content-max); margin:0 auto}
.sentence{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  margin:12px 0;
  cursor:pointer;
  transition:all .2s ease;
  text-decoration:none;
  color:inherit;
  display:block;
  position:relative;
}
.sentence:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-hover);
  border-color:var(--border);
}
.sentence.active{
  border:2px solid var(--text);
  box-shadow:0 6px 20px rgba(0,0,0,0.2);
  padding:19px;
}
.en{font-weight:600;font-size:1.1rem;line-height:1.5;color:var(--text)}
.cn{font-size:0.9rem;color:var(--muted);margin-top:8px;line-height:1.4}
.lang-en .cn{display:none}
.lang-cn .en{display:none}

.sentence.listen-mode:not(.revealed) {
  position: relative;
  cursor: pointer;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:var(--card);
}
.sentence.listen-mode:not(.revealed) .en,
.sentence.listen-mode:not(.revealed) .cn {
  opacity: 0;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.sentence.listen-mode:not(.revealed)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card);
  border-radius: calc(var(--radius) - 1px);
  z-index: 1;
}
.reveal-btn {
  display: none;
  position: absolute;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 2;
  opacity: 0;
  transition: all 0.2s ease;
  cursor: pointer;
  pointer-events: none;
}
.sentence.listen-mode:not(.revealed) .reveal-btn {
  display: inline-flex;
}
.sentence.listen-mode:not(.revealed):hover .reveal-btn {
  opacity: 0.7;
  pointer-events: auto;
}
.sentence.listen-mode:not(.revealed):hover .reveal-btn:hover {
  opacity: 1;
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}
.reveal-btn .reveal-icon {
  display: inline-block;
}
.reveal-btn .reveal-text {
  display: inline-block;
}
.sentence.listen-mode.active:not(.revealed) {
  border:2px solid var(--text);
  box-shadow:0 6px 20px rgba(0,0,0,0.2);
  padding:19px;
  min-height:60px;
}
.sentence.listen-mode.active:not(.revealed) .reveal-btn {
  opacity: 0.9;
  border-color: var(--text);
  color: var(--text);
  pointer-events: auto;
}
.sentence.listen-mode.revealed {
  cursor: default;
}
.sentence.listen-mode.revealed.active {
  border:2px solid var(--text);
  box-shadow:0 6px 20px rgba(0,0,0,0.2);
  padding:19px;
}
.sentence.listen-mode.revealed .en,
.sentence.listen-mode.revealed .cn {
  animation: revealText 0.3s ease forwards;
}
@keyframes revealText {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.sentence.listen-mode.revealed .reveal-btn {
  display: inline-flex;
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  z-index: 3;
  pointer-events: auto;
}
.sentence.listen-mode.revealed .reveal-btn .reveal-icon {
  display: none;
}
.sentence.listen-mode.revealed:hover .reveal-btn {
  opacity: 0.7;
  pointer-events: auto;
}

.auto-continue-card{display:inline-flex; gap:4px; background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:4px; animation:fadeIn 0.2s ease-out; height:var(--control-h); align-items:center;}
.auto-continue-option{display:flex; align-items:center; gap:0; border-radius:8px; transition:all 0.15s ease;}
.auto-continue-option input[type="radio"]{appearance:none; position:absolute; opacity:0;}
.auto-continue-option label{display:block; padding:6px 10px; font-size:12px; color:var(--text); cursor:pointer; border-radius:8px; border:1px solid transparent; transition:all 0.15s ease; margin:0; white-space:nowrap;}
.auto-continue-option input[type="radio"]:checked + label{background:var(--bg); color:var(--text); border-color:var(--text); box-shadow:var(--shadow); font-weight:600;}
.auto-continue-option:hover label{background:var(--bg);}
.auto-continue-option input[type="radio"]:disabled + label{opacity:0.5; cursor:not-allowed;}
.auto-continue-option input[type="radio"]:disabled + label:hover{background:transparent;}

@keyframes fadeIn{from{opacity:0; transform:scale(0.95);} to{opacity:1; transform:scale(1);}}
@keyframes slideDown{from{opacity:0; transform:translate(-50%, -20px);} to{opacity:1; transform:translate(-50%, 0);}}
@keyframes slideUp{from{opacity:1; transform:translate(-50%, 0);} to{opacity:0; transform:translate(-50%, -20px);}}

@media (max-width: 768px){
  .auto-continue-card{gap:2px; padding:3px;}
  .auto-continue-option label{padding:5px 8px; font-size:11px;}

  #afterPlayCard{
    display:grid !important;
    grid-template-columns:1fr 1fr;
    grid-template-rows:auto auto;
    gap:4px;
    padding:4px;
    width:100%;
    flex-wrap:nowrap;
  }
  #afterPlayCard .auto-continue-option{
    width:100%;
    display:flex;
  }
  #afterPlayCard .auto-continue-option label{
    width:100%;
    text-align:center;
    padding:8px 6px;
    font-size:12px;
  }

  .settings-group:has(#afterPlayCard){
    align-items:center;
  }
}

.player{display:flex; align-items:center; gap:8px; margin:6px auto 10px; padding:0; background:transparent; border:none; box-shadow:none; min-height:var(--control-h); max-width:var(--content-max); width:100%;}

.custom-player{display:flex; align-items:center; gap:8px; flex:1; height:var(--control-h); background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:0 12px; box-shadow:var(--shadow); transition:all .2s ease;}
.custom-player:hover{box-shadow:var(--shadow-hover);}
.custom-player audio{display:none;}

.play-btn{display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; background:transparent; border:none; color:var(--text); cursor:pointer; padding:0; transition:all .2s ease;}
.play-btn:hover{transform:scale(1.1);}
.play-btn svg{width:18px; height:18px;}

.time-display{font-size:11px; font-weight:500; color:var(--muted); min-width:32px; text-align:center; font-variant-numeric:tabular-nums;}

.progress-container{flex:1; height:100%; display:flex; align-items:center; cursor:pointer; padding:0 4px;}
.progress-bar{position:relative; width:100%; height:4px; background:color-mix(in srgb, var(--border) 80%, transparent); border-radius:2px; overflow:hidden;}
.progress-filled{height:100%; background:var(--text); border-radius:2px; transition:width .1s linear; min-width:0;}
.progress-bar:hover{height:6px;}
.progress-bar:hover .progress-filled{height:100%;}

.lesson-nav{display:flex; gap:10px; padding:6px 0 16px; max-width:var(--content-max); margin:0 auto}
.btn-nav{display:inline-flex; align-items:center; justify-content:center; padding:8px 14px; min-width:96px;
  border-radius:8px; border:1px solid var(--border); background:var(--surface); color:inherit; text-decoration:none; box-shadow:var(--shadow);
  transition:transform .15s ease, box-shadow .15s ease}
.btn-nav:hover{transform:translateY(-2px); box-shadow:var(--shadow)}
.btn-nav.prev{margin-right:auto}
.btn-nav.next{margin-left:auto}

footer{
  padding:32px 0;
  color:var(--muted);
  text-align:center;
  margin-top:40px;
  border-top:1px solid var(--border);
}
footer p{
  margin:6px 0;
  text-align:center;
  font-size:14px;
  font-weight:500;
}
.repo{margin-bottom:8px}
.gh-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  text-decoration:none;
  transition:all .2s ease;
  padding:8px 12px;
  border-radius:8px;
}
.gh-link:hover{
  color:var(--text);
  background:color-mix(in srgb, var(--surface) 50%, transparent);
}
.byline a, .thanks a, .version a{
  color:var(--muted);
  text-decoration:none;
  transition:color .2s ease;
}
.byline a:hover, .thanks a:hover, .version a:hover{
  color:var(--text);
}
.version{
  font-size:12px;
  margin-top:8px;
  opacity:0.7;
}
.version a{
  font-family:-apple-system, BlinkMacSystemFont, "SF Mono", "Monaco", "Cascadia Code", monospace;
  letter-spacing:0.3px;
}

.section{ padding:6px 0 8px }
.section-title{ font-size:12px; color:var(--muted); letter-spacing:.02em; margin:4px 2px 8px; }

.last-seen{
  background:var(--surface);
  border-radius:8px;
  border:1px solid var(--border);
  border-left:4px solid var(--border);
  padding:20px;
  text-decoration:none;
  color:inherit;
  transition:all .2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:8px 4px 16px 4px;
}
.last-seen:hover{
  transform:scale(1.02);
  box-shadow:0 8px 25px rgba(0,0,0,0.12);
  border-color:var(--border);
  border-left-color:var(--border);
}
.last-seen:active{
  transform:scale(1.01);
}
.last-seen .lesson-content::before{
  content:'继续学习';
  position:absolute;
  top:-6px;
  left:0;
  font-size:10px;
  font-weight:600;
  color:var(--muted);
  background:var(--surface);
  padding:0 6px;
  border-radius:4px;
  letter-spacing:0.5px;
  text-transform:uppercase;
}

a{color:inherit}
a{text-decoration:none}

.gh-link svg{width:18px;height:18px;fill:currentColor;opacity:.8;vertical-align:middle;transition:opacity .2s ease, transform .2s ease}
.gh-link:hover svg{opacity:1;transform:translateY(-1px)}

body, .card, .lesson-item, .sentence{ transition: background-color .35s ease, color .35s ease, box-shadow .35s ease, border-color .35s ease; }

.settings-overlay{position:fixed; inset:0; background:color-mix(in srgb, var(--bg) 30%, rgba(0,0,0,0.35)); backdrop-filter:saturate(130%) blur(12px); -webkit-backdrop-filter:saturate(130%) blur(12px); z-index:900;}
.settings-panel{position:fixed; left:50%; top:50%; transform:translate(-50%,-52%) scale(.98); width:min(92vw, 520px); max-height:min(86vh, 680px); overflow:auto; background:var(--surface); border:1px solid var(--border); border-radius:8px; box-shadow:var(--shadow); z-index:901; padding:12px 14px; display:flex; flex-direction:column; gap:10px; opacity:0;}
.settings-overlay, .settings-panel{transition:opacity .22s ease, transform .22s ease}
.settings-overlay{opacity:0}
.settings-overlay.show{opacity:1}
.settings-panel.show{opacity:1; transform:translate(-50%,-50%) scale(1)}
.settings-header{display:flex; align-items:center; justify-content:space-between; padding:4px 6px 2px 6px; border-bottom:1px solid color-mix(in srgb, var(--border) 70%, transparent);}
.settings-header h2{font-size:16px; font-weight:600; margin:6px 0;}
.icon-btn{display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:inherit; box-shadow:var(--shadow); cursor:pointer}
.icon-btn:hover{background:color-mix(in srgb, var(--surface) 80%, transparent)}
.settings-body{display:flex; flex-direction:column; gap:10px; padding:4px}
.settings-group{display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--bg)}
.settings-left{display:flex; flex-direction:column; gap:4px; min-width:0;}
.settings-label{font-size:13px; color:var(--text); font-weight:600}
.settings-desc{font-size:12px; color:var(--muted); line-height:1.5}
.settings-control{display:flex; align-items:center; gap:8px}
.settings-footer{display:flex; justify-content:space-between; padding:6px}
.settings-control #modeToggle{display:none}

.settings-panel .back-inline{height:28px; padding:0 10px}
.settings-panel .auto-continue-card{height:auto; padding:6px}
.settings-panel .auto-continue-option label{padding:6px 10px}

#afterPlayCard{
  display:inline-flex;
  flex-direction:row;
  align-items:center;
  gap:4px;
  height:auto;
  padding:6px;
  width:auto;
  flex-wrap:wrap;
}
#afterPlayCard .auto-continue-option label{
  display:block;
  white-space:nowrap;
  text-align:center;
  min-height:0;
  padding:6px 10px;
  width:auto;
}

@media (max-width: 560px){
  .player .back-inline:not(#backLink):not(#settingsBtn){display:none}
}

.shortcuts-panel{max-height:min(90vh, 720px)}
.shortcuts-group{padding:12px 0; border-bottom:1px solid color-mix(in srgb, var(--border) 50%, transparent)}
.shortcuts-group:last-child{border-bottom:none}
.shortcuts-group h3{font-size:13px; font-weight:600; color:var(--text); margin:0 0 10px 0; letter-spacing:0.3px}
.shortcut-item{display:flex; align-items:center; justify-content:space-between; padding:8px 0; gap:12px}
.shortcut-item kbd{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:32px;
  height:28px;
  padding:0 10px;
  border-radius:6px;
  border:1px solid var(--border);
  background:var(--surface);
  box-shadow:0 2px 4px rgba(0,0,0,0.08), inset 0 -1px 0 rgba(0,0,0,0.1);
  font-family:-apple-system, BlinkMacSystemFont, "SF Mono", "Monaco", "Cascadia Code", monospace;
  font-size:12px;
  font-weight:500;
  color:var(--text);
  letter-spacing:0.3px;
  white-space:nowrap;
}
.shortcut-item span{font-size:13px; color:var(--muted); flex:1; text-align:right}

@media (prefers-color-scheme: light) {
  .shortcut-item kbd{
    background:linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
    box-shadow:0 2px 4px rgba(0,0,0,0.05), inset 0 -1px 0 rgba(0,0,0,0.06);
  }
}


/* ===== 学习素材包弹窗样式 ===== */
.material-modal {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: top 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease, visibility 0s 0.5s;
  max-width: 500px;
  width: 90%;
}

.material-modal.show {
  top: 20px;
  opacity: 1;
  visibility: visible;
  transition: top 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease, visibility 0s 0s;
}

.material-modal-content {
  background: linear-gradient(135deg, var(--accent), #7c4dff);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: modalPulse 2s ease-in-out infinite;
}

@keyframes modalPulse {
  0%, 100% {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 20px 80px rgba(59, 130, 246, 0.5);
  }
}

.material-modal-body {
  padding: 32px 24px 24px;
  text-align: center;
  color: white;
}

.material-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.material-text {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.material-modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.material-btn {
  flex: 1;
  max-width: 150px;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.material-btn-cancel {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.material-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.material-btn-ok {
  background: white;
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.material-btn-ok:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

/* 素材包按钮样式 */
#materialBtn {
  display: inline-flex;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
}

#materialBtn:hover {
  background: var(--card);
  transform: translateY(-1px);
}

#materialBtn .seg {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  letter-spacing: 0.3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

#materialBtn .seg:hover {
  background: var(--bg);
  transform: scale(1.02);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .material-modal {
    width: calc(100% - 32px);
  }
  
  .material-modal.show {
    top: 16px;
  }
  
  .material-modal-body {
    padding: 24px 20px 20px;
  }
  
  .material-icon {
    font-size: 48px;
    margin-bottom: 12px;
  }
  
  .material-text {
    font-size: 16px;
  }
  
  .material-modal-footer {
    padding: 12px 20px 20px;
  }
  
  .material-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  #materialBtn {
    margin-left: 8px !important;
  }
  
  #materialBtn .seg {
    font-size: 12px;
    padding: 8px 16px;
  }
}

@media (prefers-color-scheme: light) {
  .material-modal-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  }
  
  @keyframes modalPulse {
    0%, 100% {
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    }
    50% {
      box-shadow: 0 20px 80px rgba(59, 130, 246, 0.3);
    }
  }
}
