/* 紙ノート風 ワイヤーフレーム共通スタイル */

@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Caveat:wght@400;500;600;700&family=Shippori+Mincho:wght@400;500;600;700&family=Klee+One:wght@400;600&family=Zen+Kurenaido&family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

:root {
  --paper: #fbf8f1;
  --paper-2: #f5f0e3;
  --ink: #2a2622;
  --ink-soft: #4a423a;
  --ink-faint: #8a8175;
  --rule: #d9cfb8;
  --rule-soft: #e8dfc7;
  --accent-red: #b94a3b;     /* 添削の朱 */
  --accent-blue: #2f5d8a;    /* 改善案の青 */
  --accent-green: #5a7a4a;   /* 良い点 */
  --accent-amber: #b58840;   /* ハイライト */
  --margin-line: #c98a85;    /* ノートの余白線 */
  --hole: #efe7d3;

  --font-hand: 'Kalam', 'Klee One', 'Zen Kurenaido', cursive;
  --font-hand-jp: 'Klee One', 'Zen Kurenaido', 'Kalam', cursive;
  --font-mincho: 'Shippori Mincho', 'Times New Roman', serif;
  --font-sans: 'Noto Sans JP', system-ui, sans-serif;
}

/* ============= 基本リセット ============= */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-hand-jp);
  color: var(--ink);
  background: #e8e2d0;
}

/* ============= ペーパー ============= */
.paper {
  background: var(--paper);
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 27px,
      var(--rule-soft) 27px,
      var(--rule-soft) 28px
    );
  position: relative;
  border: 1px solid var(--rule);
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04),
    0 8px 20px rgba(60,40,20,0.06);
}

.paper.no-rule {
  background-image: none;
}

/* 左の余白赤線 */
.paper.with-margin::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 56px;
  width: 1px;
  background: var(--margin-line);
  opacity: 0.55;
}

/* ノートの穴 */
.holes {
  position: absolute;
  left: 18px;
  top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  pointer-events: none;
}
.holes span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--hole);
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.15);
}

/* ============= 手書き的なテキスト ============= */
.h-title {
  font-family: var(--font-hand);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.2;
}
.h-jp {
  font-family: var(--font-hand-jp);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.h-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.h-mincho {
  font-family: var(--font-mincho);
  color: var(--ink);
}

/* ============= ボタン（手書き枠） ============= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-hand-jp);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  position: relative;
}
.btn.primary {
  background: var(--ink);
  color: var(--paper);
}
.btn.ghost {
  border-style: dashed;
  border-color: var(--ink-faint);
  color: var(--ink-soft);
}
.btn.sm { padding: 4px 10px; font-size: 12px; }

/* ============= タグ・チップ ============= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  font-family: var(--font-hand-jp);
  font-size: 12px;
  color: var(--ink-soft);
  background: rgba(255,255,255,0.4);
}
.chip.red { border-color: var(--accent-red); color: var(--accent-red); }
.chip.blue { border-color: var(--accent-blue); color: var(--accent-blue); }
.chip.green { border-color: var(--accent-green); color: var(--accent-green); }
.chip.amber { border-color: var(--accent-amber); color: var(--accent-amber); }

/* ============= 手書き下線・取り消し線 ============= */
.underline-wave {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6'><path d='M0 3 Q 7.5 0 15 3 T 30 3 T 45 3 T 60 3' fill='none' stroke='%23b94a3b' stroke-width='1.4'/></svg>");
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 60px 4px;
  padding-bottom: 4px;
}
.strike {
  text-decoration: line-through;
  text-decoration-color: var(--accent-red);
  text-decoration-thickness: 1.5px;
}
.caret-red {
  color: var(--accent-red);
  font-family: var(--font-hand);
  font-weight: 700;
}
.insert-blue {
  color: var(--accent-blue);
  font-family: var(--font-hand);
  font-weight: 600;
  background: rgba(47,93,138,0.07);
  padding: 0 3px;
  border-radius: 3px;
}

/* ============= 注釈の手書き枠 ============= */
.annot {
  border: 1.5px solid var(--ink);
  border-radius: 12px 22px 14px 26px / 18px 14px 22px 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.55);
  font-family: var(--font-hand-jp);
  font-size: 13px;
  position: relative;
}
.annot.red { border-color: var(--accent-red); }
.annot.blue { border-color: var(--accent-blue); }
.annot.green { border-color: var(--accent-green); }
.annot.amber { border-color: var(--accent-amber); }

/* タブ */
.tab {
  font-family: var(--font-hand-jp);
  font-size: 13px;
  padding: 6px 14px;
  border: 1px solid var(--ink-faint);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--paper-2);
  color: var(--ink-soft);
  cursor: pointer;
}
.tab.active {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink);
  font-weight: 700;
}

/* セレクト風（手書き） */
.select-hand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  font-family: var(--font-hand-jp);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* スコアの数字 */
.score-num {
  font-family: var(--font-hand);
  font-weight: 700;
  line-height: 1;
}

/* テキストエリア風 */
.textarea-hand {
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-hand);
  font-size: 16px;
  line-height: 28px;
  color: var(--ink);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 27px,
      var(--rule-soft) 27px,
      var(--rule-soft) 28px
    );
  background-position: 0 4px;
}

/* スクロールヒント矢印 */
.arrow-down::after {
  content: "▼";
  font-size: 8px;
  color: var(--ink-faint);
  margin-left: 6px;
}

/* SVG レーダー用 */
.radar-grid {
  fill: none;
  stroke: var(--rule);
  stroke-width: 0.8;
}
.radar-axis {
  stroke: var(--ink-faint);
  stroke-width: 0.6;
  stroke-dasharray: 2 2;
}
.radar-area {
  fill: rgba(47,93,138,0.18);
  stroke: var(--accent-blue);
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.radar-target {
  fill: none;
  stroke: var(--accent-red);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
}

/* placeholder image */
.ph {
  background:
    repeating-linear-gradient(
      45deg,
      var(--paper-2),
      var(--paper-2) 8px,
      var(--rule-soft) 8px,
      var(--rule-soft) 9px
    );
  border: 1px dashed var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* dotted divider */
.divider-dot {
  border-top: 1px dashed var(--ink-faint);
  height: 0;
  margin: 12px 0;
}

/* バーグラフ */
.bar-track {
  height: 6px;
  background: var(--rule-soft);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.bar-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
}

/* テープ */
.tape {
  position: absolute;
  width: 70px;
  height: 18px;
  background: rgba(218, 196, 138, 0.55);
  border-left: 1px solid rgba(0,0,0,0.05);
  border-right: 1px solid rgba(0,0,0,0.05);
  transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* hover suppress for wireframe-feel */
.btn:hover, .tab:hover, .chip:hover, .select-hand:hover {
  background-color: rgba(0,0,0,0.03);
}
.btn.primary:hover { background-color: #1a1612; }
