/* === Sheet (.msheet FortuneSheet) === */

.sheet-doc-view {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sheet-body {
  flex: 1;
  padding: 0 !important;
  overflow: hidden;
  background: #f5f6f7;
}

#sheet-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.sheet-save-state {
  font-size: 12px;
  color: var(--neutral-400, #94a3b8);
  margin-right: 8px;
  opacity: 0;
  transition: opacity .2s;
}

.sheet-save-state.visible { opacity: 1; color: #10b981; }

/* 树节点中的表格图标 */
.file-sheet { color: #10b981; }
.sheet-icon svg { color: #10b981; }

/* Markdown 嵌入的迷你表格 */
.sheet-embed {
  position: relative;
  margin: 12px 0;
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.sheet-embed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--neutral-50, #f8fafc);
  border-bottom: 1px solid var(--neutral-200, #e2e8f0);
  font-size: 12px;
  color: var(--neutral-600, #475569);
}

.sheet-embed-header .sheet-embed-title {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sheet-embed-header .sheet-embed-title svg {
  width: 14px;
  height: 14px;
  color: #10b981;
}

.sheet-embed-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--primary-500, #0ea5e9);
  text-decoration: none;
  border-radius: 6px;
  transition: background .15s;
}
.sheet-embed-open:hover { background: var(--neutral-100, #f1f5f9); }

.sheet-embed-frame {
  width: 100%;
  border: 0;
  display: block;
  background: #fff;
}

.sheet-embed-placeholder {
  padding: 24px;
  text-align: center;
  color: var(--neutral-400, #94a3b8);
  font-size: 13px;
  background: repeating-linear-gradient(
    45deg,
    var(--neutral-50, #f8fafc) 0 8px,
    #fff 8px 16px
  );
}

[data-theme="dark"] .sheet-body { background: #1a1d21; }
[data-theme="dark"] .sheet-embed { background: #1e2127; border-color: #2d333b; }
[data-theme="dark"] .sheet-embed-header { background: #22262d; border-color: #2d333b; color: #cbd5e1; }
