/* 中医罗盘 - 样式表 */
@import "https://fonts.googleapis.cn/css2?family=Noto+Serif+SC:wght@400;700&display=swap";

:root {
  --bg-light: #f5f0e8;
  --bg-parchment: linear-gradient(180deg, #c9b896 0%, #b8a782 30%, #a69570 100%);
  --plate-bottom: #fdfcf8;
  --plate-top: #ffffff;
  /* --plate-top: #edfded; */
  --center-fill: #5a7a5a;
  --divider: #5c3d2e;
  --text-vermilion: #c41e3a;
  --text-gromwell: #7b3f8c;
  --text-ink: #3c2415;
  --line-subtle: rgba(92, 61, 46, 0.25);
  --highlight: rgba(196, 30, 58, 0.12);
  --gap-fill: rgba(245, 240, 232, 0.6);
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background: var(--bg-parchment);
  font-family: 'Noto Serif SC', serif;
  color: var(--text-ink);
  overflow-x: hidden;
}

/* Header */
.app-header {
  text-align: center;
  padding: 20px 16px 8px;
}

.app-header h1 {
  font-family: 'Microsoft YaHei', 'SimSun', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-ink);
  letter-spacing: 0.08em;
  margin-bottom: 0;
  text-shadow: none;
}

.app-header .subtitle {
  font-family: 'Microsoft YaHei', 'SimSun', sans-serif;
  font-size: 13px;
  color: var(--text-vermilion);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

/* Main layout */
.app-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 32px;
  gap: 20px;
}

/* Compass container */
.compass-wrapper {
  position: relative;
  width: min(92vw, 780px);
  height: min(92vw, 780px);
  user-select: none;
  -webkit-user-select: none;
}

.compass-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.compass-svg.top {
  cursor: grab;
  z-index: 2;
}

.compass-svg.top:active {
  cursor: grabbing;
}

.compass-svg.bottom {
  z-index: 1;
  	border-radius: 50%;
			background: radial-gradient(circle at 38% 32%, rgba(255, 255, 255, .92) 0%, transparent 55%),
				linear-gradient(145deg, #fdfcf8 0%, #f5f2ea 45%, #ebe6da 100%);
			box-shadow: 0 10px 40px rgba(60, 45, 25, .42), 0 3px 12px rgba(60, 45, 25, .22),
				inset 0 1px 4px rgba(255, 255, 255, .9), inset 0 -2px 6px rgba(180, 165, 140, .18);
			transition: transform .06s ease-out;
			cursor: grab;
			border: 1px solid rgba(200, 185, 160, .35);
}
.compass-svg.bottom:active {
			cursor: grabbing;
		}

		.compass-svg.bottom svg {
			width: 100%;
			height: 100%;
		}

/* Magnifier */
.magnifier {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--divider);
  pointer-events: none;
  z-index: 10;
  display: none;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(92, 61, 46, 0.2);
  background: var(--bg-parchment);
}

.magnifier.active {
  display: block;
}

.magnifier-inner {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
}

.magnifier-inner svg {
  width: 100%;
  height: 100%;
}

.magnifier-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.magnifier-crosshair::before,
.magnifier-crosshair::after {
  content: '';
  position: absolute;
  background: var(--divider);
}

.magnifier-crosshair::before {
  width: 100%;
  height: 1px;
  top: 50%;
}

.magnifier-crosshair::after {
  width: 1px;
  height: 100%;
  left: 50%;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.tool-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--divider);
  background: var(--plate-bottom);
  color: var(--text-ink);
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s;
}

.tool-btn:hover {
  background: var(--highlight);
}

.tool-btn.active {
  background: var(--text-vermilion);
  color: #fff;
  border-color: var(--text-vermilion);
}

/* Info panel */
.info-panel {
  width: min(90vw, 640px);
  border: 1.5px solid var(--divider);
  background: var(--plate-bottom);
  padding: 16px 20px;
  min-height: 60px;
}

.info-panel h3 {
  font-size: 15px;
  color: var(--text-vermilion);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.info-panel .info-row {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.info-panel .info-label {
  color: var(--text-vermilion);
  font-weight: 700;
  white-space: nowrap;
  min-width: 56px;
}

.info-panel .info-value {
  color: var(--text-ink);
}

.info-panel .info-value.purple {
  color: var(--text-gromwell);
}

.info-panel .info-empty {
  color: var(--line-subtle);
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* SVG text styles */
.compass-text {
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 0.05em;
}

/* Sector styles */
.sector-bottom {
  fill: var(--plate-bottom);
  stroke: var(--divider);
  stroke-width: 1;
}

.sector-top {
  fill: var(--plate-top);
  stroke: var(--divider);
  stroke-width: 1;
}

.sector-top.gap {
  fill: none;
  stroke: none;
}

.sector-bottom.highlight {
  fill: var(--highlight);
}

/* Ring outline */
.ring-outline {
  fill: none;
  stroke: var(--divider);
  stroke-width: 1.5;
}

.ring-subtle {
  fill: none;
  stroke: var(--line-subtle);
  stroke-width: 0.5;
}

/* Center circle */
.center-fill {
  fill: var(--center-fill);
}

/* ===== AB 面切换 ===== */
.face-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  height: 40px;
  background: var(--bg-light);
  border-bottom: 1px solid rgba(92,61,46,0.18);
  padding: 0 8px;
}
.face-back {
  padding: 0 10px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #5c3d2e;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(92,61,46,0.18);
  font-family: 'Microsoft YaHei', 'SimSun', serif;
  cursor: pointer;
  white-space: nowrap;
  height: 100%;
  margin-right: 4px;
}
.face-back:active {
  color: #c41e3a;
}
.face-tab {
  padding: 0 18px;
  font-size: 13px;
  letter-spacing: 1px;
  color: #5c3d2e;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Microsoft YaHei', 'SimSun', serif;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.face-tab.active {
  color: #c41e3a;
  border-bottom-color: #c41e3a;
  font-weight: 700;
}
.face-panel {
  display: none;
}
.face-panel.active {
  display: block;
}
#face-b {
  position: fixed;
  top: 40px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-parchment);
}
.face-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Responsive */
@media (max-width: 600px) {
  .app-header h1 {
    font-size: 18px;
    letter-spacing: 3px;
  }
  .compass-wrapper {
    width: 95vw;
  }
  .info-panel {
    width: 95vw;
  }
  .magnifier {
    width: 100px;
    height: 100px;
  }
}
