/* 闪念 /memo/ —— 暖色编辑风，与主题一致 */
.gm-memo { max-width: 1080px; margin: 0 auto; padding: 48px 20px 80px; }
.gm-writing-switch { display: inline-flex; padding: 3px; background: #eeeae2; border-radius: 999px; margin-bottom: 24px; }
.gm-writing-switch a { padding: 7px 18px; border-radius: 999px; color: #777168; text-decoration: none; font-size: 13px; }
.gm-writing-switch a.is-active { background: #fff; color: #24211d; box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.gm-memo__head { margin-bottom: 22px; }
.gm-memo__kicker { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: #c98237; margin: 0 0 6px; }
.gm-memo__head h1 { margin: 0 0 8px; color: #244f6d; }
.gm-memo__sub { color: #6b6257; margin: 0 0 12px; font-size: 14px; }
.gm-memo__sub code { background: #f0e9dc; padding: 1px 6px; border-radius: 5px; font-size: 13px; color: #b06f2b; }
.gm-memo__stats { display: flex; gap: 18px; align-items: center; font-size: 14px; color: #6b6257; flex-wrap: wrap; }
.gm-memo__stats strong { color: #244f6d; font-size: 18px; }
.gm-memo__review-btn { background: none; border: 1px solid #d5c9b4; border-radius: 8px; padding: 6px 14px; color: #6b6257; cursor: pointer; font-size: 13px; }
.gm-memo__review-btn:hover { border-color: #c98237; color: #c98237; }

/* 快速捕捉 */
.gm-memo__capture { margin-bottom: 26px; }
.gm-memo__capture textarea {
	width: 100%; box-sizing: border-box;
	padding: 14px 16px; border: 1px solid #d5c9b4; border-radius: 12px;
	background: #fffdf8; font-size: 16px; line-height: 1.7; resize: vertical; color: #2f2a23; font-family: inherit;
}
.gm-memo__capture textarea:focus { outline: 2px solid rgba(201,130,55,0.3); border-color: #c98237; }
.gm-memo__capture-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.gm-memo__capture-hint { font-size: 13px; color: #6a8f5f; margin-right: auto; }
.gm-memo__capture-bar button {
	background: #244f6d; color: #f7f3eb; border: none; border-radius: 9px; padding: 9px 22px; font-size: 15px; cursor: pointer;
}
.gm-memo__capture-bar button:disabled { opacity: 0.55; }

/* 两栏 */
.gm-memo__wrap { display: flex; gap: 24px; align-items: flex-start; }
.gm-memo__side { flex: 0 0 220px; position: sticky; top: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.gm-memo__stream { flex: 1; min-width: 0; }

/* 热力图 */
.gm-memo__heat { margin-bottom: 22px; }
.gm-memo__heat-grid { display: grid; grid-template-columns: repeat(19, 1fr); grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.gm-memo__heat-cell { width: 100%; aspect-ratio: 1; border-radius: 2px; background: #ece4d5; }
.gm-memo__heat-cell[data-lvl="1"] { background: #e6cfa8; }
.gm-memo__heat-cell[data-lvl="2"] { background: #d9a86a; }
.gm-memo__heat-cell[data-lvl="3"] { background: #c98237; }
.gm-memo__heat-cell[data-lvl="4"] { background: #a5651f; }
.gm-memo__heat-legend { font-size: 11px; color: #9a8f7d; margin: 8px 0 0; }

/* 标签树 */
.gm-memo__tags { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.gm-memo__tags h2 { font-size: 14px; color: #244f6d; margin: 0 0 10px; position: sticky; top: 0; background: #f7f3eb; padding-bottom: 4px; }
.gm-memo__tags ul { list-style: none; margin: 0; padding: 0; }
.gm-memo__tags a { display: flex; justify-content: space-between; text-decoration: none; color: #6b6257; font-size: 14px; padding: 5px 8px; border-radius: 7px; }
.gm-memo__tags a span { color: #9a8f7d; font-size: 12px; }
.gm-memo__tags a:hover { background: #f0e9dc; color: #244f6d; }
.gm-memo__tags a.is-active { background: #244f6d; color: #f7f3eb; }
.gm-memo__tags a.is-active span { color: #cddbe6; }
.gm-memo__subtags { padding-left: 12px !important; border-left: 1px solid #e2d8c6; margin: 2px 0 6px 8px !important; }
.gm-memo__subtags a { font-size: 13px; }

/* 闪念流 */
.gm-memo__search { margin-bottom: 12px; }
.gm-memo__search-input {
	width: 100%; box-sizing: border-box;
	padding: 10px 14px; border: 1px solid #d5c9b4; border-radius: 10px;
	background: #fffdf8; font-size: 15px; color: #2f2a23; font-family: inherit;
}
.gm-memo__search-input:focus { outline: 2px solid rgba(201,130,55,0.3); border-color: #c98237; }
.gm-memo__hit { background: #ffe6a8; color: inherit; border-radius: 3px; padding: 0 1px; }
.gm-memo__stream-head { font-size: 13px; color: #9a8f7d; margin-bottom: 10px; min-height: 16px; }
.gm-memo__list { display: flex; flex-direction: column; gap: 12px; }
.gm-memo__card { background: #fffdf8; border: 1px solid #e2d8c6; border-radius: 12px; padding: 14px 16px; }
.gm-memo__card-date { font-size: 12px; color: #9a8f7d; margin-bottom: 6px; }
.gm-memo__card-body { font-size: 15px; line-height: 1.8; color: #2f2a23; white-space: normal; word-break: break-word; }
.gm-memo__img { max-width: 100%; border-radius: 8px; margin: 8px 0; border: 1px solid #e6ddcc; }
.gm-memo__tag { color: #c98237; text-decoration: none; }
.gm-memo__tag:hover { text-decoration: underline; }
/* 延展（带时间戳的追加想法，累积不改原文） */
.gm-memo__extends:not(:empty) { margin-top: 10px; padding-left: 12px; border-left: 2px solid #e6cfa8; display: flex; flex-direction: column; gap: 8px; }
.gm-memo__ext { position: relative; }
.gm-memo__ext::before { content: "↳"; position: absolute; left: -14px; top: 0; color: #c98237; font-size: 12px; }
.gm-memo__ext time { display: block; font-size: 11px; color: #9a8f7d; margin-bottom: 2px; }
.gm-memo__ext > div { font-size: 14px; line-height: 1.7; color: #4a4237; }
.gm-memo__ext > [data-extend-edit] { background: none; border: 0; color: #9a8f7d; cursor: pointer; font-size: 11px; padding: 2px 0; }
.gm-memo__ext > [data-extend-edit]:hover { color: #c98237; }
.gm-memo__ext-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.gm-memo__ext-edit textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #c98237; border-radius: 8px; background: #fffdf8; color: #2f2a23; font: inherit; line-height: 1.6; resize: vertical; }
.gm-memo__ext-edit > div { display: flex; gap: 8px; }
.gm-memo__ext-edit button { border: 0; border-radius: 6px; padding: 4px 11px; cursor: pointer; font-size: 12px; }
.gm-memo__ext-edit [data-extend-edit-save] { background: #244f6d; color: #fffdf8; }
.gm-memo__ext-edit [data-extend-edit-cancel] { background: #eee4d3; color: #6b6257; }
.gm-memo__ext-add { margin-top: 8px; }
.gm-memo__ext-add > button { background: none; border: none; color: #9a8f7d; font-size: 12px; cursor: pointer; padding: 2px 0; }
.gm-memo__ext-add > button:hover { color: #c98237; }
.gm-memo__ext-form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.gm-memo__ext-form[hidden] { display: none; }
.gm-memo__ext-form textarea { padding: 8px 10px; border: 1px solid #d5c9b4; border-radius: 8px; background: #fffdf8; font-size: 14px; line-height: 1.6; font-family: inherit; resize: vertical; color: #2f2a23; }
.gm-memo__ext-form textarea:focus { outline: 2px solid rgba(201,130,55,0.3); border-color: #c98237; }
.gm-memo__ext-form button { align-self: flex-start; background: #c98237; color: #fffdf8; border: none; border-radius: 7px; padding: 5px 14px; font-size: 13px; cursor: pointer; }
.gm-memo__ext-form button:disabled { opacity: 0.55; }

.gm-memo__card-acts { display: flex; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e2d8c6; }
.gm-memo__card-acts button { background: none; border: none; color: #9a8f7d; font-size: 12px; cursor: pointer; padding: 2px 4px; }
.gm-memo__card-acts button:hover { color: #c98237; }
.gm-memo__edit { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #c98237; border-radius: 8px; font-size: 15px; line-height: 1.7; font-family: inherit; margin: 4px 0; resize: vertical; }
.gm-memo__edit-save { background: #244f6d; color: #f7f3eb; border: none; border-radius: 7px; padding: 6px 16px; font-size: 13px; cursor: pointer; }
.gm-memo__more { margin: 18px auto 0; display: block; background: none; border: 1px solid #d5c9b4; border-radius: 9px; padding: 8px 22px; color: #6b6257; cursor: pointer; font-size: 14px; }
.gm-memo__more:hover { border-color: #c98237; color: #c98237; }
.gm-memo__empty { color: #9a8f7d; font-size: 14px; text-align: center; padding: 24px 0; }

/* 每日回顾弹框 */
.gm-memo__modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gm-memo__modal[hidden] { display: none; }
.gm-memo__modal-backdrop { position: absolute; inset: 0; background: rgba(40,34,26,0.55); backdrop-filter: blur(2px); }
.gm-memo__modal-box { position: relative; width: min(620px, 100%); max-height: 84vh; display: flex; flex-direction: column; background: #fffdf8; border: 1px solid #e2d8c6; border-radius: 14px; box-shadow: 0 24px 60px rgba(36,79,109,0.28); overflow: hidden; }
.gm-memo__modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #eee4d3; font-size: 14px; color: #244f6d; font-weight: 600; }
.gm-memo__modal-head button { background: none; border: none; color: #9a8f7d; cursor: pointer; font-size: 13px; margin-left: 10px; }
.gm-memo__modal-head button:hover { color: #c98237; }
.gm-memo__modal-body { overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.gm-memo__review-card { background: #faf6ee; border: 1px solid #eee4d3; border-radius: 10px; padding: 12px 14px; font-size: 15px; line-height: 1.8; color: #2f2a23; }

/* 语义漫步 */
.gm-memo__walk-box { width: min(680px, 100%); }
.gm-memo__modal-head em { font-style: normal; font-weight: 400; font-size: 11px; color: #9a8f7d; margin-left: 8px; }
.gm-memo__walk-center { background: #fdf6ea; border: 1px solid #e6cfa8; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.gm-memo__walk-c-label { display: inline-block; font-size: 11px; color: #b06f2b; background: #f3e2c8; border-radius: 999px; padding: 1px 9px; margin-bottom: 6px; }
.gm-memo__walk-rel-head { font-size: 12px; color: #9a8f7d; margin-bottom: 10px; }
.gm-memo__walk-rel { display: flex; flex-direction: column; gap: 10px; }
.gm-memo__walk-rel-card { background: #fffdf8; border: 1px solid #e2d8c6; border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.gm-memo__walk-rel-card:hover { border-color: #c98237; box-shadow: 0 2px 10px rgba(201,130,55,0.12); }
.gm-memo__walk-rel-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.gm-memo__walk-score { font-size: 12px; color: #6a8f5f; font-weight: 600; }
.gm-memo__walk-rel-card .gm-memo__card-body { font-size: 14px; color: #4a4237; line-height: 1.7; max-height: 5.1em; overflow: hidden; }

@media (max-width: 820px) {
	.gm-memo__wrap { flex-direction: column; }
	/* 笔记优先：流在上，标签/热力图折到笔记下面 */
	.gm-memo__stream { order: 1; }
	.gm-memo__side { order: 2; position: static; width: 100%; flex: none; max-height: none; }
	.gm-memo__tags { max-height: 240px; }
	.gm-memo__heat-grid { grid-template-columns: repeat(19, 1fr); }

	/* ★ iOS 聚焦自动放大且不缩回的根治：输入框字号 <16px 会触发 Safari 自动 zoom。
	   全部表单控件统一 16px，聚焦不再放大，界面不会“拉大回不去”。 */
	.gm-memo input,
	.gm-memo textarea,
	.gm-memo select { font-size: 16px !important; }

	/* 滚动顺滑（iOS 惯性滚动）+ 彻底根治横向溢出（"拉大不回缩"的真凶）*/
	.gm-memo__tags,
	.gm-memo__modal-body { -webkit-overflow-scrolling: touch; }
	html, body { overflow-x: hidden; max-width: 100%; }
	.gm-memo, .gm-memo * { box-sizing: border-box; }
	.gm-memo { max-width: 100%; overflow-x: hidden; }
	.gm-memo__wrap, .gm-memo__side, .gm-memo__stream { min-width: 0; max-width: 100%; }
	.gm-memo__heat { overflow-x: auto; }
	.gm-memo__card-body { overflow-wrap: anywhere; }

	/* 触控目标加大，点起来不憋屈 */
	.gm-memo__card-acts button { padding: 8px 10px; font-size: 13px; }
	.gm-memo__ext-add > button { padding: 8px 0; font-size: 13px; }

	/* 漫步弹框占满小屏 */
	.gm-memo__modal { padding: 8px; }
	.gm-memo__modal-box { max-height: 94vh; width: 100%; }
}

/* ---------- 游客只读模式（2026-07-20 吉光片羽公开）：隐藏一切写入口，读/漫步保留 ---------- */
.gm-memo--readonly .gm-memo__capture,
.gm-memo--readonly [data-edit],
.gm-memo--readonly [data-del],
.gm-memo--readonly [data-extend-open],
.gm-memo--readonly [data-extend-edit],
.gm-memo--readonly .gm-memo__ext-form,
.gm-memo--readonly .gm-memo__ext-add {
	display: none !important;
}
