/* ==============================================================================
 * ILoveCN 核心视觉系统 (css/style.css)
 * 严格遵循 Tiamo Design System & UI Style Guide (UI_STYLE_GUIDE.md)
 * 零 Emoji 网页原则、iPad 触控与防遮挡自适应 (CROSS_DEVICE_ADAPTATION_SPEC.md)
 * ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* --- 品牌主色系 (Primary Indigo) --- */
  --brand-primary: #4f46e5;
  --brand-primary-hover: #4338ca;
  --brand-primary-light: #eef2ff;
  --brand-primary-glow: rgba(79, 70, 229, 0.25);

  /* --- 中性灰度色系 (Neutral Slate) --- */
  --bg-base: #f8fafc;
  --surface-card: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --border-color: #e2e8f0;
  --border-subtle: rgba(226, 232, 240, 0.85);

  /* --- 文本色阶 (Text) --- */
  --text-main: #0f172a;
  --text-regular: #334155;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;

  /* --- 状态功能色 (Feedback) --- */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #0284c7;

  /* --- Tiamo 微顶栏安全避让变量 --- */
  --tiamo-bar-height: 32px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: calc(100vh - var(--tiamo-bar-height, 0px));
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@supports (height: 100dvh) {
  body {
    min-height: calc(100dvh - var(--tiamo-bar-height, 0px));
  }
}

/* 胶囊细滚动条 (Custom Scrollbars) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 磨砂毛玻璃卡片 */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}

/* 标准 42px 纯图标按键 (.icon-btn) */
.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: #475569;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn:hover {
  background: #f8fafc;
  color: var(--text-main);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.icon-btn:active {
  transform: scale(0.95);
  background: #f1f5f9;
}

.icon-btn.primary {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px var(--brand-primary-glow);
}

.icon-btn.primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}
.btn-primary:active {
  transform: scale(0.96);
}

.btn-outline {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.btn-outline:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}
.btn-outline:active {
  transform: scale(0.96);
}

.btn-danger {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
  background: #ffe4e6;
  border-color: #f43f5e;
}

/* 模态弹窗层级强规范：> 1000 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* AI 批改 7 种高亮标注样式规范 */
/* 1. 错别字：删除线划掉错字，错字标红；绿色加粗显示正确字 */
.mark-typo-del {
  color: #ef4444;
  text-decoration: line-through;
  font-weight: 500;
  padding: 0 2px;
}
.mark-typo-add {
  color: #10b981;
  font-weight: 700;
  padding: 0 2px;
}

/* 2. 缺字：绿色加粗显示添加的字 */
.mark-missing {
  color: #10b981;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 0 2px;
}

/* 3. 多字：删除线划掉多字，多字标红 */
.mark-redundant {
  color: #ef4444;
  text-decoration: line-through;
  font-weight: 600;
  padding: 0 2px;
}

/* 4. 语法错误：删除线划掉错误语句，标灰；后接绿色加粗正确语句 */
.mark-grammar-del {
  color: #94a3b8;
  text-decoration: line-through;
  background: rgba(148, 163, 184, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
}
.mark-grammar-add {
  color: #10b981;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: 4px;
}

/* 金币动态飘浮提示 */
@keyframes coinFloatUp {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  30% {
    opacity: 1;
    transform: translateY(-8px) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) scale(1);
  }
}

.coin-float-badge {
  animation: coinFloatUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  pointer-events: none;
}

/* 艾宾浩斯日历热力格 */
.cal-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.2s ease;
  position: relative;
  font-size: 0.85rem;
}
.cal-cell.status-green {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.cal-cell.status-yellow {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.cal-cell.status-red {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-weight: 700;
}
.cal-cell.status-empty {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
}
.cal-cell.is-today {
  box-shadow: 0 0 0 2px #4f46e5;
}

