:root{font-family:system-ui,-apple-system,"Segoe UI","Noto Sans TC",sans-serif;color:#23324A;background:#FFF8EC;line-height:1.5}*{box-sizing:border-box}body{margin:0}.topbar{border-top:4px solid #E0701B;position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;align-items:center;padding:14px 16px;background:rgba(255,248,236,.94);backdrop-filter:blur(10px);border-bottom:1px solid #F1DCC0}.eyebrow{margin:0;color:#C2620F;font-size:12px;font-weight:700}.topbar h1{margin:1px 0 0;font-size:21px}.icon-btn{width:44px;height:44px;border:0;border-radius:50%;background:#1F3A5F;color:white;font-size:25px}main{max-width:960px;margin:auto;padding:12px 12px 40px}.notice{padding:10px 12px;border-radius:12px;background:#FFF7D6;color:#7A4A12;font-size:13px}.filters{margin-top:12px;padding:12px;border:1px solid #F1DCC0;border-radius:16px;background:white;box-shadow:0 5px 18px rgba(31,58,95,.06)}label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:700}.search-box input,.filter-grid input,select{width:100%;min-height:42px;border:1px solid #E8C9A0;border-radius:10px;background:white;padding:8px 10px;font:inherit;font-weight:400}.filter-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:10px}.filter-actions,.card-actions{display:flex;gap:8px;margin-top:10px}button{cursor:pointer;font:inherit;font-weight:700;border:0;border-radius:10px;padding:10px 14px;background:#E0701B;color:white}.secondary{background:#FFEBD2;color:#1F3A5F}.summary{display:flex;justify-content:space-between;gap:8px;padding:13px 3px 8px;font-size:13px;color:#5B6B82}.message{padding:16px;border-radius:12px;background:#fde8e8;color:#8d2626}.dog-list{display:grid;gap:12px}.dog-card{display:grid;grid-template-columns:128px 1fr;overflow:hidden;border:1px solid #F1DCC0;border-radius:17px;background:white;box-shadow:0 5px 18px rgba(31,58,95,.07)}.photo-wrap{position:relative;min-height:150px;padding:0;border-radius:0;background:#FFF1E0;overflow:hidden}.dog-photo{width:100%;height:100%;object-fit:cover;display:block}.no-photo{position:absolute;inset:0;display:grid;place-items:center;color:#5B6B82;font-size:13px}.dog-photo[src]:not([src=""])+.no-photo{display:none}.dog-info{min-width:0;padding:12px}.card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.dog-id{margin:0;font-size:18px;word-break:break-all}.sex-badge{flex:none;padding:3px 9px;border-radius:999px;background:#FFE8CC;color:#8A4A10;font-size:13px;font-weight:800}.chips{margin:6px 0;color:#5B6B82;font-size:13px}.dog-info dl{margin:7px 0}.dog-info dl div{display:grid;grid-template-columns:66px 1fr;gap:5px;font-size:13px}.dog-info dt{color:#5B6B82}.dog-info dd{margin:0;min-width:0;word-break:break-word}.remark{display:-webkit-box;overflow:hidden;margin:7px 0 0;color:#4A5568;font-size:13px;-webkit-line-clamp:2;-webkit-box-orient:vertical}.card-actions button{flex:1;padding:8px;font-size:13px}dialog{width:min(620px,calc(100% - 24px));max-height:88vh;padding:0;border:0;border-radius:18px;box-shadow:0 25px 70px rgba(0,0,0,.28)}dialog::backdrop{background:rgba(15,25,40,.55)}.dialog-head{position:sticky;top:0;display:flex;justify-content:space-between;align-items:center;padding:14px 16px;background:white;border-bottom:1px solid #eee}.dialog-head button{padding:2px 10px;background:transparent;color:#444;font-size:26px}.dialog-content{padding:16px;overflow:auto}.dialog-photo{width:100%;max-height:420px;object-fit:contain;border-radius:12px;background:#eee}.detail-table{display:grid;grid-template-columns:90px 1fr;margin-top:12px;font-size:14px}.detail-table>*{padding:7px;border-bottom:1px solid #eee}.detail-table dt{color:#5B6B82}.detail-table dd{margin:0;word-break:break-word}.official-link{display:block;margin-top:14px;text-align:center;text-decoration:none;border-radius:10px;padding:11px;background:#E0701B;color:white;font-weight:700}@media(min-width:700px){.dog-list{grid-template-columns:repeat(2,1fr)}.dog-card{grid-template-columns:150px 1fr}.filter-grid{grid-template-columns:repeat(3,1fr)}}@media(max-width:380px){.dog-card{grid-template-columns:110px 1fr}.dog-info{padding:10px}.dog-id{font-size:16px}}
.quick-actions{display:flex;gap:8px;overflow-x:auto;margin-top:10px;padding-bottom:2px}.quick-chip{flex:none;padding:7px 12px;border:1px solid #E8C9A0;background:#fff;color:#1F3A5F;border-radius:999px;font-size:13px}.quick-chip.active{border-color:#E0701B;background:#E0701B;color:#fff}.icon-btn:disabled{opacity:.5}.search-box input{font-size:16px}@media(display-mode:standalone){.eyebrow{display:none}.topbar{padding-top:max(14px,env(safe-area-inset-top))}}
.location{margin:6px 0;padding:5px 8px;border-radius:8px;background:#FFF1E0;color:#C2620F;font-size:13px;font-weight:800}.filter-grid input{font-size:16px}
/* v0.2.2：防止長文字撐壞卡片，並保持動物編號完整橫向顯示 */
.dog-card{min-width:0}
.dog-info{overflow:hidden}
.card-head{min-width:0}
.dog-id{min-width:0;word-break:normal;overflow-wrap:anywhere;white-space:nowrap}
.remark{max-width:100%;overflow-wrap:anywhere;word-break:break-word}
@media(min-width:700px){.dog-list{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v0.2.8：手機版將次要篩選條件預設收合 */
.advanced-filters{margin-top:10px;border:1px solid #F1DCC0;border-radius:12px;background:#FFF8EC;overflow:hidden}
.advanced-filters summary{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:46px;padding:11px 13px;color:#1F3A5F;font-size:14px;font-weight:800;cursor:pointer;list-style:none}
.advanced-filters summary::-webkit-details-marker{display:none}
.advanced-filters summary::after{content:"＋";flex:none;font-size:20px;line-height:1}
.advanced-filters[open] summary{border-bottom:1px solid #F1DCC0}
.advanced-filters[open] summary::after{content:"－"}
.advanced-filters .filter-grid{margin:0;padding:12px}
.advanced-filter-count{margin-left:auto;padding:2px 8px;border-radius:999px;background:#FFE8CC;color:#C2620F;font-size:12px;font-weight:800}
@media(max-width:480px){.advanced-filters .filter-grid{gap:12px}.advanced-filters summary{font-size:15px}}

/* v0.3.0：犬隻姓名與手機快速修改 */
.dog-name{min-width:0;margin:0;font-size:19px;overflow-wrap:anywhere}.dog-id{margin:1px 0 4px;color:#5B6B82;font-size:12px;font-weight:700;white-space:nowrap}.card-actions{flex-wrap:wrap}.card-actions button{min-width:30%}.name-dialog small{display:block;margin-top:5px;color:#5B6B82;font-size:12px}.name-animal{margin:0 0 12px;padding:8px 10px;border-radius:9px;background:#FFF1E0;color:#C2620F;font-weight:800}.name-form input{width:100%;min-height:44px;border:1px solid #E8C9A0;border-radius:10px;padding:9px 10px;font:inherit;font-size:16px}.cage-candidate-wrap{margin-top:16px}.name-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.name-actions button{min-width:100px}@media(max-width:420px){.card-actions button{font-size:12px;padding:8px 5px}}

.name-line{display:flex;align-items:center;gap:5px;min-width:0}.name-line .dog-name{min-width:0}.name-edit-icon{flex:0 0 auto;width:28px;height:28px;min-width:28px;padding:0;border:0;border-radius:50%;background:transparent;color:#E0701B;font-size:20px;line-height:28px;box-shadow:none}.name-edit-icon:hover,.name-edit-icon:focus-visible{background:#FFE8CC;color:#B9550E}.card-actions button{min-width:46%}@media(max-width:420px){.name-edit-icon{width:26px;height:26px;min-width:26px;font-size:18px;line-height:26px}}


/* v0.3.2：縮減卡片操作、搜尋工具列與快速篩選 */
.filter-toolbar{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr) minmax(0,1fr);gap:7px;margin-top:10px}
.filter-tool{min-width:0;padding:9px 6px;font-size:12px;white-space:nowrap}
.filter-tool.active{background:#E0701B;color:#fff}
.advanced-filters{margin-top:8px;border:1px solid #F1DCC0;border-radius:12px;background:#FFF8EC;overflow:hidden}
.advanced-filters[hidden]{display:none}
.advanced-filters .filter-grid{margin:0;padding:12px}
.advanced-filter-count{margin-left:4px;padding:1px 5px}
.dog-info{position:relative}
.card-head{padding-right:0}
.card-icon-btn{position:absolute;right:10px;bottom:10px;width:34px;height:34px;padding:0;border:1px solid #F1DCC0;border-radius:50%;background:#FFF8EC;color:#1F3A5F;font-size:20px;line-height:32px}
.card-icon-btn:hover,.card-icon-btn:focus-visible{background:#FFE8CC;color:#1F3A5F}
.card-actions{display:none}
.quick-actions{scrollbar-width:thin}
@media(max-width:420px){.filter-toolbar{gap:5px}.filter-tool{font-size:11px;padding:9px 3px}.card-icon-btn{width:32px;height:32px;font-size:18px}}


/* v0.3.3：姓名旁僅保留無底色的修改與放大鏡圖示 */
.name-line{display:flex;align-items:center;gap:4px;min-width:0}
.inline-icon-btn{flex:0 0 auto;width:26px;height:26px;min-width:26px;padding:0;border:0;border-radius:0;background:transparent;color:#1F3A5F;font-size:18px;line-height:26px;box-shadow:none}
.inline-icon-btn:hover,.inline-icon-btn:focus-visible{background:transparent;color:#1F3A5F;outline:2px solid #F1DCC0;outline-offset:1px}
.card-icon-btn{display:none!important}
@media(max-width:420px){.inline-icon-btn{width:24px;height:24px;min-width:24px;font-size:17px;line-height:24px}}

/* v0.3.6 compact card/photo */
.same-cage-hint{font-size:13px;font-weight:400;color:#4A5568;line-height:1.5;white-space:normal}
.name-line{flex-wrap:wrap}
@media(max-width:420px){.photo-wrap{min-height:140px}}


/* v0.3.7 志工備註 */
.volunteer-note-row{display:flex;align-items:flex-start;gap:3px;margin:5px 0 7px;color:#4A5568;font-size:13px;line-height:1.5}
.volunteer-note-label{flex:0 0 auto;font-weight:700;color:#1F3A5F}
.volunteer-note-text{min-width:0;overflow-wrap:anywhere;white-space:pre-wrap}
.volunteer-note-row .note-btn{margin-top:-3px}
.name-form textarea{width:100%;min-height:96px;border:1px solid #E8C9A0;border-radius:10px;padding:9px 10px;font:inherit;font-size:16px;resize:vertical}


/* v0.3.8：拍照順位縮寫＋志工備註與動物編號同列，避免卡片變高 */
.dog-id-note-line{display:flex;align-items:center;gap:10px;min-width:0;margin:1px 0 4px;flex-wrap:wrap}
.dog-id-note-line .dog-id{margin:0}
.volunteer-note-compact{display:inline-flex;align-items:center;gap:2px;min-width:0;color:#4A5568;font-size:12px;line-height:1.35}
.volunteer-note-compact .volunteer-note-label{font-weight:700;color:#1F3A5F}
.volunteer-note-compact .volunteer-note-text{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.volunteer-note-compact .note-btn{width:22px;height:22px;min-width:22px;font-size:15px;line-height:22px}
@media(max-width:420px){.dog-id-note-line{gap:7px}.volunteer-note-compact .volunteer-note-text{max-width:150px}}

/* v0.3.9：動物編號與志工備註增加視覺區隔，標籤縮為「註)」 */
.dog-id-note-line{gap:0}
.dog-id-note-separator{flex:0 0 auto;width:1px;height:14px;margin:0 10px;background:#E8C9A0}
.volunteer-note-compact{gap:2px}
.volunteer-note-compact .volunteer-note-label{font-weight:700}
@media(max-width:420px){.dog-id-note-separator{margin:0 8px}}


/* v0.3.11：縮短資料來源說明，並將官方動物分類切換移到搜尋框上方 */
.source-note{margin:0 0 5px;color:#5B6B82;font-size:11px;line-height:1.22}.source-note span{display:block;white-space:nowrap}
.animal-switch{display:flex;align-items:center;gap:5px;margin:0 0 6px}
.animal-switch .quick-chip{padding:4px 10px;font-size:12px;line-height:1.2}
.search-box{margin-top:0}
@media(max-width:420px){.source-note{font-size:10.5px}.animal-switch{gap:4px;margin-bottom:5px}.animal-switch .quick-chip{padding:4px 9px;font-size:11.5px}}

.tabs{display:flex;gap:6px;max-width:960px;margin:0 auto;padding:8px 12px 0;background:#FFF8EC}.tab{flex:1;text-align:center;padding:8px 10px;border-radius:12px 12px 0 0;border:1px solid #F1DCC0;border-bottom:0;background:#FFEBD2;color:#1F3A5F;font-weight:700;font-size:15px;text-decoration:none}.tab.active{background:#E0701B;border-color:#E0701B;color:#fff}

/* v0.4.7 志工確認的照片 */
.photos-btn{width:auto;min-width:0;padding:0 4px;font-size:14px}
.confirmed-strip{grid-column:1/-1;padding:8px 12px 12px;border-top:1px dashed #F1DCC0;background:#FFF8EC}
.confirmed-title{margin:0 0 4px;font-size:13px;font-weight:700;color:#1F3A5F}
.confirmed-row{margin-top:6px}.confirmed-row small{display:block;font-size:12px;color:#5B6B82;margin-bottom:3px}
.confirmed-imgs{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px}
.confirmed-imgs button{flex:none;padding:0;border-radius:10px;background:#FFF1E0;overflow:hidden}
.confirmed-imgs img{display:block;width:96px;height:96px;object-fit:cover}
.confirmed-imgs button:focus-visible{outline:3px solid #E0701B;outline-offset:2px}
.photo-zoom{width:auto;max-width:96vw;max-height:92vh;background:transparent;box-shadow:none;overflow:visible}
.photo-zoom img{display:block;max-width:96vw;max-height:90vh;border-radius:12px}
.photo-zoom .zoom-x{position:fixed;top:12px;right:16px;color:#fff;font-size:30px;text-shadow:0 1px 4px #000}
body.embed .topbar,body.embed .tabs,body.embed .filters,body.embed .summary{display:none}
body.embed main{padding-top:8px}

.feat-line{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-top:7px;font-size:13px}.feat-label{color:#C2620F;font-weight:800}
.feat-tag{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:999px;background:#FFE8CC;color:#6B3A08;font-weight:700}.feat-tag small{font-weight:400;color:#8A6A4A;font-size:11px}
.feat-none{color:#5B6B82}.feat-edit{padding:3px 10px;border-radius:999px;background:#FFF1E0;color:#B9550E;border:1px solid #F5C99A;font-size:12.5px}
.feat-dialog{display:grid;gap:10px}.feat-tip{margin:0;font-size:13px;color:#5B6B82}.feat-list{display:flex;flex-wrap:wrap;gap:6px}
.feat-x{min-width:28px;min-height:28px;padding:0;background:transparent;color:#B9550E;font-size:16px}
.feat-add{display:flex;gap:8px}.feat-add input,.feat-dialog label input{flex:1;min-height:42px;border:1.5px solid #E8C9A0;border-radius:10px;padding:6px 10px;font:inherit;font-size:16px}.feat-msg{margin:0;font-size:13px;color:#1F3A5F;min-height:1em}

.app-ver{display:inline-block;margin-left:4px;padding:0 7px;border-radius:999px;background:#1F3A5F;color:#fff;font-size:11px;font-weight:700;vertical-align:1px}
.menu-group{display:flex;gap:6px;padding:4px 6px 8px;border-bottom:1px solid #F1DCC0;margin-bottom:4px}.menu-group .quick-chip{flex:1}
.pid-menu .advanced-filter-count{margin-left:6px}
.confirmed-imgs{display:flex;flex-wrap:wrap;gap:8px}
.confirmed-cell{display:grid;gap:4px;justify-items:center;padding:4px;border-radius:12px;border:1.5px solid transparent}
.confirmed-cell.is-main{border-color:#E0701B;background:#FFF1E0}
.confirmed-cell small{color:#5B6B82;font-size:11px}
.set-main{padding:4px 8px;border-radius:999px;background:#FFF1E0;color:#B9550E;border:1px solid #F5C99A;font-size:12px}
.main-tag{font-size:12px;font-weight:800;color:#B9550E}
.edit-hist{display:grid;gap:6px}.edit-hist-h{margin:4px 0 0;font-size:13px;font-weight:800;color:#1F3A5F}
.edit-hist-row{display:grid;grid-template-columns:1fr auto;gap:2px 8px;align-items:center;padding:6px 8px;border-radius:10px;background:#FFF8EC;border:1px solid #F1DCC0}
.edit-hist-row small{grid-column:1/-1;color:#5B6B82;font-size:11.5px}.edit-hist-row button{padding:5px 10px;font-size:12.5px}
#mainMenu{min-width:250px}.menu-group .quick-chip{white-space:nowrap;padding:8px 6px}
/* v0.7.1：縮圖還沒到時不顯示「暫無照片」 */
.photo-wrap.th-wait .no-photo{display:none}
.dog-photo:not([src]){visibility:hidden}
/* v0.7.1：白板匯入 */
.wb-dialog textarea{width:100%;min-height:150px;border:1px solid #E8C9A0;border-radius:10px;padding:8px 10px;font:inherit;font-weight:400}
.wb-dialog #wbCheck,.wb-dialog #wbImport{min-height:44px}
.wb-dialog #wbPreset{align-self:flex-start;min-height:40px}
.wb-result{display:grid;gap:6px}
.wb-sum{margin:4px 0;padding:8px 10px;border-radius:10px;background:#FFF1E0;color:#1F3A5F;font-weight:700;font-size:14px}
.wb-row{padding:7px 10px;border:1px solid #F1DCC0;border-left:6px solid #C9C2B8;border-radius:10px;background:#fff}
.wb-row.wb-ok{border-left-color:#2E8B57}.wb-row.wb-skip{border-left-color:#E0701B;background:#FFF8EC}.wb-row.wb-none{border-left-color:#C9C2B8;color:#5B6B82}
.wb-h{display:flex;gap:6px;align-items:baseline;flex-wrap:wrap}.wb-ic{width:1.4em;font-weight:800}.wb-wb{color:#5B6B82;font-size:13px;overflow-wrap:anywhere}
.wb-msg{margin:2px 0 0;font-size:14px;overflow-wrap:anywhere}.wb-row small{display:block;color:#5B6B82;font-size:12.5px;overflow-wrap:anywhere}
.wb-bad{margin:4px 0;color:#8A3F06;font-size:13px;overflow-wrap:anywhere}
.wb-go{display:grid;gap:8px;padding:10px;border-radius:12px;background:#FFF1E0}
.wb-tag{display:inline-block;margin-right:6px;padding:1px 8px;border-radius:999px;background:#1F3A5F;color:#fff;font-size:12px}
.wb-undo{margin-top:6px}.wb-undo button{padding:6px 12px;font-size:14px}
/* v0.7.4：畢業區說明、寫特徵改成筆 */
.grad-note{margin:4px 0 10px;padding:10px 12px;border-radius:12px;background:#FFF1E0;color:#1F3A5F;font-size:14px;font-weight:700;line-height:1.5}
.feat-edit.inline-icon-btn{padding:0;border:0;background:transparent;color:#1F3A5F}
.pid-menu .quick-chip.active,.pid-menu .quick-chip.active:hover,.pid-menu .quick-chip.active:focus-visible{background:#E0701B;border-color:#E0701B;color:#fff}
