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

:root{
  --gold:#d4b896;
  --gold-dim:rgba(212,184,150,0.12);
  --green:#4a8d54;
  --text:#f5f2ec;
  --text-secondary:rgba(245,242,236,0.84);
  --text-dim:rgba(245,242,236,0.74);
  --text-faint:rgba(245,242,236,0.68);
  --border:rgba(255,255,255,0.18);
  --glass:rgba(12,16,14,0.58);
  --glass-light:rgba(12,16,14,0.46);
  --shadow-sm:0 2px 8px rgba(0,0,0,0.15);
  --shadow-md:0 4px 16px rgba(0,0,0,0.2);
  --shadow-lg:0 8px 32px rgba(0,0,0,0.25);
  --glow-gold:0 0 20px rgba(212,184,150,0.2);
}

html,body{
  height:100%;
  font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;
  background:#0c100e;
  color:var(--text);
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* ===== BACKGROUND ===== */
.bg{
  position:fixed;
  inset:0;
  z-index:0;
}
.bg::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg,rgba(5,9,7,.32),rgba(5,9,7,.58)),
    radial-gradient(circle at 50% 42%,transparent 0 20%,rgba(5,9,7,.18) 72%);
  pointer-events:none;
}
.bg img{
  width:100%;
  height:100%;
  object-fit:cover;
  filter:brightness(0.82) saturate(1.02);
}

/* ===== APP LAYOUT ===== */
.app{
  position:relative;
  z-index:1;
  height:100vh;
  display:flex;
  flex-direction:column;
  padding:24px 32px 20px;
}

/* ===== HEADER ===== */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-bottom:16px;
  margin-bottom:0;
}
.brand{
  display:flex;
  align-items:baseline;
  gap:12px;
}
.brand-name{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:16px;
  font-weight:500;
  letter-spacing:4px;
  text-shadow:0 1px 4px rgba(0,0,0,0.5);
}
.brand-sub{
  font-size:11px;
  color:var(--text-secondary);
  letter-spacing:1px;
  text-shadow:0 1px 3px rgba(0,0,0,0.4);
}
.studyroom-home-link{
  color:inherit;
  text-decoration:none;
}
.studyroom-return{
  display:inline-flex;
  align-items:center;
  text-decoration:none;
}
.integration-notice{
  width:min(920px, calc(100% - 32px));
  margin:10px auto 0;
  padding:10px 14px;
  border:1px solid rgba(201,168,76,.22);
  background:rgba(16,31,26,.66);
  color:var(--text-secondary);
  font-size:12px;
  line-height:1.6;
  text-align:center;
}
.nav-community{
  color:var(--gold);
  border-color:rgba(212,184,150,.35);
}
#loginBtn:disabled{
  cursor:not-allowed;
  opacity:.62;
}
.header-right{
  display:flex;
  align-items:center;
  gap:10px;
}
.header-account{
  position:relative;
}
.header-account summary{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  padding:6px 14px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--glass-light);
  color:var(--text-secondary);
  font-size:12px;
  cursor:pointer;
  list-style:none;
  user-select:none;
}
.header-account summary::-webkit-details-marker{
  display:none;
}
.header-account summary::after{
  content:"▾";
  margin-left:7px;
  color:var(--gold);
  font-size:10px;
}
.header-account[open] summary{
  color:var(--text);
  border-color:rgba(212,184,150,.42);
}
.account-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  z-index:220;
  width:210px;
  padding:12px;
  display:grid;
  gap:8px;
  border:1px solid rgba(212,184,150,.3);
  border-radius:12px;
  background:rgba(8,13,10,.94);
  box-shadow:var(--shadow-lg);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.account-menu .btn-ghost{
  width:100%;
  min-height:36px;
}
.account-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:28px;
  padding:0 4px 8px;
  border-bottom:1px solid var(--border);
}
.streak{
  font-size:11px;
  color:var(--text-secondary);
  letter-spacing:0.5px;
  text-shadow:0 1px 3px rgba(0,0,0,0.4);
}
.streak span{
  color:var(--gold);
  font-weight:500;
}

/* ===== NAVIGATION ===== */
.nav{
  display:flex;
  gap:4px;
  background:var(--glass);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  border:1px solid var(--border);
  border-radius:12px;
  padding:3px;
}
.nav-item{
  padding:8px 20px;
  font-size:12px;
  color:var(--text-faint);
  background:none;
  border:none;
  cursor:pointer;
  letter-spacing:1px;
  transition:all .2s;
  border-radius:8px;
  font-family:inherit;
}
.nav-item:hover{
  color:var(--text-secondary);
}
.nav-item.active{
  color:var(--gold);
  background:rgba(201,168,76,0.1);
}

/* ===== CENTER TIMER ===== */
.timer-section{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:24px;
}

.timer-ring{
  position:relative;
  width:280px;
  height:280px;
}
.timer-ring svg{
  width:100%;
  height:100%;
  transform:rotate(-90deg);
}
.timer-ring circle{
  fill:none;
}
.timer-ring .track{
  stroke:rgba(255,255,255,0.1);
  stroke-width:2.5;
}
.timer-ring .progress{
  stroke:rgba(255,255,255,0.9);
  stroke-width:2.5;
  stroke-linecap:round;
  transition:stroke-dashoffset .5s cubic-bezier(.4,0,.2,1);
  filter:drop-shadow(0 0 8px rgba(255,255,255,0.3));
}
.timer-face{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.timer-time{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:56px;
  font-weight:300;
  letter-spacing:4px;
  text-shadow:0 2px 20px rgba(0,0,0,0.8),0 0 40px rgba(0,0,0,0.5);
}
.timer-meta{
  font-size:12px;
  color:var(--text-secondary);
  letter-spacing:1.5px;
  margin-top:4px;
  text-shadow:0 1px 10px rgba(0,0,0,0.7);
}
.timer-phase{
  font-size:11px;
  color:var(--gold);
  letter-spacing:2px;
  margin-top:10px;
  padding:3px 10px;
  border:1px solid var(--gold-dim);
  border-radius:2px;
  text-shadow:0 1px 2px rgba(0,0,0,0.3);
}

/* ===== CONTROLS ===== */
.controls{
  display:flex;
  gap:12px;
  align-items:center;
}
.btn{
  padding:10px 28px;
  font-size:12px;
  letter-spacing:1.5px;
  border:none;
  cursor:pointer;
  transition:all .2s cubic-bezier(.4,0,.2,1);
  font-family:inherit;
  border-radius:8px;
}
.btn-primary{
  background:var(--gold);
  color:#0c100e;
  font-weight:500;
  box-shadow:var(--shadow-sm);
}
.btn-primary:hover{
  background:#e0c9a8;
  transform:translateY(-1px);
  box-shadow:var(--glow-gold);
}
.btn-ghost{
  background:var(--glass-light);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  color:var(--text-secondary);
  border:1px solid var(--border);
}
.btn-ghost:hover{
  color:var(--text);
  border-color:rgba(255,255,255,0.25);
}

/* ===== MODE SELECTOR ===== */
.modes{
  display:flex;
  gap:1px;
  background:var(--glass);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
}
.mode-btn{
  padding:10px 20px;
  font-size:11px;
  color:var(--text-faint);
  background:none;
  border:none;
  cursor:pointer;
  letter-spacing:0.5px;
  transition:all .2s;
  text-align:center;
  line-height:1.4;
}
.mode-btn:hover{
  color:var(--text-secondary);
  background:rgba(255,255,255,0.05);
}
.mode-btn.active{
  color:var(--gold);
  background:rgba(201,168,76,0.08);
}
.mode-label{
  display:block;
  font-size:11px;
  color:inherit;
}
.mode-value{
  display:block;
  font-size:11px;
  font-weight:500;
  color:inherit;
  margin-top:2px;
}

/* ===== BOTTOM PANELS ===== */
.panels{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
  margin-top:auto;
  padding-top:12px;
}
.panel{
  padding:14px;
  background:var(--glass);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:var(--shadow-sm),0 0 0 1px rgba(255,255,255,0.03);
}
.panel-header{
  display:block;
  width:100%;
  font-size:12px;
  font-weight:500;
  letter-spacing:1px;
  margin-bottom:10px;
  color:var(--text);
  text-shadow:0 1px 12px rgba(0,0,0,0.8);
  padding:0 0 8px;
  background:transparent;
  border-top:0;
  border-left:0;
  border-right:0;
  text-align:left;
  font-family:inherit;
  border-bottom:1px solid rgba(255,255,255,0.06);
  cursor:pointer;
  user-select:none;
}
.panel-header::after{
  content:'▾';
  float:right;
  font-size:10px;
  color:var(--text-faint);
  transition:transform .2s;
}
.panel.collapsed .panel-header::after{
  transform:rotate(-90deg);
}
.panel.collapsed .panel-header{
  margin-bottom:0;
  padding-bottom:0;
  border-bottom:none;
}
.panel.collapsed .panel-body{
  display:none;
}

/* ===== TASKS ===== */
.task-input-wrap{
  display:flex;
  gap:6px;
  margin-bottom:8px;
}
.task-input{
  flex:1;
  padding:6px 10px;
  font-size:11px;
  background:var(--glass-light);
  border:1px solid var(--border);
  border-radius:4px;
  color:var(--text);
  outline:none;
  font-family:inherit;
}
.task-input::placeholder{
  color:var(--text-faint);
}
.task-input:focus{
  border-color:rgba(201,168,76,0.3);
}
.task-add-btn{
  width:28px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--glass);
  border:1px solid var(--border);
  border-radius:4px;
  color:var(--gold);
  font-size:14px;
  cursor:pointer;
  transition:all .2s;
}
.task-add-btn:hover{
  background:rgba(201,168,76,0.1);
  border-color:rgba(201,168,76,0.3);
}
.task-list{
  display:flex;
  flex-direction:column;
  gap:4px;
  max-height:120px;
  overflow-y:auto;
}
.task-item{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:var(--text-secondary);
  padding:4px 6px;
  border-radius:4px;
  transition:all .2s;
  text-shadow:0 1px 10px rgba(0,0,0,0.7);
}
.task-item:hover{
  background:rgba(255,255,255,0.05);
}
.task-text{
  flex:1;
}
.task-check{
  width:16px;
  height:16px;
  border:1px solid var(--text-faint);
  border-radius:4px;
  flex-shrink:0;
  transition:all .2s;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  cursor:pointer;
}
.task-check:hover{
  border-color:var(--gold);
}
.task-item.done .task-check{
  background:var(--green);
  border-color:var(--green);
  color:#fff;
}
.task-item.done .task-text{
  color:var(--text-faint);
  text-decoration:line-through;
}
.task-delete{
  width:20px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:none;
  border:none;
  color:var(--text-faint);
  font-size:14px;
  cursor:pointer;
  border-radius:4px;
  opacity:0;
  transition:all .2s;
}
.task-item:hover .task-delete{
  opacity:1;
}
.task-delete:hover{
  color:#f44;
  background:rgba(244,68,68,0.1);
}

/* ===== STATS ===== */
.stat-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.stat-item{
  text-align:center;
}
.stat-value{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:20px;
  font-weight:400;
  color:var(--gold);
  text-shadow:0 2px 16px rgba(0,0,0,0.8),0 0 20px rgba(212,184,150,0.3);
}
.stat-label{
  font-size:10px;
  color:rgba(245,242,236,0.6);
  margin-top:2px;
  letter-spacing:0.5px;
  text-shadow:0 1px 8px rgba(0,0,0,0.7);
}



/* ===== REFERENCE VIEW ===== */
.ref-section{
  display:none;
  flex:1;
  flex-direction:column;
  overflow:hidden;
}
.ref-section.active{
  display:flex;
}
.ref-header{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:16px;
}
.ref-tabs{
  display:flex;
  gap:4px;
  background:var(--glass);
  backdrop-filter:blur(3px);
  border:1px solid var(--border);
  border-radius:8px;
  padding:3px;
}
.ref-tab{
  padding:6px 16px;
  font-size:11px;
  color:var(--text-faint);
  background:none;
  border:none;
  cursor:pointer;
  border-radius:6px;
  transition:all .2s;
  font-family:inherit;
}
.ref-tab:hover{
  color:var(--text-secondary);
}
.ref-tab.active{
  color:var(--gold);
  background:rgba(201,168,76,0.1);
}
.ref-search{
  flex:1;
  max-width:300px;
  padding:8px 16px;
  font-size:12px;
  background:var(--glass);
  backdrop-filter:blur(3px);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  outline:none;
  font-family:inherit;
}
.ref-search::placeholder{
  color:var(--text-faint);
}
.ref-search:focus{
  border-color:rgba(201,168,76,0.3);
}
.ref-list{
  flex:1;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding-right:8px;
}
.ref-item{
  padding:16px;
  background:var(--glass);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  border:1px solid var(--border);
  border-radius:12px;
  cursor:pointer;
  transition:all .2s;
  box-shadow:var(--shadow-sm);
}
.ref-item:hover{
  border-color:rgba(212,184,150,0.3);
  background:rgba(12,16,14,0.72);
  box-shadow:var(--shadow-md),0 0 15px rgba(212,184,150,0.1);
}
.ref-item-name{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:15px;
  font-weight:500;
  margin-bottom:6px;
  text-shadow:0 1px 3px rgba(0,0,0,0.4);
}
.ref-item-meta{
  font-size:11px;
  color:var(--text-faint);
  text-shadow:0 1px 2px rgba(0,0,0,0.3);
}
.ref-detail{
  display:none;
  flex:1;
  overflow-y:auto;
  padding:20px;
  background:var(--glass);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  border:1px solid var(--border);
  border-radius:12px;
}
.ref-detail.active{
  display:block;
}
.ref-detail-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:20px;
}
.ref-detail-title{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:28px;
  font-weight:500;
  text-shadow:0 2px 8px rgba(0,0,0,0.5),0 0 20px rgba(212,184,150,0.2);
}
.ref-detail-back{
  padding:6px 12px;
  font-size:11px;
  color:var(--text-faint);
  background:none;
  border:1px solid var(--border);
  border-radius:6px;
  cursor:pointer;
  font-family:inherit;
}
.ref-detail-back:hover{
  color:var(--text);
  border-color:rgba(255,255,255,0.25);
}
.ref-detail-section{
  margin-bottom:16px;
}
.ref-detail-label{
  font-size:11px;
  color:var(--gold);
  letter-spacing:1px;
  margin-bottom:6px;
}
.ref-detail-content{
  font-size:13px;
  line-height:1.8;
  color:var(--text-secondary);
  text-shadow:0 1px 2px rgba(0,0,0,0.3);
}
.ref-detail-verse{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:14px;
  color:var(--gold);
  line-height:2;
  padding:12px;
  background:rgba(201,168,76,0.06);
  border-radius:8px;
  border-left:3px solid var(--gold);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar{width:3px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.1);border-radius:2px}
::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.2)}

/* ===== MODAL ===== */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1000;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s;
}
.modal-overlay.active{
  opacity:1;
  pointer-events:auto;
}
.modal{
  background:rgba(12,16,14,0.8);
  backdrop-filter:blur(0px);
  border:1px solid var(--border);
  border-radius:16px;
  padding:24px;
  min-width:320px;
  max-width:400px;
  transform:scale(0.95);
  transition:transform .2s;
}
.modal-overlay.active .modal{
  transform:scale(1);
}
.modal-title{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:16px;
  font-weight:500;
  margin-bottom:16px;
  color:var(--text);
}
.modal-input{
  width:100%;
  padding:12px 16px;
  font-size:24px;
  font-family:"STSong","SimSun","Songti SC",serif;
  font-weight:300;
  text-align:center;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  outline:none;
  margin-bottom:20px;
}
.modal-input:focus{
  border-color:rgba(201,168,76,0.4);
}
.modal-hint{
  font-size:11px;
  color:var(--text-faint);
  text-align:center;
  margin-bottom:16px;
}
.modal-actions{
  display:flex;
  gap:12px;
}
.modal-btn{
  flex:1;
  padding:10px;
  font-size:13px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  font-family:inherit;
  transition:all .2s;
}
.modal-btn-cancel{
  background:rgba(255,255,255,0.05);
  color:var(--text-secondary);
  border:1px solid var(--border);
}
.modal-btn-cancel:hover{
  background:rgba(255,255,255,0.1);
  color:var(--text);
}
.modal-btn-confirm{
  background:var(--gold);
  color:#0c100e;
  font-weight:500;
}
.modal-btn-confirm:hover{
  background:#d4b896;
}

/* ===== REPORT MODAL ===== */
.report-section{
  margin-bottom:16px;
}
.report-label{
  font-size:11px;
  color:var(--text-faint);
  letter-spacing:1px;
  margin-bottom:8px;
}
.report-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}
.report-item{
  text-align:center;
  padding:8px;
  background:rgba(255,255,255,0.03);
  border-radius:6px;
}
.report-value{
  display:block;
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:20px;
  color:var(--gold);
}
.report-desc{
  display:block;
  font-size:10px;
  color:var(--text-faint);
  margin-top:2px;
}

/* ===== BACKGROUND SELECTOR ===== */
.bg-selector{
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  gap:8px;
  padding:8px 12px;
  background:rgba(12,16,14,.72);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  border:1px solid rgba(212,184,150,.35);
  border-radius:12px;
  z-index:100;
}
.bg-selector-label{
  display:flex;
  align-items:center;
  padding-right:4px;
  color:var(--gold);
  font-size:11px;
  letter-spacing:1px;
}
.bg-option{
  width:40px;
  height:28px;
  border-radius:6px;
  border:2px solid transparent;
  cursor:pointer;
  overflow:hidden;
  transition:all .2s;
  opacity:0.6;
}
.bg-option:hover{
  opacity:0.8;
  transform:scale(1.05);
}
.bg-option.active{
  border-color:var(--gold);
  opacity:1;
}
.bg-option img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.bg-option-add{
  width:40px;
  height:28px;
  border-radius:6px;
  border:2px dashed rgba(255,255,255,0.3);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--text-faint);
  font-size:16px;
  transition:all .2s;
}
.bg-option-add:hover{
  border-color:var(--gold);
  color:var(--gold);
  background:rgba(201,168,76,0.1);
}
.bg-option-remove{
  position:absolute;
  top:-4px;
  right:-4px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#f44;
  color:#fff;
  font-size:10px;
  display:none;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  line-height:1;
}
.custom-bg-item:hover .bg-option-remove,
.custom-bg-item:focus-within .bg-option-remove{
  display:flex;
}
.custom-bg-item{
  position:relative;
  display:inline-flex;
}
.bg-option-custom{
  position:relative;
}

/* ===== AUTH PAGES ===== */
.auth-container{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.auth-box{
  width:100%;
  max-width:360px;
  padding:40px 32px;
  background:rgba(12,16,14,0.8);
  border:1px solid var(--border);
  border-radius:16px;
}
.auth-title{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:24px;
  text-align:center;
  margin-bottom:32px;
  color:var(--text);
}
.auth-input{
  width:100%;
  padding:12px 16px;
  font-size:14px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  margin-bottom:16px;
  outline:none;
}
.auth-input:focus{
  border-color:var(--gold);
}
.auth-btn{
  width:100%;
  padding:12px;
  font-size:14px;
  background:var(--gold);
  color:#0c100e;
  border:none;
  border-radius:8px;
  cursor:pointer;
  font-weight:500;
  margin-bottom:16px;
}
.auth-btn:hover{
  background:#e0c9a8;
}
.auth-link{
  text-align:center;
  font-size:13px;
  color:var(--text-secondary);
}
.auth-link a{
  color:var(--gold);
  text-decoration:none;
}
.auth-error{
  color:#f44;
  font-size:12px;
  text-align:center;
  margin-bottom:16px;
  display:none;
}

/* ===== ONLINE USERS ===== */
.online-users{
  font-size:12px;
  color:var(--text-secondary);
  text-shadow:0 1px 6px rgba(0,0,0,0.6);
}
.user-nickname{
  font-size:12px;
  color:var(--gold);
  text-shadow:0 1px 6px rgba(0,0,0,0.6);
}

/* ===== INTERACT BAR ===== */
.interact-bar{
  position:fixed;
  top:60px;
  left:50%;
  transform:translateX(-50%) translateY(-100px);
  padding:8px 20px;
  background:rgba(12,16,14,0.8);
  border:1px solid var(--border);
  border-radius:20px;
  color:var(--text);
  font-size:13px;
  z-index:1000;
  transition:transform .3s ease;
  white-space:nowrap;
}
.interact-bar.show{
  transform:translateX(-50%) translateY(0);
}

/* ===== INTERACT PANEL ===== */
.interact-panel{
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  padding:12px 16px;
  background:rgba(12,16,14,0.8);
  border:1px solid var(--border);
  border-radius:12px;
  z-index:100;
}
.interact-emojis{
  display:flex;
  gap:8px;
  margin-bottom:8px;
}
.interact-btn{
  width:36px;
  height:36px;
  font-size:20px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
  border-radius:8px;
  cursor:pointer;
  transition:all .2s;
}
.interact-btn:hover{
  background:rgba(255,255,255,0.1);
  transform:scale(1.1);
}
.interact-texts{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.interact-text-btn{
  padding:6px 12px;
  font-size:12px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border);
  border-radius:16px;
  color:var(--text-secondary);
  cursor:pointer;
  transition:all .2s;
}
.interact-text-btn:hover{
  background:rgba(201,168,76,0.1);
  border-color:var(--gold);
  color:var(--gold);
}

/* ===== AUTH MODAL ===== */
#authModal .modal{
  min-width:300px;
  max-width:360px;
}
.auth-actions{
  display:flex;
  gap:12px;
}
.auth-actions .btn{
  flex:1;
}

/* ===== TOAST ===== */
.toast{
  position:fixed;
  bottom:80px;
  left:50%;
  transform:translateX(-50%) translateY(20px);
  padding:10px 24px;
  background:rgba(12,16,14,0.9);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  font-size:13px;
  z-index:2000;
  opacity:0;
  transition:all .3s ease;
  pointer-events:none;
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

/* ===== HEADER BUTTONS ===== */
.btn-sm{
  padding:6px 14px;
  font-size:12px;
}

/* ===== CHAT SIDEBAR ===== */
.chat-sidebar{
  position:fixed;
  right:0;
  bottom:0;
  width:min(520px, 42vw);
  height:calc(100vh - 160px);
  max-height:520px;
  background:rgba(8,13,10,.82);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  border:1px solid rgba(212,184,150,.3);
  border-bottom:none;
  border-right:none;
  border-radius:12px 0 0 0;
  display:flex;
  flex-direction:column;
  z-index:50;
}
.chat-header{
  padding:8px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid rgba(255,255,255,0.06);
  flex-shrink:0;
}
.chat-title{
  font-size:13px;
  font-weight:500;
  color:var(--text);
  text-shadow:0 1px 8px rgba(0,0,0,0.8);
}
.chat-online{
  font-size:11px;
  color:var(--text-dim);
  text-shadow:0 1px 4px rgba(0,0,0,0.6);
}
.chat-section-title{
  font-size:11px;
  color:var(--text-dim);
  margin-bottom:4px;
  letter-spacing:0.5px;
  flex-shrink:0;
  text-shadow:0 1px 4px rgba(0,0,0,0.6);
}
.chat-online{
  font-size:11px;
  color:var(--text-dim);
}
.chat-toggle{
  background:none;
  border:none;
  color:var(--text-dim);
  font-size:16px;
  cursor:pointer;
  padding:0;
}
.chat-toggle:hover{
  color:var(--text);
}
.chat-body{
  flex:1;
  display:flex;
  overflow:hidden;
  min-height:0;
}
.chat-col{
  display:flex;
  flex-direction:column;
  padding:8px;
  overflow-y:auto;
  min-width:0;
}
.chat-col::-webkit-scrollbar{width:2px}
.chat-col::-webkit-scrollbar-track{background:transparent}
.chat-col::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.1);border-radius:2px}
.chat-col-left{
  width:70px;
  flex-shrink:0;
  border-right:1px solid rgba(255,255,255,0.06);
}
.chat-col-center{
  flex:1;
  min-width:0;
  border-right:1px solid rgba(255,255,255,0.06);
}
.chat-col-right{
  width:60px;
  flex-shrink:0;
}
.chat-section-title{
  font-size:9px;
  color:var(--text-dim);
  margin-bottom:4px;
  letter-spacing:0.5px;
  flex-shrink:0;
}
.chat-emojis{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  margin-bottom:8px;
  flex-shrink:0;
}
.chat-emoji-btn{
  width:100%;
  aspect-ratio:1;
  font-size:16px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:6px;
  cursor:pointer;
  transition:all .2s;
  display:flex;
  align-items:center;
  justify-content:center;
}
.chat-emoji-btn:hover{
  background:rgba(255,255,255,0.08);
  border-color:var(--gold);
  transform:scale(1.05);
}
.chat-texts{
  display:flex;
  flex-direction:column;
  gap:3px;
  flex:1;
  overflow-y:auto;
}
.chat-text-btn{
  padding:4px 5px;
  font-size:9px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:4px;
  color:var(--text-secondary);
  cursor:pointer;
  transition:all .2s;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  flex-shrink:0;
}
.chat-text-btn:hover{
  background:rgba(201,168,76,0.1);
  border-color:var(--gold);
  color:var(--gold);
}
.chat-messages{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.chat-empty{
  font-size:10px;
  color:var(--text-faint);
  text-align:center;
  padding:20px 0;
}
.chat-msg{
  padding:4px 6px;
  background:rgba(255,255,255,0.03);
  border-radius:4px;
  font-size:10px;
  line-height:1.3;
  flex-shrink:0;
}
.chat-msg-nick{
  color:var(--gold);
  font-size:9px;
  margin-bottom:1px;
  text-shadow:0 1px 4px rgba(0,0,0,0.8);
}
.chat-msg-content{
  color:var(--text-secondary);
  word-break:break-all;
  text-shadow:0 1px 3px rgba(0,0,0,0.6);
}
.chat-online-list{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.chat-online-item{
  display:flex;
  align-items:center;
  gap:3px;
  font-size:9px;
  color:var(--text-secondary);
}
.chat-online-dot{
  width:4px;
  height:4px;
  border-radius:50%;
  background:var(--green);
  flex-shrink:0;
}

/* ===== MAIN CONTENT ===== */
.app{
  margin-left:0;
}

/* ===== RECITE VIEW ===== */
.recite-wrap{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:24px;
}
.recite-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  max-width:520px;
}
.recite-progress{
  font-size:13px;
  color:var(--text-secondary);
  letter-spacing:1px;
  text-shadow:0 1px 8px rgba(0,0,0,0.7);
}
.recite-actions{
  display:flex;
  gap:8px;
}
.btn-sm{
  padding:6px 14px;
  font-size:11px;
}
.recite-card{
  position:relative;
  width:100%;
  max-width:520px;
  height:300px;
  cursor:pointer;
  perspective:1200px;
  padding:0;
  background:transparent;
  border:0;
  color:inherit;
  font-family:inherit;
}
.recite-card-face{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:16px;
  padding:32px;
  background:rgba(12,16,14,0.55);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow-md);
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  transition:transform .5s cubic-bezier(.4,0,.2,1);
}
.recite-card-back{
  transform:rotateY(180deg);
}
.recite-card.flipped .recite-card-front{
  transform:rotateY(-180deg);
}
.recite-card.flipped .recite-card-back{
  transform:rotateY(0deg);
}
.recite-card-tag{
  font-size:10px;
  color:var(--gold);
  letter-spacing:2px;
  padding:3px 10px;
  border:1px solid var(--gold-dim);
  border-radius:2px;
}
.recite-card-name{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:36px;
  font-weight:400;
  letter-spacing:6px;
  text-shadow:0 2px 16px rgba(0,0,0,0.8);
}
.recite-card-hint{
  font-size:11px;
  color:var(--text-faint);
  letter-spacing:1px;
}
.recite-card-verse{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:18px;
  line-height:2;
  letter-spacing:1px;
  text-align:center;
  color:var(--text);
  text-shadow:0 1px 10px rgba(0,0,0,0.7);
}
.recite-card-detail{
  font-size:12px;
  color:var(--text-secondary);
  line-height:1.8;
  text-align:center;
  max-height:80px;
  overflow-y:auto;
  white-space:pre-line;
}
.recite-controls{
  display:flex;
  gap:12px;
  align-items:center;
}
.recite-retry{
  align-self:center;
}
.recite-load-notice{
  width:100%;
  max-width:520px;
  color:var(--gold);
  font-size:12px;
  line-height:1.6;
  text-align:center;
}
.recite-controls button:disabled,
.recite-actions button:disabled,
.recite-card:disabled{
  cursor:not-allowed;
  opacity:.55;
}
.recite-mark-btn.marked{
  color:var(--green);
  border-color:rgba(74,141,84,0.4);
}
.recite-tabs{
  display:flex;
  gap:6px;
}
.recite-tab{
  padding:6px 14px;
  font-size:11px;
  background:var(--glass);
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--text-secondary);
  cursor:pointer;
  transition:all .2s;
  font-family:inherit;
}
.recite-tab:hover{
  border-color:rgba(255,255,255,0.25);
}
.recite-tab.active{
  color:var(--gold);
  background:rgba(201,168,76,0.1);
  border-color:rgba(201,168,76,0.3);
}
.recite-tab-wrong{
  color:var(--text-faint);
}
.recite-tab-wrong.active{
  color:#e57373;
  background:rgba(229,115,115,0.1);
  border-color:rgba(229,115,115,0.3);
}
.recite-stats{
  display:flex;
  gap:16px;
  font-size:11px;
  color:var(--text-secondary);
}
.recite-stat b{
  color:var(--gold);
  font-weight:500;
}
.btn-wrong{
  background:rgba(229,115,115,0.1);
  border:1px solid rgba(229,115,115,0.3);
  color:#e57373;
  padding:8px 16px;
  font-size:12px;
  border-radius:6px;
  cursor:pointer;
  transition:all .2s;
  font-family:inherit;
}
.btn-wrong:hover{
  background:rgba(229,115,115,0.2);
  border-color:rgba(229,115,115,0.5);
}

.stat-clickable{
  width:100%;
  border:0;
  background:transparent;
  color:inherit;
  font-family:inherit;
  cursor:pointer;
  transition:opacity .2s;
}
.stat-clickable:hover{
  opacity:0.8;
}

/* ===== CHAT REOPEN BUTTON ===== */
.chat-reopen{
  position:fixed;
  right:16px;
  bottom:16px;
  width:40px;
  height:40px;
  border-radius:50%;
  background:var(--glass);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  border:1px solid var(--border);
  color:var(--gold);
  font-size:18px;
  cursor:pointer;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:50;
  transition:all .2s;
  box-shadow:var(--shadow-sm);
}
.chat-reopen:hover{
  border-color:rgba(201,168,76,0.4);
  transform:scale(1.08);
}
.chat-reopen.show{
  display:flex;
}

/* ===== ZEN MODE ===== */
.zen-exit{
  position:fixed;
  top:20px;
  right:24px;
  padding:8px 16px;
  font-size:11px;
  letter-spacing:1px;
  color:var(--text-faint);
  background:transparent;
  border:1px solid transparent;
  border-radius:8px;
  cursor:pointer;
  font-family:inherit;
  z-index:200;
  display:none;
  transition:all .3s;
}
.zen-exit:hover{
  color:var(--text);
  border-color:var(--border);
}
body.zen-mode .zen-exit{
  display:block;
}
body.zen-mode .header,
body.zen-mode .panels,
body.zen-mode .chat-sidebar,
body.zen-mode .chat-reopen,
body.zen-mode .bg-selector,
body.zen-mode .modes{
  display:none !important;
}
body.zen-mode .timer-ring{
  width:340px;
  height:340px;
}
body.zen-mode .timer-time{
  font-size:64px;
}
body.zen-mode .controls{
  transition:opacity .5s;
}
body.zen-mode.zen-idle .controls{
  opacity:0;
  pointer-events:none;
}
body.zen-mode .app{
  padding:0;
}
body.zen-mode .timer-section{
  height:100vh;
}

/* ===== TIMER FEEDBACK ===== */
.timer-ring.pulse svg .progress{
  animation:ringPulse .6s ease-in-out 3;
}
@keyframes ringPulse{
  0%,100%{filter:drop-shadow(0 0 2px rgba(212,184,150,0.3));stroke-width:5}
  50%{filter:drop-shadow(0 0 14px rgba(212,184,150,0.9));stroke-width:7}
}

/* Summary modal */
.summary-stats{
  margin:14px 0 10px;
}
.summary-row{
  display:flex;
  justify-content:space-between;
  padding:7px 0;
  font-size:13px;
  color:var(--text-secondary);
  border-bottom:1px solid var(--border);
}
.summary-row:last-child{
  border-bottom:none;
}
.summary-row span:last-child{
  color:var(--gold);
  font-weight:500;
}
.summary-quote{
  text-align:center;
  font-size:12px;
  color:var(--text-faint);
  font-style:italic;
  margin:10px 0 4px;
}

/* Auto-continue toggle */
.auto-continue-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-top:14px;
}
.auto-continue-label{
  font-size:11px;
  color:var(--text-faint);
  letter-spacing:.5px;
}
.auto-continue-toggle{
  width:36px;
  height:20px;
  border-radius:10px;
  background:rgba(255,255,255,0.12);
  border:1px solid var(--border);
  position:relative;
  cursor:pointer;
  transition:background .25s;
}
.auto-continue-toggle::after{
  content:'';
  position:absolute;
  top:2px;
  left:2px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--text-faint);
  transition:all .25s;
}
.auto-continue-toggle.on{
  background:rgba(212,184,150,0.35);
  border-color:rgba(212,184,150,0.5);
}
.auto-continue-toggle.on::after{
  left:18px;
  background:var(--gold);
}

/* Today timeline */
.timeline-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--border);
  min-height:30px;
  flex-wrap:wrap;
}
.timeline-row:empty::before{
  content:'完成番茄后在这里显示学习节奏';
  font-size:11px;
  color:var(--text-faint);
  opacity:.7;
}
.timeline-dot{
  display:flex;
  align-items:center;
  gap:4px;
}
.timeline-dot::before{
  content:'';
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--gold);
  box-shadow:0 0 6px rgba(212,184,150,0.5);
}
.timeline-dot span{
  font-size:11px;
  color:var(--text-secondary);
}

/* ===== CALENDAR ===== */
.calendar-section{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid var(--border);
}
.calendar-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.calendar-title{
  font-size:12px;
  color:var(--text);
  font-weight:500;
}
.calendar-nav{
  display:flex;
  gap:4px;
}
.calendar-nav-btn{
  width:24px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--glass);
  border:1px solid var(--border);
  border-radius:4px;
  color:var(--text-secondary);
  cursor:pointer;
  font-size:14px;
  transition:all .2s;
  font-family:inherit;
}
.calendar-nav-btn:hover{
  border-color:rgba(255,255,255,0.25);
  color:var(--text);
}
.calendar-weekdays{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:2px;
  margin-bottom:4px;
}
.calendar-weekdays span{
  text-align:center;
  font-size:10px;
  color:var(--text-faint);
  padding:2px;
}
.calendar-days{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:2px;
}
.calendar-day{
  aspect-ratio:1;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  color:var(--text-secondary);
  border-radius:4px;
  position:relative;
}
.calendar-day.today{
  color:var(--gold);
  font-weight:500;
}
.calendar-day.studied{
  background:rgba(201,168,76,0.15);
  color:var(--gold);
}
.calendar-day.studied::after{
  content:'';
  position:absolute;
  bottom:2px;
  width:4px;
  height:4px;
  border-radius:50%;
  background:var(--gold);
}
.calendar-day.empty{
  color:transparent;
}

/* ===== DAILY GOAL ===== */
.daily-goal{
  margin-bottom:10px;
  cursor:pointer;
}
.daily-goal-info{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:4px;
}
.daily-goal-label{
  font-size:10px;
  color:var(--text-faint);
  letter-spacing:.5px;
}
.daily-goal-text{
  font-size:11px;
  color:var(--gold);
}
.goal-bar{
  height:4px;
  border-radius:2px;
  background:rgba(255,255,255,0.1);
  overflow:hidden;
}
.goal-bar-fill{
  height:100%;
  width:0%;
  border-radius:3px;
  background:linear-gradient(90deg, rgba(212,184,150,0.6), var(--gold));
  transition:width .4s ease;
}
.goal-bar-fill.done{
  background:linear-gradient(90deg, var(--gold), #f0d9a8);
  box-shadow:0 0 8px rgba(212,184,150,0.6);
}

/* ===== WEEK CHART ===== */
.week-chart{
  margin-top:10px;
  padding-top:8px;
  border-top:1px solid var(--border);
}
.week-chart-title{
  font-size:10px;
  color:var(--text-faint);
  letter-spacing:.5px;
  margin-bottom:6px;
}
.week-bars{
  display:flex;
  align-items:flex-end;
  gap:6px;
  height:50px;
}
.week-bar-col{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  height:100%;
  gap:4px;
}
.week-bar{
  width:100%;
  max-width:22px;
  border-radius:3px 3px 1px 1px;
  background:rgba(212,184,150,0.35);
  transition:height .3s;
}
.week-bar-col.today .week-bar{
  background:var(--gold);
  box-shadow:0 0 6px rgba(212,184,150,0.4);
}
.week-bar-col span{
  font-size:10px;
  color:var(--text-faint);
}
.week-bar-col.today span{
  color:var(--gold);
}

/* ===== BREAK-END OVERLAY ===== */
.break-overlay{
  position:fixed;
  inset:0;
  z-index:300;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(8,12,10,0.88);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.break-overlay.active{
  display:flex;
}
.break-overlay-content{
  text-align:center;
  animation:fadeUp .4s ease;
}
@keyframes fadeUp{
  from{opacity:0;transform:translateY(16px)}
  to{opacity:1;transform:translateY(0)}
}
.break-overlay-title{
  font-size:28px;
  font-family:"STSong","SimSun","Songti SC",serif;
  color:var(--text);
  margin-bottom:8px;
}
.break-overlay-sub{
  font-size:14px;
  color:var(--text-secondary);
  margin-bottom:20px;
}
.break-tip{
  font-size:13px;
  color:var(--gold);
  margin-bottom:28px;
  padding:10px 20px;
  border:1px solid rgba(212,184,150,0.25);
  border-radius:10px;
  background:rgba(212,184,150,0.06);
  display:inline-block;
}
.break-overlay-actions{
  display:flex;
  gap:14px;
  justify-content:center;
}

/* ===== PHASE COLORS ===== */
.timer-ring.phase-break svg .progress{
  stroke:var(--green);
}
.timer-ring.phase-break .timer-phase{
  color:var(--green);
}

/* ===== TIMER TIP ===== */
.timer-tip{
  font-size:12px;
  color:var(--text-faint);
  text-align:center;
  min-height:20px;
  margin-top:10px;
  letter-spacing:.5px;
}

/* ===== CHAT PANEL DRAG & MINIMIZE ===== */
.chat-header{
  cursor:move;
}
.chat-header button{
  cursor:pointer;
}
.chat-header-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.chat-sidebar.floating{
  border-radius:12px;
  border:1px solid var(--border);
}
.chat-sidebar.minimized{
  height:auto;
  width:auto;
  min-width:160px;
  max-height:none;
}
.chat-sidebar.minimized .chat-body{
  display:none;
}

/* ===== RESPONSIVE: TABLET ===== */
@media(max-width:1024px){
  .app{
    padding:20px 24px 16px;
  }
  .timer-ring{
    width:240px;
    height:240px;
  }
  .timer-time{
    font-size:48px;
  }
  .chat-sidebar{
    width:420px;
    max-width:48vw;
  }
}

/* ===== RESPONSIVE: MOBILE ===== */
@media(max-width:768px){
  html,body{
    overflow:auto;
  }
  .app{
    padding:12px 16px 12px;
    min-height:100dvh;
    height:auto;
  }
  
  /* Header竖排 */
  .header{
    flex-direction:column;
    gap:8px;
    padding-bottom:10px;
  }
  .header-right{
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
  }
  .header-account{
    order:3;
  }
  .account-menu{
    position:fixed;
    top:76px;
    left:50%;
    right:auto;
    width:min(280px,calc(100% - 32px));
    transform:translateX(-50%);
  }
  .brand-name{
    font-size:14px;
    letter-spacing:2px;
  }
  .brand-sub{
    display:none;
  }
  
  /* 番茄钟缩小 */
  .timer-section{
    gap:16px;
  }
  .timer-ring{
    width:200px;
    height:200px;
  }
  .timer-time{
    font-size:40px;
  }
  .timer-meta{
    font-size:11px;
  }
  .timer-phase{
    font-size:10px;
  }
  
  /* 按钮缩小 */
  .controls{
    gap:8px;
  }
  .btn{
    padding:8px 16px;
    font-size:12px;
  }
  
  /* 模式按钮 */
  .modes{
    flex-wrap:wrap;
    gap:6px;
  }
  .mode-btn{
    padding:8px 12px;
    font-size:11px;
  }
  .mode-value{
    font-size:11px;
  }
  
  /* 面板单栏 */
  .panels{
    grid-template-columns:1fr;
    gap:10px;
    padding-top:8px;
  }
  .panel{
    padding:12px;
  }
  .panel-header{
    font-size:11px;
    margin-bottom:8px;
    padding-bottom:6px;
  }
  
  /* 任务列表 */
  .task-input{
    padding:6px 8px;
    font-size:11px;
  }
  .task-add-btn{
    width:26px;
    height:26px;
    font-size:12px;
  }
  .task-item{
    font-size:11px;
    padding:4px 6px;
  }
  .task-list{
    max-height:100px;
  }
  
  /* 统计数据 */
  .stat-value{
    font-size:18px;
  }
  .stat-label{
    font-size:9px;
  }
  .stat-grid{
    gap:6px;
  }
  .daily-goal{
    margin-bottom:8px;
  }
  .week-bars{
    height:40px;
  }
  
  /* 互动面板底部全宽 */
  .chat-sidebar{
    width:100%;
    max-width:none;
    height:min(42dvh,320px);
    max-height:320px;
    border-radius:12px 12px 0 0;
    border:1px solid var(--border);
    border-bottom:none;
  }
  .chat-col-left{
    width:80px;
  }
  .chat-col-right{
    width:80px;
  }
  
  /* 查阅视图 */
  .ref-header{
    flex-direction:column;
    gap:8px;
  }
  .ref-tabs{
    width:100%;
  }
  .ref-tab{
    padding:6px 12px;
    font-size:11px;
  }
  .ref-search{
    width:100%;
  }
  .ref-list{
    max-height:300px;
  }
  .ref-detail{
    padding:12px;
    font-size:13px;
  }
  
  /* 背诵视图 */
  .recite-card{
    min-height:200px;
    padding:20px;
  }
  .recite-card-name{
    font-size:28px;
  }
  .recite-card-verse{
    font-size:14px;
  }
  .recite-controls{
    gap:8px;
  }
  
  /* 背景选择器 */
  .bg-selector{
    bottom:calc(min(42dvh,320px) + 12px);
    gap:6px;
  }
  .bg-option{
    width:40px;
    height:40px;
  }
  
  /* 沉浸模式退出按钮 */
  .zen-exit{
    top:8px;
    right:8px;
    padding:6px 12px;
    font-size:11px;
  }
  
  /* 弹窗 */
  .modal{
    width:90%;
    max-width:none;
    padding:20px;
  }
  .auth-input{
    padding:8px 12px;
    font-size:13px;
  }
  
  /* 自动续接 */
  .auto-continue-row{
    margin-top:8px;
  }
  .auto-continue-label{
    font-size:11px;
  }
}

/* ===== RESPONSIVE: SMALL PHONE ===== */
@media(max-width:400px){
  .app{
    padding:8px 12px 8px;
  }
  .timer-ring{
    width:180px;
    height:180px;
  }
  .timer-time{
    font-size:36px;
  }
  .nav-item{
    padding:4px 10px;
    font-size:10px;
  }
  .modes{
    gap:4px;
  }
  .mode-btn{
    padding:6px 8px;
    font-size:10px;
  }
}

/* ===== LEARNING NOTICE ===== */
.learning-notice{
  font-size:11px;
  color:var(--text-faint);
  text-align:center;
  padding:8px 16px;
  margin-bottom:12px;
  border:1px solid rgba(255,255,255,0.06);
  border-radius:8px;
  background:rgba(255,255,255,0.03);
  line-height:1.6;
}

.daily-goal{
  width:100%;
  border:0;
  background:transparent;
  color:inherit;
  font-family:inherit;
  text-align:left;
}

.bg-option,
.bg-option-add{
  padding:0;
  background-color:transparent;
  font-family:inherit;
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:2px;
}
button:focus-visible,
.nav-item:focus-visible,
.ref-tab:focus-visible,
.recite-tab:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:2px;
}

/* ===== REDUCED MOTION ===== */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:0.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:0.01ms !important;
  }
  .recite-card-face{
    transition:none;
  }
}

@media(max-width:768px){
  button{
    min-width:44px;
    min-height:44px;
  }
  .panel-header{
    min-height:44px;
    padding:10px 0;
  }
  .task-delete{
    opacity:1;
  }
  .recite-card{
    min-height:200px;
  }
  .chat-sidebar{
    padding-bottom:env(safe-area-inset-bottom, 0);
  }
}

/* ===== V7 DAYLIGHT STUDYROOM ===== */
:root{
  --gold:#855b2c;
  --gold-dim:rgba(133,91,44,.14);
  --green:#35644a;
  --text:#202a24;
  --text-secondary:rgba(32,42,36,.82);
  --text-dim:rgba(32,42,36,.7);
  --text-faint:rgba(32,42,36,.58);
  --border:rgba(62,74,66,.2);
  --glass:rgba(252,249,241,.84);
  --glass-light:rgba(252,249,241,.68);
  --shadow-sm:0 6px 18px rgba(24,34,28,.09);
  --shadow-md:0 14px 36px rgba(24,34,28,.13);
  --shadow-lg:0 22px 52px rgba(24,34,28,.18);
  --glow-gold:0 10px 26px rgba(133,91,44,.2);
}

html,
body{
  background:#d9d5c8;
}

.bg::after{
  background:
    linear-gradient(180deg,rgba(247,243,233,.04),rgba(16,28,21,.16)),
    radial-gradient(circle at 50% 44%,transparent 0 52%,rgba(19,31,24,.08) 100%);
}

.bg img{
  filter:brightness(1.02) saturate(1.02) contrast(1.02);
}

.app{
  padding:18px 24px;
}

.header{
  min-height:56px;
  padding:9px 12px;
  border:1px solid rgba(255,255,255,.48);
  border-radius:18px;
  background:rgba(252,249,241,.82);
  box-shadow:var(--shadow-sm);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

.brand-name,
.brand-sub,
.online-users,
.user-nickname,
.streak,
.timer-time,
.timer-meta,
.timer-phase,
.panel-header,
.task-item,
.stat-value,
.ref-item-name,
.ref-item-meta,
.ref-detail-title,
.ref-detail-content,
.recite-progress,
.recite-card-name,
.recite-card-verse,
.chat-title,
.chat-online,
.chat-section-title,
.chat-msg-nick,
.chat-msg-content{
  text-shadow:none;
}

.nav,
.header-account summary,
.btn-ghost{
  background:rgba(255,255,255,.46);
}

.nav-item.active{
  color:#fff;
  background:var(--green);
}

.nav-community{
  color:var(--green);
  border-color:rgba(53,100,74,.3);
}

.account-menu,
.modal,
.auth-box{
  color:var(--text);
  background:rgba(252,249,241,.96);
  border-color:var(--border);
}

.integration-notice{
  width:max-content;
  max-width:calc(100% - 32px);
  margin:8px auto 0;
  padding:6px 12px;
  border-color:rgba(255,255,255,.46);
  border-radius:999px;
  background:rgba(252,249,241,.74);
  color:var(--text-dim);
  line-height:1.4;
  box-shadow:0 4px 14px rgba(24,34,28,.07);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

.timer-section{
  width:auto;
  max-width:720px;
  min-height:0;
  gap:12px;
  padding:18px 24px;
  border:1px solid rgba(255,255,255,.52);
  border-radius:28px;
  background:rgba(252,249,241,.76);
  box-shadow:var(--shadow-md);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

.focus-heading{
  text-align:center;
}

.focus-kicker{
  display:block;
  margin-bottom:4px;
  color:var(--green);
  font-size:11px;
  font-weight:600;
  letter-spacing:2px;
}

.focus-heading h1{
  font-family:"STSong","SimSun","Songti SC",serif;
  font-size:22px;
  font-weight:500;
  letter-spacing:2px;
}

.focus-heading p{
  margin-top:4px;
  color:var(--text-faint);
  font-size:11px;
}

.timer-ring{
  width:228px;
  height:228px;
}

.timer-ring .track{
  stroke:rgba(32,42,36,.14);
}

.timer-ring .progress{
  stroke:var(--green);
  filter:drop-shadow(0 0 7px rgba(53,100,74,.2));
}

.timer-time{
  color:var(--text);
  font-size:48px;
}

.timer-phase{
  color:var(--green);
  border-color:rgba(53,100,74,.2);
}

.btn-primary{
  color:#fff;
  background:var(--green);
}

.btn-primary:hover{
  background:#294f3a;
}

.modes{
  background:rgba(255,255,255,.42);
}

.mode-btn:hover{
  background:rgba(53,100,74,.08);
}

.mode-btn.active{
  color:var(--green);
  background:rgba(53,100,74,.12);
}

.panel{
  background:rgba(252,249,241,.9);
  border-color:rgba(255,255,255,.58);
  box-shadow:var(--shadow-sm);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

.panel-header{
  border-bottom-color:rgba(62,74,66,.12);
}

.task-input,
.auth-input,
.modal-input,
.ref-search{
  color:var(--text);
  background:rgba(255,255,255,.62);
  border-color:var(--border);
}

.task-item:hover,
.ref-item:hover{
  background:rgba(53,100,74,.08);
}

.stat-value{
  color:var(--green);
}

.stat-label{
  color:var(--text-faint);
  text-shadow:none;
}

.ref-section{
  padding:18px;
  border:1px solid rgba(255,255,255,.52);
  border-radius:22px;
  background:rgba(252,249,241,.82);
  box-shadow:var(--shadow-md);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

.ref-tabs,
.ref-item,
.ref-detail,
.recite-card-face{
  background:rgba(252,249,241,.9);
  border-color:var(--border);
}

.ref-item:hover{
  border-color:rgba(53,100,74,.35);
}

.modal-overlay{
  background:rgba(25,35,29,.32);
}

.bg-selector{
  bottom:18px;
  color:var(--text);
  background:rgba(252,249,241,.88);
  border-color:rgba(255,255,255,.56);
  box-shadow:var(--shadow-sm);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

.bg-option-add{
  color:var(--text-dim);
  border-color:rgba(62,74,66,.3);
}

.chat-sidebar{
  left:24px;
  right:auto;
  bottom:24px;
  width:300px;
  height:390px;
  max-width:calc(100vw - 48px);
  max-height:calc(100vh - 138px);
  color:var(--text);
  background:rgba(252,249,241,.92);
  border:1px solid rgba(255,255,255,.62);
  border-radius:18px;
  box-shadow:var(--shadow-lg);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}

.chat-header,
.chat-col-left{
  border-color:rgba(62,74,66,.12);
}

.chat-col-left{
  width:72px;
}

.chat-col-center{
  border-right:0;
}

.chat-col-right{
  display:none;
}

.chat-emoji-btn,
.chat-text-btn,
.chat-msg{
  color:var(--text-secondary);
  background:rgba(255,255,255,.56);
  border-color:rgba(62,74,66,.13);
}

.chat-emoji-btn:hover,
.chat-text-btn:hover{
  color:var(--green);
  background:rgba(53,100,74,.1);
  border-color:rgba(53,100,74,.32);
}

.chat-reopen{
  left:18px;
  right:auto;
  color:var(--green);
  background:rgba(252,249,241,.92);
}

.toast{
  color:#fff;
  background:rgba(31,43,35,.92);
}

@media(min-width:1181px){
  .timer-section{
    margin:18px 324px 82px;
    align-self:center;
  }

  .panels{
    position:fixed;
    top:104px;
    right:24px;
    bottom:24px;
    width:292px;
    margin:0;
    padding:0 3px 0 0;
    grid-template-columns:1fr;
    grid-template-rows:minmax(0,1fr) auto;
    align-content:stretch;
    overflow:hidden;
    z-index:20;
  }

  .ref-section{
    margin:18px 0 76px 324px;
  }
}

@media(min-width:769px) and (max-width:1180px){
  .timer-section{
    margin:16px 0 76px 300px;
  }

  .panels{
    margin-left:300px;
  }

  .chat-sidebar{
    left:16px;
    bottom:16px;
    width:270px;
    height:360px;
  }

  .ref-section{
    margin:16px 0 70px 290px;
  }
}

@media(max-width:768px){
  .app{
    padding:10px 12px 88px;
  }

  .header{
    padding:9px;
    border-radius:16px;
  }

  .integration-notice{
    width:auto;
    font-size:10px;
  }

  .timer-section{
    margin:12px 0 0;
    padding:18px 12px;
    gap:10px;
  }

  .focus-heading h1{
    font-size:19px;
  }

  .focus-heading p{
    display:none;
  }

  .timer-ring{
    width:190px;
    height:190px;
  }

  .timer-time{
    font-size:38px;
  }

  .panels{
    margin-top:12px;
  }

  .ref-section{
    margin-top:12px;
    padding:12px;
  }

  .chat-sidebar{
    left:12px;
    right:auto;
    bottom:12px;
    width:calc(100% - 24px);
    max-width:none;
    height:min(44dvh,320px);
    max-height:320px;
    border:1px solid rgba(255,255,255,.62);
    border-radius:16px;
  }

  .chat-sidebar.minimized{
    left:12px;
    width:auto;
    min-width:158px;
  }

  .chat-col-left{
    width:76px;
  }

  .bg-selector{
    bottom:12px;
    max-width:calc(100% - 24px);
  }

  body.chat-open .bg-selector{
    bottom:min(calc(44dvh + 22px),330px);
  }

  .chat-reopen{
    left:12px;
    bottom:12px;
  }
}

/* ===== V7.1 WALLPAPER-FIRST BOTTOM DOCK ===== */
@media(min-width:769px){
  .integration-notice{
    position:fixed;
    top:88px;
    left:24px;
    width:auto;
    max-width:min(520px,calc(100vw - 360px));
    margin:0;
    z-index:30;
  }

  .bg-selector{
    top:88px;
    right:24px;
    bottom:auto;
    left:auto;
    transform:none;
  }

  .chat-sidebar,
  .timer-section,
  .panels{
    position:fixed;
    top:auto;
    bottom:20px;
    width:calc((100vw - 96px) / 3);
    max-width:440px;
    height:220px;
    max-height:220px;
    margin:0;
    color:rgba(255,255,255,.94);
    background:rgba(252,249,241,.13);
    border-color:rgba(255,255,255,.42);
    z-index:50;
  }

  .chat-sidebar{
    left:24px;
    right:auto;
    border-radius:18px;
  }

  .timer-section{
    left:50%;
    right:auto;
    align-self:auto;
    display:grid;
    grid-template-columns:120px minmax(0,1fr);
    grid-template-rows:auto auto auto;
    align-content:center;
    align-items:center;
    gap:8px 14px;
    padding:14px 16px;
    transform:translateX(-50%);
    border-radius:18px;
  }

  .focus-heading{
    grid-column:2;
    align-self:end;
    text-align:left;
  }

  .focus-kicker{
    margin-bottom:2px;
    font-size:10px;
  }

  .focus-heading h1{
    font-size:17px;
    letter-spacing:1px;
  }

  .focus-heading p{
    display:none;
  }

  .timer-ring{
    grid-column:1;
    grid-row:1 / 4;
    width:116px;
    height:116px;
  }

  .timer-time{
    font-size:30px;
    letter-spacing:2px;
  }

  .timer-meta{
    margin-top:1px;
    font-size:9px;
  }

  .timer-phase{
    margin-top:4px;
    padding:2px 7px;
    font-size:9px;
  }

  .timer-tip{
    display:none;
  }

  .controls{
    grid-column:2;
    gap:6px;
  }

  .controls .btn{
    min-width:0;
    padding:8px 10px;
    font-size:10px;
    letter-spacing:.5px;
  }

  .modes{
    grid-column:1 / 3;
    width:100%;
  }

  .mode-btn{
    flex:1;
    min-width:0;
    padding:5px 6px;
  }

  .mode-label,
  .mode-value{
    font-size:9px;
  }

  .auto-continue-row{
    position:absolute;
    top:14px;
    right:16px;
    margin:0;
  }

  .auto-continue-label{
    display:none;
  }

  .panels{
    right:24px;
    left:auto;
    display:grid;
    grid-template-columns:1fr;
    align-content:start;
    gap:4px;
    padding:10px;
    overflow-y:auto;
    border:1px solid rgba(255,255,255,.62);
    border-radius:18px;
    background:rgba(252,249,241,.13);
    box-shadow:var(--shadow-lg);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
  }

  .panels .panel{
    padding:6px;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
  }

  .panels .panel:first-child{
    height:100%;
    min-height:0;
    padding-bottom:34px;
    overflow:hidden;
  }

  .panels .panel:nth-child(2){
    position:absolute;
    right:10px;
    bottom:6px;
    left:10px;
    border-top:1px solid rgba(62,74,66,.12);
  }

  .panels .panel:nth-child(2).collapsed{
    height:30px;
    padding:0 6px;
    background:rgba(24,35,28,.46);
  }

  .panels .panel:nth-child(2).collapsed .panel-header{
    padding:6px 0;
  }

  .panels .panel:nth-child(2):not(.collapsed){
    top:10px;
    bottom:10px;
    z-index:2;
    padding:8px;
    overflow-y:auto;
    border:0;
    border-radius:10px;
    background:rgba(252,249,241,.9);
  }

  .chat-sidebar .chat-title,
  .chat-sidebar .chat-online,
  .chat-sidebar .chat-section-title,
  .chat-sidebar .chat-empty,
  .chat-sidebar .chat-msg-content,
  .timer-section .focus-heading h1,
  .timer-section .timer-time,
  .timer-section .timer-meta,
  .timer-section .timer-phase,
  .timer-section .auto-continue-label,
  .panels > .panel:first-child .panel-header,
  .panels > .panel:first-child .task-item,
  .panels .panel:nth-child(2).collapsed .panel-header{
    color:rgba(255,255,255,.94);
    text-shadow:0 1px 5px rgba(0,0,0,.72);
  }

  .timer-section .focus-kicker,
  .chat-sidebar .chat-msg-nick{
    color:#d7eadc;
    text-shadow:0 1px 5px rgba(0,0,0,.72);
  }

  .panels > .panel:first-child .task-delete{
    color:rgba(255,255,255,.72);
  }

  .panels .panel:nth-child(2):not(.collapsed) .panel-header{
    color:var(--text);
    text-shadow:none;
  }

  .panel-header{
    margin-bottom:7px;
    padding-bottom:6px;
  }

  .panel.collapsed .panel-header{
    padding:5px 0;
  }

  .task-input-wrap{
    margin-bottom:6px;
  }

  .task-list{
    max-height:88px;
  }

  .task-item{
    padding:3px 5px;
    font-size:11px;
  }

  .chat-body{
    min-height:0;
  }

  .chat-sidebar.minimized{
    width:auto;
    height:auto;
    max-height:none;
  }

  .ref-section{
    margin:18px 0 70px;
  }
}

@media(min-width:769px) and (max-width:1099px){
  .chat-sidebar,
  .panels{
    width:27vw;
  }

  .timer-section{
    width:40vw;
    grid-template-columns:104px minmax(0,1fr);
  }

  .timer-ring{
    width:100px;
    height:100px;
  }

  .focus-heading{
    display:none;
  }

  .timer-ring{
    grid-row:1 / 3;
  }

  .controls{
    grid-row:1;
  }

  .modes{
    grid-row:2;
  }

  .auto-continue-row{
    display:none;
  }
}

/* ===== V7.1.6 ALL GLASS AT THIRTEEN PERCENT ===== */
.header,
.integration-notice,
.bg-selector{
  border-color:rgba(255,255,255,.42);
  background:rgba(252,249,241,.13);
  box-shadow:0 12px 32px rgba(12,20,15,.18);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}

.header .brand-name,
.header .brand-sub,
.header .online-users,
.header-account summary,
.header .studyroom-return,
.header .nav-item:not(.active),
.integration-notice,
.bg-selector{
  color:rgba(255,255,255,.94);
  text-shadow:0 1px 5px rgba(0,0,0,.72);
}

.nav,
.header-account summary,
.header .studyroom-return{
  border-color:rgba(255,255,255,.3);
  background:rgba(252,249,241,.18);
}

.header .nav-community,
.bg-selector-label{
  color:#d7eadc;
  text-shadow:0 1px 5px rgba(0,0,0,.72);
}

.bg-option-add{
  color:rgba(255,255,255,.9);
  border-color:rgba(255,255,255,.46);
}

/* ===== V7.1.7 EXPANDED WALLPAPER STRIP ===== */
.bg-selector{
  max-width:calc(100vw - 48px);
  overflow-x:auto;
  scrollbar-width:thin;
}

.bg-selector-label,
.bg-selector > .bg-option,
.bg-option-add,
#customBgContainer,
.custom-bg-item{
  flex:0 0 auto;
}

#customBgContainer{
  display:flex;
  gap:8px;
}

/* ===== V7.1.8 CHAT QUICK ACTION GRID ===== */
.chat-col-left{
  width:112px;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.42) transparent;
}

.chat-col-left::-webkit-scrollbar{
  width:5px;
}

.chat-col-left::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.42);
  border-radius:999px;
}

.chat-col-left .chat-section-title{
  margin-bottom:3px;
  line-height:1.1;
}

.chat-col-left .chat-emojis{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:3px;
  margin-bottom:5px;
}

.chat-col-left .chat-emoji-btn{
  height:24px;
  min-height:24px;
  aspect-ratio:auto;
  font-size:14px;
}

.chat-col-left .chat-texts{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-content:start;
  gap:3px;
  flex:0 0 auto;
  min-height:0;
  overflow:visible;
}

.chat-col-left .chat-text-btn{
  min-width:0;
  min-height:18px;
  padding:2px 4px;
  line-height:1.2;
  text-align:center;
}

/* ===== V7.1.9 ONLINE ROSTER ===== */
.chat-online{
  padding:2px 5px;
  border:0;
  border-radius:999px;
  background:transparent;
  font-family:inherit;
  cursor:default;
}

.chat-online-list{
  min-height:0;
  overflow-y:auto;
}

.chat-online-item{
  display:grid;
  grid-template-columns:5px minmax(0,1fr);
  align-items:start;
  gap:5px;
  padding:4px 0;
}

.chat-online-dot{
  width:5px;
  height:5px;
  margin-top:4px;
}

.chat-online-identity{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:1px;
}

.chat-online-name{
  overflow:hidden;
  color:rgba(255,255,255,.94);
  text-overflow:ellipsis;
  white-space:nowrap;
  text-shadow:0 1px 4px rgba(0,0,0,.72);
}

.chat-online-id,
.chat-online-empty{
  color:rgba(255,255,255,.68);
  font-size:8px;
  letter-spacing:.4px;
  text-shadow:0 1px 4px rgba(0,0,0,.72);
}

@media(min-width:1100px){
  .chat-col-right{
    display:flex;
    width:78px;
    flex:0 0 78px;
    padding:8px 6px;
    border-left:1px solid rgba(255,255,255,.16);
  }
}

@media(max-width:1099px){
  .chat-online{
    cursor:pointer;
  }

  .chat-sidebar.online-roster-open .chat-col-right{
    position:absolute;
    top:35px;
    right:0;
    bottom:0;
    z-index:4;
    display:flex;
    width:116px;
    padding:10px;
    border-left:1px solid rgba(255,255,255,.28);
    border-radius:0 0 16px 0;
    background:rgba(24,35,28,.94);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
  }

  .chat-sidebar.online-roster-open .chat-online{
    color:#d7eadc;
    background:rgba(53,100,74,.32);
  }
}

/* ===== V7.1.11 FRAMELESS ZEN MODE ===== */
body.zen-mode .integration-notice,
body.zen-mode .focus-heading,
body.zen-mode .timer-tip,
body.zen-mode .auto-continue-row{
  display:none !important;
}

body.zen-mode .timer-section{
  position:fixed;
  inset:0;
  z-index:80;
  width:100vw;
  height:100dvh;
  max-width:none;
  max-height:none;
  min-height:100dvh;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:24px;
  transform:none;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

body.zen-mode .timer-ring{
  grid-column:auto;
  grid-row:auto;
  width:clamp(240px,30vw,340px);
  height:clamp(240px,30vw,340px);
  flex:0 0 auto;
}

body.zen-mode .controls{
  position:absolute;
  top:calc(50% + clamp(120px,15vw,170px) + 24px);
  left:50%;
  grid-column:auto;
  width:auto;
  justify-content:center;
  transform:translateX(-50%);
}

body.zen-mode .zen-exit,
body.zen-mode.zen-idle .zen-exit{
  top:20px;
  right:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:1;
  pointer-events:auto;
  color:rgba(255,255,255,.94);
  background:rgba(24,35,28,.56);
  border-color:rgba(255,255,255,.38);
  box-shadow:0 8px 24px rgba(0,0,0,.24);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  text-shadow:0 1px 4px rgba(0,0,0,.72);
}

@media(max-width:768px){
  body.zen-mode .timer-ring{
    width:clamp(220px,68vw,280px);
    height:clamp(220px,68vw,280px);
  }

  body.zen-mode .zen-exit,
  body.zen-mode.zen-idle .zen-exit{
    top:12px;
    right:12px;
  }

  body.zen-mode .controls{
    top:calc(50% + clamp(110px,34vw,140px) + 18px);
  }
}

/* ===== V7.1.13 READABILITY TUNE ===== */
.chat-sidebar .chat-msg{
  padding:6px 8px;
  color:rgba(255,255,255,.98);
  background:rgba(20,31,24,.42);
  border:1px solid rgba(255,255,255,.12);
  border-radius:7px;
  font-size:12px;
  line-height:1.45;
}

.chat-sidebar .chat-msg.is-self{
  background:rgba(34,78,52,.46);
  border-color:rgba(191,225,202,.24);
}

.chat-sidebar .chat-msg-nick{
  margin-bottom:2px;
  color:#e2f2e7;
  font-size:10px;
  font-weight:600;
  text-shadow:0 1px 2px rgba(0,0,0,.88);
}

.chat-sidebar .chat-msg-content{
  color:rgba(255,255,255,.98);
  text-shadow:0 1px 2px rgba(0,0,0,.88);
}

.chat-sidebar .chat-empty{
  color:rgba(255,255,255,.9);
  font-size:11px;
  text-shadow:0 1px 2px rgba(0,0,0,.88);
}

.chat-sidebar .chat-title{
  font-size:14px;
}

.chat-sidebar .chat-section-title,
.chat-sidebar .chat-text-btn,
.timer-section .timer-meta,
.timer-section .timer-phase{
  font-size:10px;
}

.chat-online-id,
.chat-online-empty{
  font-size:9px;
}

.chat-sidebar .chat-title,
.chat-sidebar .chat-online,
.chat-sidebar .chat-section-title,
.timer-section .focus-heading h1,
.timer-section .timer-time,
.timer-section .timer-meta,
.timer-section .timer-phase,
.timer-section .auto-continue-label,
.panels > .panel:first-child .panel-header,
.panels > .panel:first-child .task-item,
.panels .panel:nth-child(2).collapsed .panel-header{
  color:rgba(255,255,255,.98);
  text-shadow:0 1px 2px rgba(0,0,0,.88);
}

.panels > .panel:first-child .panel-header,
.panels > .panel:first-child .task-item{
  font-size:12px;
}

/* ===== V7.1.14 CRISP TYPE AND CENTERED KICKER ===== */
.header .brand-name,
.header .brand-sub,
.header .online-users,
.header-account summary,
.header .studyroom-return,
.header .nav-item,
.header .nav-community,
.integration-notice,
.bg-selector,
.bg-selector-label,
.chat-sidebar .chat-title,
.chat-sidebar .chat-online,
.chat-sidebar .chat-section-title,
.chat-sidebar .chat-empty,
.chat-sidebar .chat-msg-nick,
.chat-sidebar .chat-msg-content,
.chat-online-name,
.chat-online-id,
.chat-online-empty,
.timer-section .focus-kicker,
.timer-section .timer-time,
.timer-section .timer-meta,
.timer-section .timer-phase,
.timer-section .auto-continue-label,
.panels > .panel:first-child .panel-header,
.panels > .panel:first-child .task-item,
.panels .panel:nth-child(2).collapsed .panel-header{
  text-shadow:0 1px 1px rgba(0,0,0,.52);
}

.timer-section .timer-time{
  font-weight:400;
}

.timer-section .timer-meta,
.timer-section .timer-phase{
  font-size:11px;
  font-weight:500;
}

@media(min-width:1100px){
  .timer-section .focus-kicker{
    position:absolute;
    top:10px;
    right:16px;
    left:16px;
    margin:0;
    font-size:11px;
    line-height:15px;
    text-align:center;
    pointer-events:none;
  }

}

/* ===== V7.1.15 QUIET FOCUS CARD ===== */
.timer-section[hidden]{
  display:none !important;
}

@media(min-width:1100px){
  .timer-section{
    grid-template-rows:1fr auto;
  }

  .timer-section .focus-heading{
    position:absolute;
    top:10px;
    right:16px;
    left:16px;
    z-index:1;
    text-align:center;
    pointer-events:none;
  }

  .timer-section .focus-kicker{
    position:static;
    display:block;
  }

  .timer-section .timer-ring{
    grid-row:1;
  }

  .timer-section .controls{
    grid-row:1;
    align-self:center;
  }

  .timer-section .modes{
    grid-row:2;
  }
}

/* ===== V7.1.16 COMPLETE MODE ROW ===== */
@media(min-width:769px){
  .timer-section .modes{
    min-height:38px;
    flex-shrink:0;
  }

  .timer-section .mode-btn{
    min-height:36px;
  }

  .timer-section .mode-label,
  .timer-section .mode-value{
    line-height:1.2;
  }
}

/* ===== V7.1.18 LEGIBILITY FLOOR ===== */
.chat-sidebar .chat-title{
  font-size:15px;
}

.chat-sidebar .chat-online,
.chat-sidebar .chat-empty,
.chat-online-name{
  font-size:12px;
}

.chat-sidebar .chat-msg,
.chat-sidebar .chat-msg-content{
  font-size:13px;
  line-height:1.5;
}

.chat-sidebar .chat-msg-nick,
.chat-sidebar .chat-section-title,
.chat-sidebar .chat-text-btn,
.chat-online-id,
.chat-online-empty{
  font-size:11px;
}

.timer-section .focus-kicker,
.timer-section .timer-meta,
.timer-section .timer-phase,
.timer-section .mode-label,
.timer-section .mode-value,
.timer-section .auto-continue-label{
  font-size:11px;
}

.panels > .panel:first-child .panel-header,
.panels .panel:nth-child(2).collapsed .panel-header{
  font-size:13px;
}

.panels > .panel:first-child .task-item,
.panels .task-input{
  font-size:12px;
}

@media(min-width:769px){
  .chat-col-left{
    width:120px;
  }

  .chat-col-left .chat-emoji-btn{
    height:28px;
    min-height:28px;
    font-size:15px;
  }

  .chat-col-left .chat-text-btn{
    min-height:22px;
    padding:3px 4px;
  }

  .timer-section .controls .btn{
    font-size:11px;
  }

  .timer-section .mode-btn{
    padding:5px 4px;
  }
}

@media(min-width:769px) and (max-width:1099px){
  .chat-col-left{
    width:104px;
  }
}

@media(max-width:768px){
  .chat-sidebar .chat-title{
    font-size:14px;
  }

  .chat-sidebar .chat-msg,
  .chat-sidebar .chat-msg-content{
    font-size:12px;
  }
}
