:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #272c29;
  background: #e9ece7;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, textarea { font: inherit; }
button { cursor: pointer; }

#app {
  min-height: 100vh;
  padding: 22px 16px;
  display: grid;
  place-items: start center;
}

.phone {
  width: min(100%, 430px);
  height: min(820px, calc(100vh - 44px));
  min-height: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 22px 70px rgba(36, 48, 40, .17);
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: #737b76; }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }

/* 一对一今日助手，并包含个人药材仓。 */
.app-shell { display: flex; flex-direction: column; background: #eef1f1; border-radius: 18px; }
.b-header { padding: 25px 20px 19px; color: #fff; background: #173a40; }
.b-header h1 { margin: 22px 0 5px; font-size: 25px; }
.b-header p { margin: 0; color: #a9c2c1; font-size: 13px; }
.b-main { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; }
.b-alert { padding: 14px; color: #663c26; background: #fff1e7; border-left: 4px solid #e87942; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.b-focus { width: 100%; display: grid; grid-template-columns: 45px 1fr auto; gap: 12px; align-items: center; padding: 18px 14px; border: 0; border-radius: 14px; color: #fff; background: #d86c3f; text-align: left; }
.b-focus-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 25px; }
.b-focus b, .b-focus small { display: block; }
.b-focus b { font-size: 16px; }
.b-focus small { margin-top: 6px; color: rgba(255,255,255,.78); line-height: 1.45; }
.b-focus + .b-alert { margin-top: 12px; }
.b-title { margin: 22px 0 10px; font-size: 15px; }
.b-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.b-person { min-height: 135px; padding: 14px; border: 1px solid #dfe5e4; border-radius: 12px; background: #fff; }
.b-person.wide { grid-column: 1 / -1; min-height: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.b-person h3 { margin: 20px 0 4px; font-size: 16px; }
.b-person.wide h3 { margin: 0 0 3px; }
.b-person p { margin: 0; font-size: 12px; color: #6c7675; }
.b-face { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #56817f; }
.b-dot { width: 8px; height: 8px; display: inline-block; margin-right: 5px; border-radius: 50%; background: #d29a42; }
.b-actions { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 9px; }
.b-action { min-height: 76px; padding: 12px; border: 0; border-radius: 12px; text-align: left; background: #dde8e7; color: #1c494a; }
.b-action.primary { color: #fff; background: #d86c3f; }
.b-action span { display: block; font-size: 20px; margin-bottom: 8px; }
.b-record { padding: 13px 0; display: grid; grid-template-columns: 66px 1fr; gap: 10px; border-bottom: 1px solid #d8dfde; font-size: 13px; }
.b-record time { color: #73807f; }
.b-bottom { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); padding: 12px 8px 18px; background: #fff; border-top: 1px solid #e5e9e8; }
.b-bottom button { border: 0; color: #76817f; background: transparent; font-size: 11px; }
.b-bottom button.active { color: #1f5554; font-weight: 700; }

/* 望闻问切分步问询 */
.consultation-page { background: #f4f1e9; }
.consult-header { padding: 18px 18px 21px; color: #fff; background: #274f43; }
.consult-header .eyebrow { display: block; margin-top: 18px; }
.consult-header h1 { margin: 9px 0 7px; font-size: 24px; }
.consult-header p { margin: 0; color: #c5d4cf; font-size: 12px; line-height: 1.6; }
.consult-main { flex: 1; min-height: 0; overflow-y: auto; padding: 17px; }
.consult-progress { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-bottom: 20px; }
.consult-progress span { padding: 8px 2px; border-radius: 8px; color: #818884; background: #e0e2de; text-align: center; font-size: 9px; }
.consult-progress span.active { color: #fff; background: #456d61; font-weight: 700; }
.consult-safety { margin-bottom: 12px; padding: 13px; border-radius: 11px; color: #31594c; background: #e3eee7; }
.consult-safety b { font-size: 13px; }
.consult-safety p { margin: 5px 0 0; color: #68756f; font-size: 10px; line-height: 1.55; }
.consult-options { display: grid; gap: 10px; }
.consult-options button { display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid #d9ddd8; border-radius: 12px; color: #27302c; background: #fff; text-align: left; }
.consult-options button.selected { border-color: #456d61; background: #e3eee7; }
.consult-options button.danger { color: #93473d; }
.consult-options button.none { margin-top: 2px; color: #31594c; }
.consult-check { width: 21px; height: 21px; flex: none; display: grid; place-items: center; border: 1px solid #b8c0bc; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 800; }
.consult-options button.selected .consult-check { border-color: #456d61; background: #456d61; }
.consult-main textarea { width: 100%; min-height: 210px; padding: 14px; resize: none; border: 1px solid #d9ddd8; border-radius: 13px; outline: 0; color: #272c29; background: #fff; line-height: 1.6; }
.consult-actions { display: flex; gap: 10px; margin-top: 18px; }
.consult-actions button { flex: 1; padding: 13px; border: 1px solid #456d61; border-radius: 12px; color: #456d61; background: transparent; }
.consult-actions button.primary { color: #fff; background: #456d61; }
.consult-actions button:disabled { opacity: .35; cursor: default; }
.consult-emergency { padding: 16px; border-left: 4px solid #b64b3f; border-radius: 10px; color: #743d35; background: #fde6e2; }
.consult-emergency b { font-size: 17px; }
.consult-emergency p { margin: 8px 0 0; font-size: 12px; line-height: 1.65; }
.consult-summary { display: grid; gap: 9px; }
.consult-summary article { display: grid; grid-template-columns: 36px 1fr; gap: 11px; padding: 13px; border: 1px solid #dfe3df; border-radius: 12px; background: #fff; }
.consult-summary article > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #456d61; font-weight: 700; }
.consult-summary b { font-size: 13px; }
.consult-summary p { margin: 5px 0 0; color: #747d78; font-size: 11px; line-height: 1.55; }
.consult-boundary { margin-top: 12px; padding: 12px; border-radius: 9px; color: #75442e; background: #fff1e7; font-size: 11px; line-height: 1.55; }

/* 药材仓与药材详情 */
.warehouse { background: #f2f0e9; }
.warehouse-header { padding: 20px 18px 28px; color: #f7f3e8; background: #274f43; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #274f43; background: #edf1ec; }
.icon-button.light { color: #fff; background: rgba(255,255,255,.14); }
.warehouse-header .eyebrow { display: block; margin-top: 26px; }
.warehouse-header h1 { margin: 7px 0 6px; font: 500 32px "Songti SC", serif; }
.warehouse-header p { width: 85%; margin: 0; color: #bdcfca; font-size: 13px; line-height: 1.55; }
.warehouse-main { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 17px 20px; }
.warehouse-stats { margin-top: 0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px 8px; border-radius: 12px; background: #fff; box-shadow: 0 10px 25px rgba(47,63,56,.08); }
.warehouse-stats div { padding: 0 9px; border-right: 1px solid #e5e2d8; }
.warehouse-stats div:last-child { border-right: 0; }
.warehouse-stats b, .warehouse-stats span { display: block; }
.warehouse-stats b { font-size: 15px; }
.warehouse-stats span { margin-top: 4px; color: #7f827c; font-size: 10px; }
.warehouse-search { margin-top: 15px; display: flex; gap: 8px; align-items: center; padding: 11px 13px; border: 1px solid #dedbd1; border-radius: 10px; background: rgba(255,255,255,.7); }
.warehouse-search input { flex: 1; border: 0; outline: 0; background: transparent; }
.filter-row { display: flex; gap: 8px; margin: 12px 0; }
.filter-row button { padding: 7px 11px; border: 1px solid #d9d5ca; border-radius: 999px; color: #70736e; background: transparent; font-size: 11px; }
.filter-row button.active { color: #fff; border-color: #456d61; background: #456d61; }
.warehouse-title { margin: 20px 0 9px; }
.warehouse-title h2 { margin: 0; font-size: 15px; }
.warehouse-title span { color: #8b8c87; font-size: 10px; }
.herb-list { display: grid; gap: 9px; }
.herb-card { width: 100%; display: grid; grid-template-columns: 45px 1fr auto; gap: 11px; align-items: center; padding: 13px; border: 1px solid #e2ded3; border-radius: 11px; color: #272c29; background: #fff; text-align: left; }
.herb-seal { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 50% 50% 42% 58%; color: #f8f2e8; background: #9b6543; font: 600 19px "Songti SC", serif; }
.herb-card-copy b, .herb-card-copy small, .herb-card-copy em, .herb-stock b, .herb-stock small { display: block; }
.herb-card-copy b { font-size: 15px; }
.herb-card-copy small { margin-top: 3px; color: #747873; }
.herb-card-copy em { margin-top: 5px; color: #9a9c97; font-size: 10px; font-style: normal; }
.warehouse-empty { display: grid; place-items: center; gap: 6px; min-height: 128px; padding: 20px; border: 1px dashed #d5d4cd; border-radius: 12px; color: #68716d; background: rgba(255,255,255,.55); text-align: center; }
.warehouse-empty b { font-size: 13px; }
.warehouse-empty span { color: #91958f; font-size: 10px; }
.herb-stock { text-align: right; }
.herb-stock b { font-size: 12px; }
.herb-stock small { margin-top: 5px; color: #a66d39; font-size: 10px; }
.warehouse-add { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; margin: 11px 0 12px; padding: 11px 12px; border: 0; border-radius: 11px; color: #fff; background: #b76943; text-align: left; }
.warehouse-add > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 19px; }
.warehouse-add b, .warehouse-add small { display: block; }
.warehouse-add b { font-size: 12px; }
.warehouse-add small { margin-top: 3px; color: rgba(255,255,255,.8); font-size: 8px; }
.warehouse-add em { font-style: normal; }

.herb-new { background: #f5f2eb; }
.herb-new-header { padding: 15px 17px 17px; color: #eff5f2; background: #274f43; }
.herb-new-header .eyebrow { display: block; margin-top: 12px; font-size: 9px; }
.herb-new-header h1 { margin: 4px 0; font-size: 24px; }
.herb-new-header p { margin: 0; color: #b8ceca; font-size: 10px; line-height: 1.45; }
.herb-new-main { flex: 1; min-height: 0; overflow-y: auto; padding: 15px 17px 28px; }
.herb-new-form { display: grid; gap: 11px; }
.herb-form-section { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; color: #2e3934; }
.herb-form-section b { font-size: 14px; }
.herb-form-section span { color: #8d938f; font-size: 8px; }
.herb-new-form label { display: grid; gap: 5px; color: #6f7772; font-size: 9px; }
.herb-new-form input, .herb-new-form textarea, .herb-new-form select { width: 100%; padding: 11px; border: 1px solid #d9ddd8; border-radius: 9px; outline: 0; color: #272c29; background: #fff; font: inherit; }
.herb-new-form textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.herb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.herb-new-warning { padding: 10px; border-radius: 8px; color: #76452f; background: #fff1e7; font-size: 9px; line-height: 1.55; }
.herb-save { padding: 13px; border: 0; border-radius: 10px; color: #fff; background: #456d61; font-weight: 700; }

.herb-detail { background: #f4f1e9; }
.detail-hero { padding: 20px 18px 24px; color: #f9f6ef; background: #325a4e; }
.detail-herb-mark { width: 74px; height: 74px; margin: 22px 0 17px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.38); border-radius: 50% 50% 44% 56%; background: rgba(255,255,255,.08); font: 500 34px "Songti SC", serif; }
.detail-hero h1 { margin: 6px 0 3px; font: 500 34px "Songti SC", serif; }
.detail-hero > p { margin: 0; color: #c9d5d1; font-size: 12px; }
.detail-summary { display: grid; grid-template-columns: 1fr 1.6fr; margin-top: 21px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); }
.detail-summary div + div { padding-left: 15px; border-left: 1px solid rgba(255,255,255,.15); }
.detail-summary b, .detail-summary span { display: block; }
.detail-summary b { font-size: 13px; }
.detail-summary span { margin-top: 4px; color: #acc0ba; font-size: 10px; }
.detail-main { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 17px 34px; }
.detail-card { padding: 15px; border: 1px solid #ded9ce; border-radius: 12px; background: #fff; }
.detail-card h2 { margin: 0; font-size: 15px; }
.verified { padding: 5px 8px; border-radius: 99px; color: #3a6a54; background: #e3eee7; font-size: 10px; }
.detail-card dl { margin: 12px 0 0; }
.detail-card dl div { display: grid; grid-template-columns: 80px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid #eeeae2; font-size: 11px; }
.detail-card dt { color: #8b8c87; }
.detail-card dd { margin: 0; text-align: right; }
.expiry { margin: 10px 0 0; padding: 9px; border-radius: 7px; color: #765738; background: #f3e9d9; font-size: 10px; }
.detail-copy { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 18px 2px; border-bottom: 1px solid #ded9ce; }
.detail-index { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #879b92; border-radius: 50%; color: #45695b; font-size: 9px; }
.detail-copy h2 { margin: 2px 0 7px; font-size: 14px; }
.detail-copy p { margin: 0; color: #666b67; font-size: 11px; line-height: 1.65; }
.detail-copy.caution { margin: 0 -17px; padding: 18px 19px; border: 0; color: #6f402e; background: #f7e8df; }
.detail-copy.caution .detail-index { color: #b95c38; border-color: #c26c4b; }
.detail-copy.caution p { color: #765a4f; }
.detail-primary { width: 100%; margin-top: 18px; padding: 13px; border: 0; border-radius: 9px; color: #fff; background: #31594c; }
.detail-secondary { width: 100%; margin-top: 9px; padding: 12px; border: 1px solid #9fb1aa; border-radius: 9px; color: #31594c; background: transparent; }
.detail-disclaimer { margin: 8px 10px 0; color: #82837f; font-size: 10px; line-height: 1.5; text-align: center; }

/* 中医典籍库、书籍目录与方剂核对 */
.classics-library { background: #f1eee5; }
.classic-header { padding: 20px 18px 27px; color: #f8f1e1; background: #473b31; }
.classic-header .eyebrow { display: block; margin-top: 27px; }
.classic-header h1 { margin: 7px 0 7px; font: 500 31px "Songti SC", serif; }
.classic-header p { width: 88%; margin: 0; color: #cbbdac; font-size: 12px; line-height: 1.6; }
.classic-main { flex: 1; min-height: 0; overflow-y: auto; padding: 15px 17px 20px; }
.classic-section-title { margin: 20px 0 9px; }
.classic-section-title h2 { margin: 0; font-size: 15px; }
.classic-section-title span { color: #8e8a81; font-size: 10px; }
.classic-list { display: grid; gap: 10px; }
.classic-card { width: 100%; display: grid; grid-template-columns: 58px 1fr auto; gap: 13px; align-items: center; padding: 13px; border: 1px solid #ded8cc; border-radius: 10px; color: #2c2c29; background: #fffdf8; text-align: left; }
.classic-cover { width: 58px; height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #f5ead6; background: #6b4938; box-shadow: inset 4px 0 rgba(255,255,255,.08); }
.classic-cover i { font: 500 24px "Songti SC", serif; font-style: normal; }
.classic-cover small { margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.3); font-size: 8px; letter-spacing: .25em; }
.classic-copy b, .classic-copy small { display: block; }
.classic-copy b { font: 600 17px "Songti SC", serif; }
.classic-copy small { margin-top: 4px; color: #948b7e; font-size: 9px; }
.classic-copy p { margin: 8px 0 0; color: #6e6c66; font-size: 10px; line-height: 1.5; }
.classic-title-line { display: flex; align-items: center; gap: 7px; }
.classic-title-line i { padding: 3px 6px; border-radius: 99px; color: #386454; background: #e3eee8; font-size: 8px; font-style: normal; font-weight: 700; }
.classic-arrow { color: #9d968b; }
.recent-formula { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; gap: 11px; align-items: center; padding: 13px; border: 1px solid #ded8cc; border-radius: 9px; background: #fffdf8; text-align: left; }
.recent-formula > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #6c5546; }
.recent-formula b, .recent-formula small { display: block; }
.recent-formula small { margin-top: 4px; color: #8b857d; }
.recent-formula em { font-style: normal; }

.classic-book { background: #f6f2e9; }
.book-hero { display: grid; grid-template-columns: 92px 1fr; gap: 19px; padding: 20px 18px 24px; color: #f5ead8; background: #584437; }
.book-hero > .row { grid-column: 1 / -1; }
.book-cover-large { width: 92px; height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.3); background: #74513d; box-shadow: inset 6px 0 rgba(255,255,255,.07); }
.book-cover-large span { font: 500 38px "Songti SC", serif; }
.book-cover-large small { margin-top: 14px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.3); letter-spacing: .3em; }
.book-hero h1 { margin: 8px 0 7px; font: 500 28px "Songti SC", serif; }
.book-hero p { margin: 0; color: #cabcae; font-size: 10px; line-height: 1.6; }
.book-main { flex: 1; min-height: 0; overflow-y: auto; padding: 0 17px 35px; }
.version-bar { margin: -1px -17px 0; padding: 11px 17px; display: flex; justify-content: space-between; color: #71685f; background: #e9e1d4; font-size: 9px; }
.version-bar em { font-style: normal; }
.book-tabs { display: flex; gap: 20px; border-bottom: 1px solid #ded7ca; }
.book-tabs button { padding: 15px 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #817b73; font-size: 11px; }
.book-tabs button.active { color: #5a3d2d; border-color: #805440; font-weight: 700; }
.book-section { margin-top: 20px; }
.book-section h2 { margin: 0; font-size: 14px; }
.book-section .row > span { color: #8e887f; font-size: 9px; }
.chapter-row, .formula-row { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 12px 0; border: 0; border-bottom: 1px solid #e1dbd0; color: #393833; background: transparent; text-align: left; }
.chapter-row { text-decoration: none; }
.chapter-row > span { color: #9a7b68; font: 12px Georgia, serif; }
.chapter-row b { font: 500 13px "Songti SC", serif; }
.chapter-row em, .formula-row em { color: #99938b; font-style: normal; }
.formula-row > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #8b5c42; }
.formula-row b, .formula-row small { display: block; }
.formula-row b { font-size: 12px; }
.formula-row small { margin-top: 4px; color: #8c867d; font-size: 9px; }
.no-formula { margin-top: 10px; padding: 14px; display: grid; gap: 5px; color: #6e675e; background: #ebe4d8; font-size: 10px; }

.reader-page { background: #f7f2e8; }
.reader-header { padding: 18px 18px 22px; color: #f5ead8; background: #584437; }
.reader-header .row > span { color: #d3c5b6; font-size: 10px; }
.reader-header > small { display: block; margin-top: 24px; color: #cdbdaf; font-size: 10px; letter-spacing: .12em; }
.reader-header h1 { margin: 7px 0 0; font: 500 25px "Songti SC", serif; }
.reader-main { flex: 1; min-height: 0; overflow-y: auto; padding: 0 22px 30px; }
.reader-tools { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: 0 -22px; padding: 10px 22px; border-bottom: 1px solid #e2dacd; color: #82776d; background: rgba(247,242,232,.96); font-size: 10px; }
.reader-tools div { display: flex; gap: 7px; }
.reader-tools button { padding: 6px 9px; border: 1px solid #d6cbbc; border-radius: 8px; color: #654c3c; background: #fffaf1; }
.reader-tools button.reader-bookmark { color: #654c3c; border-color: transparent; background: transparent; }
.reader-tools button.reader-bookmark.active { color: #31594c; background: #e3eee7; }
.reader-article { padding: 20px 0; color: #302d29; font-family: "Songti SC", "Noto Serif SC", serif; line-height: 2; letter-spacing: .04em; }
.reader-article p { margin: 0 0 1.25em; text-indent: 2em; }
.reader-article.paged { min-height: 355px; }
.reader-swipe-surface { touch-action: pan-y; user-select: text; }
.reader-load-state { margin: 13px 0 0; padding: 8px 10px; border-radius: 8px; color: #6f756f; background: #ebe8df; font-size: 9px; }
.reader-load-state.success { color: #31594c; background: #e3eee7; }
.reader-load-state.error { color: #8a4c39; background: #f6e4da; }
.reader-page-indicator { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 18px; padding: 10px; border-top: 1px solid #ded5c7; color: #82776d; }
.reader-page-indicator span { font-size: 10px; }
.reader-page-indicator small { font-size: 9px; }
.reader-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 15px; border-top: 1px solid #ded5c7; }
.reader-nav button { padding: 11px; border: 1px solid #cfc3b3; border-radius: 10px; color: #654c3c; background: #fffaf1; }
.reader-nav button:disabled { opacity: .35; }

.formula-detail { background: #f5f1e9; }
.formula-header { padding: 20px 18px 22px; color: #f8f1e7; background: #31564c; }
.formula-header .eyebrow { display: block; margin-top: 29px; }
.formula-header h1 { margin: 7px 0 4px; font: 500 31px "Songti SC", serif; }
.formula-header > p { margin: 0; color: #b8cbc5; font-size: 11px; }
.formula-status { display: flex; gap: 8px; margin-top: 17px; }
.formula-status span { padding: 6px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; color: #d8e4df; font-size: 9px; }
.formula-main { flex: 1; min-height: 0; overflow-y: auto; padding: 15px 17px 34px; }
.formula-boundary { padding: 13px; color: #68402f; background: #f3ddd1; border-left: 3px solid #bb6644; }
.formula-boundary b { font-size: 12px; }
.formula-boundary p { margin: 5px 0 0; color: #7d5d50; font-size: 10px; line-height: 1.55; }
.source-block { margin-top: 14px; padding: 13px; border: 1px solid #ded8cc; border-radius: 9px; background: #fff; }
.source-block h2, .formula-composition h2 { margin: 0; font-size: 13px; }
.source-block button { border: 0; color: #74503d; background: transparent; font-size: 10px; }
.source-block p { margin: 10px 0 0; color: #79746d; font-size: 10px; line-height: 1.6; }
.formula-composition { margin-top: 19px; }
.formula-composition .row > span { color: #928d85; font-size: 9px; }
.formula-composition ul { margin: 9px 0 0; padding: 0; list-style: none; border-top: 1px solid #ded8cc; }
.formula-composition li { display: grid; grid-template-columns: 25px 1fr auto; gap: 7px; align-items: center; padding: 10px 0; border-bottom: 1px solid #ded8cc; }
.formula-composition li > span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: 9px; }
.formula-composition li.matched > span { color: #fff; background: #547b6b; }
.formula-composition li.missing > span { color: #8b8882; border: 1px solid #c9c3b9; }
.formula-composition li b { font-size: 12px; }
.formula-composition li small { color: #8e8a84; font-size: 8px; }
.stock-match { margin-top: 14px; display: grid; grid-template-columns: 72px 1fr; gap: 11px; align-items: center; padding: 13px; border-radius: 9px; color: #365f50; background: #e2ece6; }
.stock-match b, .stock-match span { display: block; }
.stock-match b { font-size: 19px; }
.stock-match span { font-size: 8px; }
.stock-match p { margin: 0; font-size: 9px; line-height: 1.55; }
.formula-flag { margin-top: 12px; padding: 12px; color: #6e573f; background: #eee4d3; font-size: 10px; }
.formula-flag p { margin: 5px 0 0; line-height: 1.55; }

/* 个人处方列表与处方详情 */
.prescription-list { background: #f0f1ed; }
.rx-list-header { padding: 20px 18px 26px; color: #eff5f2; background: #1f4a45; }
.rx-list-header .eyebrow { display: block; margin-top: 27px; }
.rx-list-header h1 { margin: 7px 0 5px; font: 500 31px "Songti SC", serif; }
.rx-list-header p { margin: 0; color: #b8ceca; font-size: 12px; }

/* 三个主列表页使用紧凑页头，让首屏更快进入内容。 */
.warehouse-header,
.classic-header,
.rx-list-header { flex: none; padding: 13px 16px 15px; }
.warehouse-header .icon-button,
.classic-header .icon-button,
.rx-list-header .icon-button { width: 30px; height: 30px; font-size: 12px; }
.warehouse-header .eyebrow,
.classic-header .eyebrow,
.rx-list-header .eyebrow { margin-top: 8px; font-size: 9px; letter-spacing: .09em; }
.warehouse-header h1,
.classic-header h1,
.rx-list-header h1 { margin: 3px 0 3px; font-size: 24px; line-height: 1.15; }
.warehouse-header p,
.classic-header p,
.rx-list-header p { width: 100%; font-size: 10px; line-height: 1.4; }
.rx-list-main { flex: 1; min-height: 0; overflow-y: auto; padding: 15px 17px 20px; }
.rx-add-record { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; margin-bottom: 11px; padding: 12px; border: 0; border-radius: 11px; color: #fff; background: #d86c3f; text-align: left; }
.rx-add-record > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 20px; }
.rx-add-record b, .rx-add-record small { display: block; }
.rx-add-record b { font-size: 13px; }
.rx-add-record small { margin-top: 3px; color: rgba(255,255,255,.8); font-size: 9px; }
.rx-add-record em { font-style: normal; }
.rx-active-list { display: grid; gap: 9px; }
.rx-active-card { width: 100%; padding: 15px; border: 1px solid #d9dfda; border-radius: 13px; color: #2d3431; background: #fff; text-align: left; }
.rx-active-card .row > span:last-child { color: #7a837f; font-size: 10px; }
.rx-status { padding: 5px 8px; border-radius: 99px; color: #316552; background: #e2eee7; font-size: 9px; }
.rx-active-card h2 { margin: 15px 0 5px; font: 600 20px "Songti SC", serif; }
.rx-active-card > p { margin: 0; color: #7d8581; font-size: 10px; }
.rx-mini-herbs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.rx-mini-herbs span { padding: 6px 9px; border-radius: 6px; color: #53645d; background: #edf1ee; font-size: 9px; }
.rx-card-footer { margin-top: 15px; padding-top: 12px; border-top: 1px solid #e8ece9; font-size: 10px; }
.rx-card-footer > span { color: #826244; }

.prescription-new { background: #f5f2eb; }
.rx-new-header { padding: 15px 17px 17px; color: #eff5f2; background: #1f4a45; }
.rx-new-header .eyebrow { display: block; margin-top: 12px; font-size: 9px; }
.rx-new-header h1 { margin: 4px 0; font-size: 24px; }
.rx-new-header p { margin: 0; color: #b8ceca; font-size: 10px; line-height: 1.45; }
.rx-new-main { flex: 1; min-height: 0; overflow-y: auto; padding: 15px 17px 28px; }
.rx-import-card { padding: 13px; border: 1px solid #d9ddd8; border-radius: 12px; background: #fff; }
.rx-import-title { display: flex; align-items: center; gap: 9px; }
.rx-import-title > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #fff; background: #456d61; font: 600 15px "Songti SC", serif; }
.rx-import-title b, .rx-import-title small { display: block; }
.rx-import-title b { color: #26332e; font-size: 12px; }
.rx-import-title small { margin-top: 3px; color: #858c88; font-size: 8px; }
.rx-import-card textarea { width: 100%; min-height: 82px; margin-top: 11px; padding: 10px; resize: vertical; border: 1px solid #d9ddd8; border-radius: 9px; color: #303934; background: #fafbf9; font: inherit; line-height: 1.5; }
.rx-import-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.rx-import-actions button, .rx-image-picker { display: grid; min-height: 35px; place-items: center; padding: 8px; border: 1px solid #456d61; border-radius: 8px; color: #456d61; background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.rx-import-actions button { color: #fff; background: #456d61; }
.rx-image-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rx-ocr-status { margin-top: 8px; color: #858c88; font-size: 8px; line-height: 1.45; }
.rx-ocr-status[data-state="success"] { color: #2e6a54; }
.rx-ocr-status[data-state="error"] { color: #a34f36; }
.rx-ocr-status[data-state="loading"] { color: #9a6b2f; }
.rx-new-warning { margin: 10px 0 15px; padding: 10px; border-radius: 8px; color: #76452f; background: #fff1e7; font-size: 9px; line-height: 1.55; }
.rx-new-form { display: grid; gap: 11px; }
.rx-new-form label { display: grid; gap: 5px; color: #6f7772; font-size: 9px; }
.rx-new-form input, .rx-new-form textarea { width: 100%; padding: 11px; border: 1px solid #d9ddd8; border-radius: 9px; outline: 0; color: #272c29; background: #fff; font: inherit; }
.rx-new-form textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.rx-new-form label > small { color: #969b97; font-size: 8px; }
.rx-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rx-save { padding: 13px; border: 0; border-radius: 10px; color: #fff; background: #456d61; font-weight: 700; }

.prescription-detail { background: #f5f2eb; }
.rx-detail-header { padding: 20px 18px 23px; color: #f3f7f5; background: #244e47; }
.rx-detail-header .eyebrow { display: block; margin-top: 28px; }
.rx-detail-header h1 { margin: 7px 0 4px; font: 500 30px "Songti SC", serif; }
.rx-detail-header > p { margin: 0; color: #b9cbc7; font-size: 10px; }
.rx-verification { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.rx-verification span { padding: 6px 8px; border: 1px solid rgba(255,255,255,.17); border-radius: 99px; color: #d7e4e0; font-size: 8px; }
.rx-detail-main { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 17px 35px; }
.demo-prescription-warning { padding: 12px; color: #6f3429; background: #f4d9d2; border: 1px solid #e6bbb1; }
.demo-prescription-warning b { font-size: 12px; }
.demo-prescription-warning p { margin: 5px 0 0; font-size: 9px; line-height: 1.55; }
.rx-overview { display: grid; grid-template-columns: 90px 1fr; gap: 10px; margin-top: 12px; }
.rx-overview div { padding: 12px; border: 1px solid #ded9ce; border-radius: 9px; background: #fff; }
.rx-overview b, .rx-overview span { display: block; }
.rx-overview b { font-size: 13px; }
.rx-overview span { margin-top: 4px; color: #8b8d87; font-size: 8px; }
.rx-section { margin-top: 17px; padding: 14px; border: 1px solid #ded9ce; border-radius: 10px; background: #fff; }
.rx-section h2 { margin: 0; font-size: 14px; }
.rx-section .row > button { border: 0; color: #496c5e; background: transparent; font-size: 9px; }
.rx-herb-list { margin: 10px 0 0; padding: 0; list-style: none; }
.rx-herb-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid #ece9e2; }
.rx-number { color: #9d826d; font: 10px Georgia, serif; }
.rx-herb-list b, .rx-herb-list small { display: block; }
.rx-herb-list b { font-size: 12px; }
.rx-herb-list small { margin-top: 3px; color: #8a8d88; font-size: 8px; }
.rx-herb-list strong { color: #375a4c; font-size: 11px; }
.rx-lock { margin: 7px 0 0; padding: 8px; color: #745d43; background: #f2e9db; font-size: 8px; line-height: 1.5; }
.rx-effect { display: grid; grid-template-columns: 32px 1fr; gap: 10px; color: #f5eee2; background: #675144; border-color: #675144; }
.rx-section-mark { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; font: 500 13px "Songti SC", serif; }
.rx-effect p { margin: 8px 0 0; color: #d7c9bb; font-size: 9px; line-height: 1.65; }
.rx-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.rx-method-grid div { padding: 10px; border-radius: 7px; background: #eef2ef; }
.rx-method-grid b, .rx-method-grid span { display: block; }
.rx-method-grid b { font-size: 10px; }
.rx-method-grid span { margin-top: 4px; color: #818782; font-size: 8px; }
.rx-decoction { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e5e7e3; }
.rx-decoction b { font-size: 10px; }
.rx-decoction p { margin: 5px 0 0; color: #757a76; font-size: 9px; line-height: 1.55; }
.rx-cautions { color: #633f31; background: #f5e4dc; border-color: #e7c9bd; }
.rx-cautions .row > span { color: #a65638; font-size: 8px; }
.rx-cautions ul { margin: 10px 0 0; padding-left: 17px; }
.rx-cautions li { margin-bottom: 7px; color: #765b50; font-size: 9px; line-height: 1.55; }

/* 我的 */
.profile-page { background: #eef1f1; }
.profile-header { padding: 25px 20px 24px; color: #fff; background: #173a40; }
.profile-header h1 { margin: 22px 0 5px; font-size: 28px; }
.profile-header p { margin: 0; color: #a9c2c1; font-size: 12px; }
.profile-main { flex: 1; min-height: 0; overflow-y: auto; padding: 17px; }
.profile-card { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 15px; border: 1px solid #dfe5e4; border-radius: 12px; color: inherit; background: #fff; text-align: left; cursor: pointer; appearance: none; }
.profile-card:hover, .profile-card:focus-visible { border-color: #56817f; box-shadow: 0 0 0 2px rgba(86,129,127,.12); outline: 0; }
.profile-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #56817f; font-size: 17px; }
.profile-card b, .profile-card small { display: block; }
.profile-card small { margin-top: 4px; color: #7b8581; font-size: 10px; }
.profile-card em { color: #31594c; font-size: 10px; font-style: normal; }
.profile-title { margin: 21px 0 9px; font-size: 14px; }
.profile-title h2 { margin: 0; font-size: 14px; }
.metrics-edit { border: 0; color: #31594c; background: transparent; font-size: 10px; }
.metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); overflow: hidden; border: 1px solid #dfe5e4; border-radius: 11px; background: #fff; }
.metrics-grid div { padding: 13px; border-right: 1px solid #e8ecea; border-bottom: 1px solid #e8ecea; }
.metrics-grid div:nth-child(2n) { border-right: 0; }
.metrics-grid div:nth-last-child(-n + 2) { border-bottom: 0; }
.metrics-grid b, .metrics-grid span { display: block; }
.metrics-grid b { font-size: 16px; }
.metrics-grid span { margin-top: 4px; color: #7b8581; font-size: 9px; }
.metrics-updated { margin: 7px 2px 0; color: #8a918e; font-size: 8px; line-height: 1.5; }
.metrics-form { padding: 4px 14px 14px; border: 1px solid #dfe5e4; border-radius: 11px; background: #fff; }
.metrics-form label { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf0ee; color: #59635f; font-size: 10px; }
.metrics-form label > div { display: grid; grid-template-columns: 1fr 52px; gap: 5px; align-items: center; }
.metrics-form input { width: 100%; padding: 8px 9px; border: 1px solid #d9dfdc; border-radius: 7px; outline: 0; color: #27312d; background: #f8faf9; font-size: 12px; }
.metrics-form em { color: #8a918e; font-size: 9px; font-style: normal; }
.metrics-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 13px; }
.metrics-actions button { padding: 9px; border: 1px solid #cfd8d4; border-radius: 8px; color: #57625e; background: #fff; font-size: 10px; }
.metrics-actions button.primary { color: #fff; border-color: #31594c; background: #31594c; }
.organ-scale-note { margin-top: 13px; padding: 11px 12px; border-radius: 10px; color: #31594c; background: #e4ece7; }
.organ-scale-note b { font-size: 11px; }
.organ-scale-note p { margin: 4px 0 0; color: #68756f; font-size: 8px; line-height: 1.5; }
.organ-group-title { display: flex; align-items: center; justify-content: space-between; margin: 12px 1px 7px; }
.organ-group-title b { color: #2f3935; font-size: 11px; }
.organ-group-title span { color: #8a918e; font-size: 8px; }
.organ-score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.organ-score-card { position: relative; width: 100%; padding: 10px 10px 25px; border: 1px solid #dfe5e4; border-radius: 10px; color: inherit; background: #fff; text-align: left; cursor: pointer; appearance: none; }
.organ-score-card.focus { border-color: #dda17d; background: #fff5ed; }
.organ-score-card:hover, .organ-score-card:focus-visible { border-color: #4c7668; box-shadow: 0 0 0 2px rgba(76, 118, 104, .13); outline: 0; }
.organ-card-hint { position: absolute; right: 10px; bottom: 8px; color: #4c7668; font-size: 7px; }
.organ-card-head b, .organ-card-head span { display: block; }
.organ-card-head b { font-size: 17px; }
.organ-card-head span { min-height: 18px; margin-top: 4px; color: #7b8581; font-size: 7px; line-height: 1.35; }
.organ-polarities { display: grid; gap: 8px; margin-top: 9px; }
.organ-axis > div:first-child { display: flex; align-items: baseline; justify-content: space-between; }
.organ-axis span { color: #6d7772; font-size: 8px; font-weight: 700; }
.organ-axis strong { color: #456d61; font-size: 12px; }
.organ-axis.focus span, .organ-axis.focus strong { color: #bd653e; }
.organ-axis strong small { color: #89918d; font-size: 6px; font-weight: 500; }
.organ-track { height: 4px; overflow: hidden; margin-top: 7px; border-radius: 9px; background: #e6ebe8; }
.organ-track i { display: block; height: 100%; border-radius: 9px; background: #4c7668; }
.organ-track i.yin { background: #6f6687; }
.organ-track i.yang { background: #b66e42; }
.organ-axis.focus .organ-track i { background: #cc7249; }
.organ-score-form { display: grid; gap: 9px; }
.organ-edit-block { padding: 10px 0; border-bottom: 1px solid #e7ebe9; }
.organ-edit-block header b, .organ-edit-block header small { display: block; }
.organ-edit-block header b { color: #303a36; font-size: 13px; }
.organ-edit-block header small { margin-top: 3px; color: #8a918e; font-size: 7px; }
.organ-score-form label.organ-axis-edit { grid-template-columns: 42px 1fr; padding: 8px 0 0; border: 0; }
.organ-score-form label.organ-axis-edit > div { grid-template-columns: 1fr 24px; }
.organ-score-form input[type="range"] { padding: 0; border: 0; accent-color: #456d61; }
.organ-score-form em { color: #31594c; font-size: 12px; font-weight: 700; text-align: right; }
.organ-summary { padding: 13px; border: 1px solid #dfe5e4; border-radius: 11px; background: #fff; }
.organ-summary > span { color: #78817d; font-size: 8px; }
.organ-summary > b { display: block; margin-top: 5px; font-size: 16px; }
.organ-summary > p { margin: 5px 0 0; color: #7b8581; font-size: 8px; line-height: 1.5; }
.organ-summary > div { margin-top: 10px; padding: 10px; border-radius: 8px; color: #73452f; background: #fff0e5; }
.organ-summary strong, .organ-summary small { display: block; }
.organ-summary strong { font-size: 10px; }
.organ-summary small { margin-top: 4px; font-size: 8px; line-height: 1.5; }
.safety-intro { margin: -3px 1px 9px; color: #7b8581; font-size: 8px; line-height: 1.5; }
.safety-records { display: grid; gap: 13px; }
.safety-card-group { display: grid; gap: 7px; }
.safety-group-head > div { display: flex; align-items: baseline; gap: 7px; }
.safety-group-head b { color: #303a36; font-size: 11px; }
.safety-group-head span { color: #8a918e; font-size: 8px; }
.safety-group-head button { padding: 5px 9px; border: 1px solid #bfcfc8; border-radius: 99px; color: #31594c; background: #fff; font-size: 8px; cursor: pointer; }
.safety-card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.safety-record { width: 100%; padding: 12px; border: 1px solid #dfe5e4; border-radius: 11px; color: inherit; background: #fff; text-align: left; cursor: pointer; appearance: none; }
.safety-record:hover, .safety-record:focus-visible { border-color: #4c7668; box-shadow: 0 0 0 2px rgba(76, 118, 104, .12); outline: 0; }
.safety-record .row b { font-size: 11px; }
.safety-record .row span { padding: 4px 7px; border-radius: 99px; color: #35604f; background: #e3eee7; font-size: 8px; }
.safety-record p { margin: 5px 0 0; color: #59635f; font-size: 9px; line-height: 1.55; }
.safety-record small { display: block; margin-top: 6px; color: #8a918e; font-size: 8px; line-height: 1.5; }
.safety-empty-card { grid-column: 1 / -1; border-style: dashed; background: #f8faf9; }
.safety-empty-card b { color: #31594c; font-size: 10px; }
.safety-empty-card p { color: #8a918e; }
.safety-meta { margin: 0 2px; color: #8a918e; font-size: 8px; }
.safety-form { display: grid; gap: 10px; }
.safety-form fieldset { display: grid; gap: 9px; margin: 0; padding: 12px; border: 1px solid #dfe5e4; border-radius: 11px; background: #fff; }
.safety-form legend { padding: 0 5px; color: #31594c; font-size: 11px; font-weight: 700; }
.safety-form label, .safety-form label span { display: block; }
.safety-form label span { margin-bottom: 5px; color: #59635f; font-size: 9px; }
.safety-form input, .safety-form textarea { box-sizing: border-box; width: 100%; padding: 9px; border: 1px solid #d9dfdc; border-radius: 8px; outline: 0; color: #27312d; background: #f8faf9; font: inherit; font-size: 10px; }
.safety-form textarea { min-height: 58px; resize: vertical; line-height: 1.5; }
.safety-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.safety-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.safety-actions button { padding: 10px; border: 1px solid #cfd8d4; border-radius: 8px; color: #57625e; background: #fff; font-size: 10px; }
.safety-actions button.primary { color: #fff; border-color: #31594c; background: #31594c; }
.result-sheet {
  position: absolute;
  z-index: 20;
  left: 12px;
  right: 12px;
  bottom: 14px;
  padding: 17px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(0,0,0,.25);
}
.result-sheet h3 { margin: 0 0 8px; }
.result-sheet p { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }
.result-sheet button { width: 100%; padding: 11px; border: 0; border-radius: 10px; color: #fff; background: #334c3e; }
.profile-switcher .row { margin-bottom: 4px; }
.profile-switcher .row h3 { margin: 0; }
.profile-switcher button.sheet-close { width: 32px; padding: 5px; color: #59635f; background: #eef1ef; }
.profile-switcher button.profile-option { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; margin-top: 8px; padding: 10px; color: #27312d; border: 1px solid #dfe5e4; background: #fff; text-align: left; }
.profile-switcher button.profile-option.active { border-color: #56817f; background: #edf4f1; }
.profile-option > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #56817f; }
.profile-option b, .profile-option small { display: block; }
.profile-option small { margin-top: 3px; color: #7b8581; font-size: 9px; }
.profile-option em { color: #31594c; font-size: 9px; font-style: normal; }
.profile-switcher button.profile-add-entry { margin-top: 9px; color: #31594c; border: 1px dashed #9fb1aa; background: #f6faf8; }
.profile-add-form { display: grid; gap: 9px; margin-top: 11px; }
.profile-add-form label span { display: block; margin-bottom: 5px; color: #59635f; font-size: 9px; }
.profile-add-form input { box-sizing: border-box; width: 100%; padding: 10px; border: 1px solid #d9dfdc; border-radius: 8px; color: #27312d; background: #f8faf9; }
.profile-add-form > div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 2px; }
.profile-add-form > div button { color: #57625e; border: 1px solid #cfd8d4; background: #fff; }
.profile-add-form > div button.primary { color: #fff; border-color: #31594c; background: #31594c; }

@media (max-width: 480px) {
  #app { padding: 0; background: #fff; }
  .phone { height: 100vh; min-height: 0; border-radius: 0; box-shadow: none; }
  .app-shell { border-radius: 0; }
}
