/* 港澳保險人工作台 · 風格 C 活力漸變 */
*{margin:0;padding:0;box-sizing:border-box;font-family:'PingFang SC','Noto Sans SC',-apple-system,system-ui,sans-serif;-webkit-tap-highlight-color:transparent}
html,body{background:#fff5f6;color:#2d2d2d}
#app{max-width:520px;margin:0 auto;min-height:100vh;position:relative;background:#fff5f6;padding-bottom:calc(76px + env(safe-area-inset-bottom))}

/* 頂部 */
#app-header{background:linear-gradient(135deg,#ff4d6a,#ff8e53);padding:calc(20px + env(safe-area-inset-top)) 20px 14px;border-radius:0 0 26px 26px;box-shadow:0 8px 24px rgba(255,77,106,.25)}
.hdr-top{display:flex;justify-content:space-between;align-items:center}
.greet{color:#ffe3e8;font-size:12px;letter-spacing:1px;margin-bottom:4px;font-weight:600}
.h1{color:#fff;font-size:21px;font-weight:800;line-height:1.3}
.sub{color:#ffe8dc;font-size:12px;margin-top:4px}
.hdr-logo{width:44px;height:44px;border-radius:15px;background:rgba(255,255,255,.25);display:flex;align-items:center;justify-content:center;color:#fff;font-size:22px;font-weight:800;backdrop-filter:blur(4px);border:1.5px solid rgba(255,255,255,.4)}
.compliance{margin-top:12px;background:rgba(255,255,255,.22);border-radius:14px;padding:10px 14px;display:flex;align-items:center;gap:9px;backdrop-filter:blur(4px)}
.cdot{width:9px;height:9px;border-radius:50%;background:#2dd4a7;box-shadow:0 0 0 4px rgba(45,212,167,.3);flex-shrink:0}
.ctext{color:#fff;font-size:12px;font-weight:500}
.ctext b{color:#a8ffdd}

/* 主內容 */
#app-main{overflow-y:auto;padding:16px 16px 30px}
.page{display:none}
.page.active{display:block}
.sec-t{font-size:14px;color:#ff4d6a;font-weight:800;margin:18px 0 10px;display:flex;align-items:center;gap:8px}
.sec-t::after{content:'';flex:1;height:3px;background:linear-gradient(90deg,#ff4d6a,transparent);border-radius:2px}

/* 卡片 */
.pack{background:#fff;border-radius:20px;padding:6px 16px;box-shadow:0 8px 24px rgba(255,77,106,.10)}
.pack-item{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #ffeef1}
.pack-item:last-child{border-bottom:none}
.picon{width:44px;height:44px;border-radius:14px;background:linear-gradient(135deg,#ffd3da,#ffe8dc);display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}
.pinfo{flex:1;min-width:0}
.pname{color:#2d2d2d;font-size:14px;font-weight:700}
.pdesc{color:#9a8f96;font-size:11px;margin-top:2px}

.grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.entry{background:#fff;border-radius:18px;padding:15px;box-shadow:0 8px 24px rgba(255,77,106,.08);cursor:pointer;border:1.5px solid transparent;text-align:left;font-family:inherit;min-height:96px}
.entry:active{border-color:#ffb3c0;transform:translateY(-1px)}
.eicon{width:44px;height:44px;border-radius:14px;background:linear-gradient(135deg,#ff4d6a,#ff8e53);display:flex;align-items:center;justify-content:center;font-size:19px;margin-bottom:10px}
.ename{color:#2d2d2d;font-size:13px;font-weight:700}
.edesc{color:#9a8f96;font-size:10px;margin-top:3px}

.report{background:#fff;border-radius:20px;padding:6px 16px;box-shadow:0 8px 24px rgba(255,77,106,.08)}
.report-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #ffeef1}
.report-row:last-child{border-bottom:none}
.flag{width:10px;height:10px;border-radius:50%;flex-shrink:0}
.fg{background:#2dd4a7}.fy{background:#ffb020}.fr{background:#ff4d6a}
.rtext{color:#6b5d64;font-size:12px;flex:1;line-height:1.5}
.rtext b{color:#2d2d2d}

.list{background:#fff;border-radius:20px;box-shadow:0 8px 24px rgba(255,77,106,.08);overflow:hidden}
.list-item{display:flex;align-items:center;gap:10px;padding:13px 15px;border-bottom:1px solid #ffeef1}
.list-item:last-child{border-bottom:none}
.lname{color:#2d2d2d;font-size:13px;flex:1;font-weight:500;line-height:1.4}
.lname small{display:block;color:#b5a6ac;font-size:11px;font-weight:400;margin-top:2px}
.ltag{font-size:10px;padding:3px 10px;border-radius:20px;background:#ffeef1;color:#ff4d6a;font-weight:600;white-space:nowrap;flex-shrink:0}
.ltag.gold{background:#fff3e0;color:#e8890c}
.ltag.green{background:#e2f8f1;color:#12a17e}
.ltag.red{background:#ffe0e6;color:#ff2d55}
.ltag.gray{background:#f3f0f2;color:#9a8f96}

/* 底部導航 */
#app-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:520px;background:rgba(255,255,255,.97);backdrop-filter:blur(10px);border-top:1px solid #ffeef1;display:flex;padding:6px 6px calc(10px + env(safe-area-inset-bottom));z-index:100}
.nitem{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;color:#b5a6ac;font-size:10px;cursor:pointer;padding:6px 0;border-radius:14px;background:none;border:none;font-family:inherit;min-height:48px;justify-content:center}
.nitem.active{color:#ff4d6a;background:#ffeef1;font-weight:700}
.nicon{font-size:18px}

/* 子 tab */
.sub-tabs{display:flex;gap:8px;margin:6px 0 4px;overflow-x:auto;padding-bottom:4px}
.sub-tabs::-webkit-scrollbar{display:none}
.sub-tab{font-size:12px;padding:8px 14px;border-radius:20px;background:#fff;color:#9a8f96;border:1.5px solid #ffd3da;cursor:pointer;font-weight:600;white-space:nowrap;min-height:40px;font-family:inherit}
.sub-tab.active{background:linear-gradient(135deg,#ff4d6a,#ff8e53);color:#fff;border-color:transparent}
.sub-page{display:none}
.sub-page.active{display:block}

/* 表單 */
textarea,input,select{width:100%;border:1.5px solid #ffd3da;border-radius:14px;padding:12px 14px;font-size:14px;font-family:inherit;background:#fff;color:#2d2d2d;margin-bottom:10px;outline:none;min-height:44px}
textarea:focus,input:focus,select:focus{border-color:#ff4d6a}
textarea{resize:vertical;line-height:1.6}
.form-row{display:flex;flex-direction:column;gap:8px}
.form-row input,.form-row select{margin-bottom:0}
.btn-primary{width:100%;border:none;border-radius:16px;padding:13px;font-size:15px;font-weight:700;background:linear-gradient(135deg,#ff4d6a,#ff8e53);color:#fff;cursor:pointer;min-height:48px;font-family:inherit;box-shadow:0 6px 16px rgba(255,77,106,.3)}
.btn-primary:active{opacity:.85}
.btn-primary.ghost{background:#fff;color:#ff4d6a;border:1.5px solid #ffd3da;box-shadow:none}
.btn-danger{width:100%;border:none;border-radius:16px;padding:13px;font-size:15px;font-weight:700;background:#ffe0e6;color:#ff2d55;cursor:pointer;min-height:48px;font-family:inherit;margin-top:10px}
.btn-mini{border:none;border-radius:14px;padding:10px 14px;font-size:12px;font-weight:700;background:linear-gradient(135deg,#ff4d6a,#ff8e53);color:#fff;cursor:pointer;min-height:40px;font-family:inherit;white-space:nowrap}

/* 提示卡 */
.tip-card{background:#fff3e0;border-radius:16px;padding:12px 14px;font-size:12px;color:#a06a1e;line-height:1.6;margin-top:10px}
.tip-card b{color:#e8890c}

/* 選題卡 */
.topic-card{background:#fff;border-radius:18px;padding:14px 16px;margin-bottom:10px;box-shadow:0 8px 24px rgba(255,77,106,.08)}
.topic-card .tt{font-size:14px;font-weight:700;color:#2d2d2d;line-height:1.5}
.topic-card .td{font-size:11px;color:#9a8f96;margin-top:6px;line-height:1.5}
.topic-actions{display:flex;gap:8px;margin-top:10px}
.topic-actions .btn-mini{flex:1}

/* 內容卡 */
.content-card{background:#fff;border-radius:20px;padding:16px;margin-bottom:12px;box-shadow:0 8px 24px rgba(255,77,106,.08)}
.cct{color:#ff4d6a;font-size:11px;letter-spacing:1px;margin-bottom:6px;font-weight:700}
.ccb{color:#2d2d2d;font-size:14px;line-height:1.7;font-weight:500;white-space:pre-wrap;word-break:break-word}
.ccs{color:#b5a6ac;font-size:11px;margin-top:8px}
.card-actions{display:flex;gap:8px;margin-top:12px}
.card-actions .btn-mini{flex:1;font-size:11px;padding:9px 6px}

/* 審查結果 */
.scan-status{display:flex;align-items:center;gap:10px;padding:14px 16px;border-radius:18px;margin-bottom:12px;font-weight:700;font-size:15px}
.scan-status.green{background:#e2f8f1;color:#12a17e}
.scan-status.yellow{background:#fff3e0;color:#e8890c}
.scan-status.red{background:#ffe0e6;color:#ff2d55}
.hit-item{background:#fff;border-radius:16px;padding:12px 14px;margin-bottom:8px;border-left:4px solid #ff4d6a}
.hit-item .ht{font-size:13px;font-weight:700;color:#2d2d2d;margin-bottom:4px}
.hit-item .hd{font-size:12px;color:#6b5d64;line-height:1.6}
.hit-item.warn{border-left-color:#ffb020}
.hit-item.ok{border-left-color:#2dd4a7}

/* 風險框 */
.risk-box{background:#fff;border-radius:18px;padding:14px 16px;font-size:13px;color:#6b5d64;line-height:1.8;display:none;box-shadow:0 8px 24px rgba(255,77,106,.08)}
.risk-box.show{display:block}
.risk-box .copy-btn{margin-top:10px}

/* 轉換輸出 */
.convert-out{background:#fff;border-radius:18px;padding:14px 16px;font-size:14px;line-height:1.8;color:#2d2d2d;display:none;box-shadow:0 8px 24px rgba(255,77,106,.08);white-space:pre-wrap}
.convert-out.show{display:block}

/* checklist */
.check-item{background:#fff;border-radius:16px;padding:14px 16px;margin-bottom:10px;display:flex;align-items:flex-start;gap:12px;cursor:pointer;box-shadow:0 8px 24px rgba(255,77,106,.08)}
.check-item .cb{width:24px;height:24px;border-radius:8px;border:2px solid #ffd3da;flex-shrink:0;display:flex;align-items:center;justify-content:center;color:#fff;font-size:14px;margin-top:1px}
.check-item.done .cb{background:#2dd4a7;border-color:#2dd4a7}
.check-item .ct{font-size:13px;color:#2d2d2d;line-height:1.5;flex:1}
.check-item.done .ct{color:#b5a6ac;text-decoration:line-through}

/* 圖表 */
.chart{background:#fff;border-radius:20px;padding:16px;box-shadow:0 8px 24px rgba(255,77,106,.08)}
.chart-bar{display:flex;align-items:flex-end;gap:6px;height:100px;margin-top:12px}
.cbar{flex:1;background:linear-gradient(180deg,#ff8e53,#ff4d6a);border-radius:6px 6px 0 0;min-width:12px;position:relative}
.cbar span{position:absolute;top:-20px;left:50%;transform:translateX(-50%);font-size:10px;color:#9a8f96;white-space:nowrap}
.clabel{display:flex;gap:6px;margin-top:6px}
.clabel div{flex:1;font-size:9px;color:#b5a6ac;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* 彈窗 */
.modal-mask{position:fixed;inset:0;background:rgba(45,45,45,.5);z-index:200;display:flex;align-items:flex-end;justify-content:center}
.modal{background:#fff;border-radius:24px 24px 0 0;padding:22px 20px calc(24px + env(safe-area-inset-bottom));width:100%;max-width:520px;max-height:86vh;overflow-y:auto}
.modal-title{font-size:17px;font-weight:800;color:#2d2d2d;margin-bottom:14px;text-align:center}
.modal-actions{display:flex;gap:10px;margin-top:6px}
.modal-actions .btn-primary{flex:1}

/* toast */
.toast{position:fixed;left:50%;bottom:110px;transform:translateX(-50%) translateY(20px);background:rgba(45,45,45,.92);color:#fff;padding:12px 20px;border-radius:24px;font-size:13px;opacity:0;transition:.3s;z-index:300;pointer-events:none;max-width:80%;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
