/* 成长陪伴 v3.1 · 独立品牌（蓝绿系） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #eef2f0; font-family: "PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif; color: #2c3e35; }
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; background: #fff; position: relative; padding-bottom: 76px; }
.view { padding: 14px 16px 20px; }
.hidden { display: none !important; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 6px 0 12px; }
.tb-title { font-size: 16px; font-weight: 500; }
.tb-sub { font-size: 12px; color: #0f6e56; background: #e1f5ee; border-radius: 999px; padding: 3px 10px; }
.tb-back { font-size: 18px; cursor: pointer; color: #0f6e56; }
.icon-btn { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid #cfe0d8; background: #fff; color: #0f6e56; border-radius: 8px; font-size: 22px; line-height: 1; cursor: pointer; }
.history-btn { margin-left: auto; border: 0; background: none; color: #0f6e56; font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; padding: 8px 2px; }
.brand { text-align: center; padding: 40px 0 20px; }
.logo { width: 56px; height: 56px; border-radius: 16px; background: #0f6e56; color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.brand h1 { font-size: 20px; font-weight: 500; }
.brand p { font-size: 13px; color: #5f6f66; margin-top: 6px; }
.field { width: 100%; padding: 12px; border: 1px solid #cfe0d8; border-radius: 10px; font-size: 14px; margin-bottom: 12px; font-family: inherit; }
textarea.field { resize: vertical; }
textarea.field.auto-grow { min-height: 46px; overflow: hidden; resize: none; line-height: 1.5; }
.field:focus { outline: none; border-color: #0f6e56; }
.btn { width: 100%; padding: 13px; border: none; border-radius: 10px; font-size: 15px; cursor: pointer; margin-bottom: 10px; }
.btn.primary { background: #0f6e56; color: #fff; }
.btn.outline { background: #fff; border: 1px solid #0f6e56; color: #0f6e56; }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; margin: 4px 6px 4px 0; background: #e1f5ee; color: #0f6e56; border: none; border-radius: 8px; cursor: pointer; }
.btn:disabled { opacity: .55; cursor: wait; }
.hint { font-size: 12px; color: #8a9790; text-align: center; margin-top: 12px; }
.muted { font-size: 13px; color: #5f6f66; line-height: 1.6; }
.strong { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.card { border: 1px solid #e2eae6; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.lbl { font-size: 12px; color: #5f6f66; margin-bottom: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.role-btn { flex: 1; padding: 10px; border: 1px solid #cfe0d8; border-radius: 10px; background: #fff; color: #3a4a41; font-size: 14px; cursor: pointer; }
.role-btn.on { background: #0f6e56; border-color: #0f6e56; color: #fff; }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.safety-note { font-size: 12px; line-height: 1.55; color: #7a3e00; background: #fff7e6; border: 1px solid #f0cf8c; padding: 9px 11px; border-radius: 8px; margin-bottom: 10px; }
.risk-card { color: #8f1d1d; background: #fff1f1; border: 1px solid #e7aaaa; border-left: 4px solid #b42318; padding: 12px; border-radius: 6px; margin-bottom: 10px; font-size: 13px; line-height: 1.6; }
.risk-card strong { display: block; font-size: 14px; margin-bottom: 4px; }
.msg { max-width: 90%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: #0f6e56; color: #fff; border-bottom-right-radius: 4px; }
.msg.user.other-parent { background: #e4ebe7; color: #2c3e35; }
.msg.ai { align-self: flex-start; background: #f2f7f4; border: 1px solid #e2eae6; border-bottom-left-radius: 4px; }
.msg.pending { color: #5f6f66; animation: qa-pulse 1.15s ease-in-out infinite; }
.msg .who { font-size: 11px; color: #8a9790; margin-bottom: 4px; }
@keyframes qa-pulse { 0%, 100% { opacity: .62; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .msg.pending { animation: none; } }
.inputbar { display: flex; align-items: flex-end; gap: 8px; position: sticky; bottom: 0; background: #fff; padding: 10px 0 4px; }
.inputbar .field { margin-bottom: 0; flex: 1; }
.inputbar .btn { width: auto; padding: 12px 16px; margin: 0; }
.qa-watch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qa-watch-actions .btn { margin: 0; }
.qa-watch-actions .qa-watch-skip { background: #fff; border: 1px solid #cfe0d8; color: #5f6f66; }
.qa-context { font-size: 12px; color: #0f6e56; background: #eef8f4; border-left: 3px solid #0f6e56; padding: 8px 10px; margin-bottom: 10px; }
.qa-share-note { margin-bottom: 10px; }
.qa-share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-share-actions .btn { width: 100%; margin: 0; min-height: 40px; }
.qa-share-actions .btn.on { background: #0f6e56; color: #fff; }
.qa-share-actions .qa-private { background: #fff; border: 1px solid #cfe0d8; color: #5f6f66; }
.qa-share-actions .qa-private.on { background: #e4ebe7; border-color: #7e9187; color: #2c3e35; }
.qa-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.text-btn { border: 0; background: none; color: #0f6e56; font: inherit; font-size: 13px; padding: 7px 0; cursor: pointer; }
.history-item { display: block; width: 100%; border: 1px solid #e2eae6; border-radius: 8px; background: #fff; color: inherit; padding: 12px; margin-bottom: 9px; text-align: left; font: inherit; cursor: pointer; }
.history-item:active { background: #f7faf8; }
.history-title { display: block; font-size: 14px; font-weight: 500; line-height: 1.45; margin-bottom: 5px; }
.history-meta { display: block; color: #718078; font-size: 11px; line-height: 1.5; }
.history-preview { color: #5f6f66; font-size: 12px; line-height: 1.5; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.manage-btn { border: 1px solid #0f6e56; background: #fff; color: #0f6e56; font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 16px; cursor: pointer; margin-left: auto; }
.manage-btn:active { background: #eaf5f1; }
.qa-search-wrap { margin-bottom: 10px; }
.qa-search { width: 100%; box-sizing: border-box; }
.qa-manage-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #f1f6f4; border: 1px solid #e2eae6; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
.qa-manage-bar .chk-all { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.qa-manage-bar .btn.small { padding: 5px 12px; }
.btn.small.danger { background: #d9534f; border-color: #d9534f; color: #fff; }
.btn.small.danger:active { background: #c9302c; }
.history-item.manage { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.history-item.manage .qa-chk { margin-top: 3px; width: 16px; height: 16px; flex: 0 0 auto; }
.history-item.manage .history-title, .history-item.manage .history-meta, .history-item.manage .history-preview { flex: 1 1 auto; }
.history-item.selected { border-color: #0f6e56; background: #eaf5f1; }
.qa-detail-head { padding: 8px 0 12px; border-bottom: 1px solid #e2eae6; margin-bottom: 10px; }
.qa-detail-head h2 { font-size: 17px; line-height: 1.45; font-weight: 500; margin-bottom: 5px; }
.qa-detail-share { padding: 10px 0 12px; border-bottom: 1px solid #e2eae6; }
.qa-detail-thread { padding: 14px 0; }
.visibility-mark { display: inline-block; color: #0f6e56; background: #e1f5ee; padding: 5px 9px; border-radius: 6px; font-size: 12px; }
.filters { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border: 1px solid #cfe0d8; border-radius: 999px; background: #fff; font-size: 13px; color: #3a4a41; cursor: pointer; }
.chip.on { background: #0f6e56; color: #fff; border-color: #0f6e56; }
.fu-item { border-left: 3px solid #0f6e56; padding: 8px 12px; background: #f2f7f4; border-radius: 8px; margin-bottom: 8px; font-size: 13px; cursor: pointer; }
.fu-item .who { font-size: 11px; color: #8a9790; }
.w-item { border: 1px solid #e2eae6; border-radius: 14px; padding: 14px; margin-bottom: 10px; cursor: pointer; }
.w-item:active { background: #f7faf8; }
.wi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wi-title { font-size: 15px; font-weight: 500; }
.wi-sub { font-size: 12px; color: #8a9790; margin-top: 4px; }
.wi-stale { color: #a32d2d; font-weight: 600; }
.st { font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.st-pending { background: #faeeda; color: #854f0b; }
.st-executing { background: #e6f1fb; color: #185fa5; }
.st-resolved { background: #eaf3de; color: #3b6d11; }
.st-invalid { background: #fcebeb; color: #a32d2d; }
.st-shelved { background: #f1efe8; color: #5f5e5a; }
.st-ignore { background: #eef2f0; color: #5f6f66; }
.note-item { font-size: 12px; padding: 6px 10px; background: #f7faf8; border-radius: 8px; margin-bottom: 6px; }
.ah-item { border: 1px solid #e2eae6; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.ah-head { font-size: 12px; color: #0f6e56; margin-bottom: 6px; }
.ah-body { font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; display: flex; background: #fff; border-top: 1px solid #e2eae6; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.tab { flex: 1; border: none; background: none; font-size: 12px; color: #8a9790; padding: 6px 0; cursor: pointer; }
.tab.on { color: #0f6e56; font-weight: 500; }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #2c3e35; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 99; max-width: 80%; text-align: center; }
.rv-item { border: 1px solid #e2eae6; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.rv-period { font-size: 13px; font-weight: 500; color: #0f6e56; margin-bottom: 8px; }
.rv-item p { font-size: 13px; line-height: 1.65; margin-bottom: 4px; }
.questionnaire-entry .btn { margin-top: 12px; margin-bottom: 0; }
.q-status-line { margin-top: 8px; }
.q-progress { display: flex; justify-content: space-between; gap: 8px; color: #0f6e56; font-size: 12px; margin: 4px 0 7px; }
.q-track { height: 7px; background: #e8efeb; border-radius: 4px; overflow: hidden; margin-bottom: 22px; }
.q-track > div { height: 100%; width: 0; background: #0f6e56; transition: width .2s ease; }
.q-question { font-size: 17px; line-height: 1.65; font-weight: 500; margin-bottom: 8px; }
.q-rephrase { border: 0; background: none; color: #0f6e56; padding: 3px 0; font: inherit; font-size: 13px; cursor: pointer; }
.q-rephrase:disabled { color: #8a9790; cursor: wait; }
.q-options { display: grid; gap: 8px; margin: 16px 0 12px; }
.q-option { width: 100%; min-height: 46px; padding: 10px 12px; text-align: left; background: #fff; color: #2c3e35; border: 1px solid #cfe0d8; border-radius: 8px; font: inherit; line-height: 1.45; cursor: pointer; }
.q-option.on { border-color: #0f6e56; background: #e8f5f0; box-shadow: inset 3px 0 #0f6e56; }
#q-custom.custom-answer { border-color: #0f6e56; background: #f4faf7; }
.q-custom-analysis { background: #f2f7f4; border-left: 3px solid #0f6e56; padding: 10px 12px; border-radius: 6px; margin: -2px 0 12px; font-size: 13px; line-height: 1.6; }
.q-custom-analysis .q-clarify { color: #854f0b; margin-top: 5px; }
.q-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.q-actions .btn { margin-bottom: 0; }
.q-summary-section { padding: 14px 0; border-bottom: 1px solid #e2eae6; }
.q-summary-section:last-child { border-bottom: 0; }
.q-summary-section h3 { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.q-summary-section p, .q-summary-section li { font-size: 13px; line-height: 1.65; }
.q-summary-section ul { padding-left: 20px; }
.q-diff { background: #f7faf8; padding: 10px; border-radius: 8px; margin-bottom: 8px; }

@media (max-width: 360px) {
  .view { padding-left: 12px; padding-right: 12px; }
  .tab { font-size: 11px; }
  .btn.small { padding: 8px 10px; }
}
