/* ===== 墨水屏设计系统 ===== */
:root {
  --color-ink-bg: #FFFFFF;
  --color-ink-card: #F5F5F5;
  --color-ink-text: #000000;
  --color-ink-text-secondary: #666666;
  --color-ink-text-muted: #999999;
  --color-ink-border: #CCCCCC;
  --color-ink-border-light: #E5E5E5;
  --color-ink-nav-bg: #FFFFFF;
  --color-ink-nav-active: #000000;
  --color-ink-nav-inactive: #999999;
  --color-ink-btn-bg: #000000;
  --color-ink-btn-text: #FFFFFF;
  --color-ink-tag-bg: #F0F0F0;
  --color-ink-tag-border: #CCCCCC;
  --device-scale: 1.0;
}

/* 中等屏幕：轻微缩小 */
@media (max-height: 1100px) {
  :root { --device-scale: 0.9; }
}
/* 小屏幕：适度缩小 */
@media (max-height: 900px) {
  :root { --device-scale: 0.85; }
}

/* ===== 设备框架 ===== */
*, *::before, *::after { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-frame {
  width: 758px;
  height: 1024px;
  background: var(--color-ink-bg);
  border: 2px solid #333333;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transform: scale(var(--device-scale, 0.7));
  transform-origin: center center;
}

.device-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 24px;
}

.device-content::-webkit-scrollbar { display: none; }

/* ===== 墨水屏组件样式 ===== */
.ink-border { border: 1px solid var(--color-ink-border); }
.ink-border-light { border: 1px solid var(--color-ink-border-light); }
.ink-card { background: var(--color-ink-card); border: 1px solid var(--color-ink-border-light); }
.ink-btn-primary { background: var(--color-ink-btn-bg); color: var(--color-ink-btn-text); border: 1px solid var(--color-ink-btn-bg); }
.ink-btn-outline { background: var(--color-ink-bg); color: var(--color-ink-text); border: 1px solid var(--color-ink-border); }
.ink-tag { background: var(--color-ink-tag-bg); border: 1px solid var(--color-ink-tag-border); }

/* ===== 文本颜色工具类 ===== */
.text-ink-text { color: var(--color-ink-text); }
.text-ink-text-secondary { color: var(--color-ink-text-secondary); }
.text-ink-text-muted { color: var(--color-ink-text-muted); }
.bg-ink-text { background-color: var(--color-ink-text); }
.bg-ink-text-secondary { background-color: var(--color-ink-text-secondary); }
.bg-ink-card { background-color: var(--color-ink-card); }

/* ===== 阅读页特有样式 ===== */
.page-zone { position: relative; }
.paragraph { padding: 12px 16px; cursor: pointer; transition: background 0.15s; z-index: 10; position: relative; }
.paragraph.has-note::after { content: "📎"; font-size: 10px; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.paragraph.audio-highlight { background: rgba(0, 0, 0, 0.08); border-radius: 4px; transition: background 0.3s ease; }

/* Font sizes for reading */
.font-sm .text-ink-text { font-size: 14px; line-height: 1.8; }
.font-base .text-ink-text { font-size: 16px; line-height: 1.8; }
.font-lg .text-ink-text { font-size: 20px; line-height: 1.9; }
.font-xl .text-ink-text { font-size: 24px; line-height: 2.0; }

/* ===== 听书播放条 ===== */
.audio-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 26;
  background: var(--color-ink-bg);
  border-top: 1px solid var(--color-ink-border);
  padding: 6px 24px 4px;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}
.audio-bar.visible { transform: translateY(0); }
.audio-progress { flex: 1; height: 3px; background: var(--color-ink-border-light); border-radius: 2px; cursor: pointer; }
.audio-progress-fill { height: 100%; background: var(--color-ink-text); border-radius: 2px; transition: width 0.3s ease; }

/* ===== 弹窗/遮罩 ===== */
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal-content, .modal-panel {
  background: var(--color-ink-bg);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

/* ===== 书架特有 ===== */
.cover-ribbon-finished {
  position: absolute; top: 8px; right: -24px;
  background: #000; color: #fff;
  font-size: 8px; font-weight: 700;
  padding: 2px 28px;
  transform: rotate(45deg);
  pointer-events: none; z-index: 2;
}
.cover-badge-task {
  position: absolute; top: 0; left: 0;
  background: #000; color: #fff;
  font-size: 8px; font-weight: 600;
  padding: 2px 6px;
  border-bottom-right-radius: 6px;
  pointer-events: none; z-index: 2;
}
.card-import-badge {
  position: absolute; top: 0; right: 0;
  background: #333; color: #fff;
  font-size: 9px; font-weight: 600;
  padding: 3px 8px;
  border-bottom-left-radius: 8px;
  border-top-right-radius: 8px;
  pointer-events: none; z-index: 2;
}

/* ===== 状态栏 ===== */
.status-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--color-ink-bg);
  border-top: 1px solid var(--color-ink-border-light);
  padding: 2px 24px;
  display: flex; justify-content: space-between;
  font-size: 11px;
  color: var(--color-ink-text-muted);
  z-index: 25;
}

/* ===== 笔记/读后感弹窗 ===== */
.note-list-item { padding: 10px 0; border-bottom: 1px solid #e5e5e5; }
.note-list-item:last-child { border-bottom: none; }
