/* Phase 4.0G — UI Bible: theme accents, stable semantic colours, 8px rhythm. */
:root{--g-stars:#ffc542;--g-energy:#ffcb4d;--g-fullness:#ff6b88;--g-cleanliness:#6ec6ff;--g-wellness:#7ed7a6;--g-mood:#a78bfa;--g-bond:#ff8eaf;--g-rest:#a9a8ff;--g-radius:16px;--g-shadow:0 3px 14px rgb(57 44 81 / 4%);--g-text:#343049;--g-muted:#696477;--font-zh:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;--font-en:ui-rounded,"Arial Rounded MT Bold","Trebuchet MS",system-ui,sans-serif;--card-radius:16px;--radius-lg:20px;--radius-md:16px;--button-radius:16px;--ink:var(--g-text);--muted:var(--g-muted)}
body{color:var(--g-text);font-size:16px;line-height:1.6;background-color:var(--page-background)}
h1,h2,h3{font-family:var(--font-heading);line-height:1.35;overflow-wrap:anywhere}h1{font-size:clamp(28px,3vw,32px)}h2{font-size:22px}h3{font-size:18px}p{overflow-wrap:anywhere}small{font-size:14px}button,a,input,select,textarea{touch-action:manipulation}button,input,select{min-height:44px}button,a{ -webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--primary);outline-offset:3px}button:disabled{cursor:not-allowed;opacity:.55}
main{max-width:1180px;margin-inline:auto;padding:16px 24px 32px;min-width:0}.workspace{min-width:0}.topbar{background:transparent;border-bottom:0;min-height:56px}.topbar .breadcrumb{font-size:14px}footer{font-size:14px;opacity:.85}.sidebar-note{font-size:14px}.brand{font-family:var(--font-ui)}.brand small{font-size:12px}
.g-icon{display:inline-block;width:32px;height:32px;object-fit:contain;flex-shrink:0;vertical-align:middle}.g-chevron{width:22px;height:22px;margin-left:auto}.g-back{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border-radius:50%;background:#fffffff0;margin-bottom:8px}
.sidebar .nav-link,#mobile-nav .nav-link{border-radius:16px;box-shadow:none}.sidebar .nav-link .g-icon{width:32px;height:32px}#mobile-nav .g-icon{width:28px;height:28px}.sidebar #navigation{gap:8px}.sidebar .nav-link{min-height:56px}.sidebar .nav-link[aria-current],#mobile-nav .nav-link[aria-current]{font-weight:700}
.g-hero{position:relative;isolation:isolate;border:1px solid var(--border);border-radius:20px;min-height:232px;overflow:hidden;margin-bottom:24px;background:var(--surface)}.g-banner{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 45%;z-index:-2}.g-hero:after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#fffffff2 0%,#ffffffe0 30%,#ffffff38 58%,transparent 78%)}.g-hero-copy{padding:28px;max-width:58%;min-height:232px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center}.g-hero h1{color:var(--primary);margin:0 0 8px}.g-hero p{color:var(--g-text);font-size:16px;margin:0;max-width:32ch}.g-hero-copy .g-back{margin-top:-12px}
.g-card,.panel,.growth-surface,.shop-surface,.cp-status,.app-dialog{border-radius:var(--g-radius);box-shadow:var(--g-shadow);border:1px solid var(--border);background:var(--surface)}.g-card{padding:24px;margin:0 0 16px;min-width:0}.g-card h2{display:flex;align-items:center;gap:8px;color:var(--primary);margin:0 0 16px;font-size:22px}.g-card h2 .g-icon{width:28px;height:28px}.g-card p:last-child{margin-bottom:0}.g-muted,.g-row small{color:var(--g-muted)}
.g-home-grid,.g-parent-grid,.g-module-layout,.g-today-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.g-home-grid>.g-card,.g-parent-grid>.g-card,.g-today-grid>.g-card{margin:0}.g-wide{grid-column:1/-1}.g-home-grid .g-wide:first-child{margin-top:0}.g-summary-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.g-summary-stats a{display:flex;flex-direction:column;align-items:center;text-align:center;border:1px solid var(--border);background:color-mix(in srgb,var(--surface) 90%,var(--accent));border-radius:12px;padding:16px 8px;text-decoration:none;color:var(--g-text)}.g-summary-stats strong{font-size:24px;margin-top:4px}.g-summary-stats small{font-size:14px}.g-progress{display:flex;align-items:center;gap:16px;margin-top:16px}.g-progress strong{font-size:16px;white-space:nowrap}.g-progress progress{width:100%;height:12px;flex:1;min-width:0;border:0;border-radius:20px;accent-color:var(--primary);background:var(--page-background)}progress::-webkit-progress-bar{background:color-mix(in srgb,var(--accent) 25%,white);border-radius:20px}progress::-webkit-progress-value{background:var(--primary);border-radius:20px}
.g-module-links{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.g-module-links a{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;border:1px solid var(--border);border-radius:12px;padding:16px 8px;text-align:center;color:var(--g-text);font-size:14px;background:var(--surface);text-decoration:none;min-width:0}.g-module-links strong{overflow-wrap:anywhere}.g-module-links .g-icon{width:44px;height:44px}
.g-row{display:flex;align-items:center;gap:12px;min-height:64px;width:100%;padding:12px 16px;border:1px solid var(--border);border-radius:12px;background:var(--surface);text-decoration:none;color:var(--g-text);font:inherit;text-align:left;box-shadow:none;margin-bottom:8px;overflow-wrap:anywhere}.g-row>span{min-width:0;flex:1}.g-row strong{font-weight:600;display:block}.g-row small{display:block;margin-top:4px}.g-row:last-child{margin-bottom:0}.g-row:hover,.g-module-links a:hover{background:color-mix(in srgb,var(--surface) 85%,var(--accent));border-color:var(--primary)}.g-row:active{transform:translateY(1px)}.g-my-links{max-width:800px;margin:auto;display:grid;gap:8px}.g-my-links .g-row{min-height:76px;margin:0}.g-my-links .g-icon{width:40px;height:40px}
.g-buddy-snapshot .home-pet{border:0;box-shadow:none;background:transparent;padding:0;margin:0;min-height:0;text-align:left}.g-buddy-snapshot .home-pet h2{display:none}.g-buddy-snapshot .home-pet .pet-slot,.g-buddy-snapshot .home-pet .cp-art{width:110px;height:120px;max-height:120px;margin:0 auto}.g-buddy-snapshot .home-pet .cp-image{max-height:120px}.g-buddy-snapshot .home-pet p{font-size:14px;margin:8px 0}.g-buddy-snapshot .home-pet a{min-height:44px;display:inline-flex;align-items:center}.g-memory-photo{width:80px;height:88px;object-fit:cover;border-radius:8px;flex-shrink:0}.g-memory-full{max-width:100%;max-height:600px;object-fit:contain;display:block;margin:auto;border-radius:12px}.g-note{white-space:pre-wrap}
.g-date{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.g-date label{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-size:14px}.g-date input{min-width:0;width:160px;max-width:100%;border:1px solid var(--border);border-radius:12px;padding:8px}.g-date button{border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--primary);padding:8px;min-width:44px}.g-task-group>.panel{box-shadow:none;padding:0;border:0;margin:0;background:transparent}.g-task-group .section-heading h2{font-size:16px;margin:12px 0 8px;color:var(--g-muted)}.g-task-group .task-count{font-size:14px}.task-card{border-radius:12px;box-shadow:none;background:var(--surface);margin-bottom:8px}.task-name strong{font-size:16px}.task-main{padding:12px;gap:8px}.task-complete{width:44px;height:44px;min-width:44px}.task-reward{font-size:14px}.task-name small{font-size:12px}.g-today-grid{margin:16px 0}.g-module-layout .task-panel{margin:0}.g-parent-grid .g-row{font-size:16px}.g-parent-grid label{display:block;margin-bottom:16px}.g-parent-grid select{display:block;width:100%;margin-top:8px}
.action-button,.cp-button,.growth-button,.shop-button,.module-controls button{border:1px solid var(--border);border-radius:16px;padding:10px 16px;background:var(--surface);color:var(--primary);box-shadow:none;min-height:44px}.action-button.primary,.shop-button.primary{background:var(--primary);color:#fff}.action-button:hover,.cp-button:hover,.growth-button:hover{background:color-mix(in srgb,var(--surface) 80%,var(--accent))}.action-button.primary:hover{background:var(--primary);filter:brightness(1.08)}.app-dialog{padding:24px;max-width:min(720px,calc(100vw - 24px))}.app-dialog label,.app-dialog input,.app-dialog textarea,.app-dialog select{max-width:100%;min-width:0}.dialog-heading h2{font-size:22px}.dialog-heading button{min-width:44px}.g-card .parent-profile{margin:0}.parent-profile p{min-width:0}
.g-hero + .cp-home .cp-top{display:none}.cp-home .cp-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}.cp-home .cp-scene{border-radius:16px;min-height:300px;height:360px;box-shadow:var(--g-shadow)}.cp-home .cp-status{padding:24px}.cp-home .cp-status h2{font-size:20px}.cp-home .cp-stats{gap:16px}.cp-home .cp-stat progress{height:10px}.cp-home [data-stat=energy] progress{accent-color:var(--g-energy)}.cp-home [data-stat=fullness] progress{accent-color:var(--g-fullness)}.cp-home [data-stat=mood] progress{accent-color:var(--g-mood)}.cp-home [data-stat=cleanliness] progress{accent-color:var(--g-cleanliness)}.cp-home [data-stat=wellness] progress{accent-color:var(--g-wellness)}.cp-home [data-stat=energy] progress::-webkit-progress-value{background:var(--g-energy)}.cp-home [data-stat=fullness] progress::-webkit-progress-value{background:var(--g-fullness)}.cp-home [data-stat=mood] progress::-webkit-progress-value{background:var(--g-mood)}.cp-home [data-stat=cleanliness] progress::-webkit-progress-value{background:var(--g-cleanliness)}.cp-home [data-stat=wellness] progress::-webkit-progress-value{background:var(--g-wellness)}
.cp-home .buddy-actions{grid-column:1/-1;padding:0}.cp-home .buddy-action-group{padding:0;margin:0 0 24px}.cp-home .buddy-action-group h2{font-size:22px;color:var(--primary);margin:0 0 16px}.cp-home .buddy-action-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.cp-home .buddy-action-grid[data-group=together]{grid-template-columns:repeat(3,minmax(0,1fr))}.cp-home .buddy-action-grid .buddy-action-card{border-radius:16px;border:1px solid var(--border);padding:16px;min-height:164px;box-shadow:var(--g-shadow);background:var(--surface)}.cp-home .buddy-action-icon{width:48px;height:48px;border-radius:12px}.cp-home .buddy-action-icon .g-icon{width:44px;height:44px}.cp-home .buddy-action-title{font-size:18px;font-weight:600}.cp-home .buddy-action-subtitle{font-size:14px;font-weight:400;color:var(--g-muted)}.cp-home .buddy-action-grid .buddy-action-card:hover{background:color-mix(in srgb,var(--surface) 85%,var(--accent));border-color:var(--primary)}.cp-settings{border-radius:16px;border:1px solid var(--border);padding:16px}.cp-settings>summary{min-height:44px}.cp-home .wellness-card{grid-column:1/-1}
.g-hero + .growth-page .growth-hero{min-height:0;background:none;border:0;padding:0;box-shadow:none;margin-bottom:16px}.g-hero + .growth-page .growth-hero h1,.g-hero + .growth-page .growth-hero p,.g-hero + .growth-page .growth-hero-art{display:none}.growth-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.growth-badge{border-radius:16px;border:1px solid var(--border);box-shadow:var(--g-shadow);padding:16px;background:var(--surface);min-width:0}.growth-badge img{height:112px;max-width:100%;object-fit:contain}.growth-badge strong{font-size:16px}.growth-badge small{font-size:12px}.growth-stars{display:none}.growth-badge>span:not(.growth-stars){font-size:14px}.buddy-style-readonly{font-size:14px}.shop-card,.wardrobe-card,.commerce-card{border-radius:16px;box-shadow:var(--g-shadow)}
@media(min-width:768px) and (max-width:1100px){main{padding:16px}.g-module-links{grid-template-columns:repeat(3,minmax(0,1fr))}.g-hero-copy{max-width:65%}.g-parent-grid{grid-template-columns:1fr}.cp-home .cp-layout{grid-template-columns:1fr}.cp-home .cp-scene{height:350px}.cp-home .buddy-action-grid,.cp-home .buddy-action-grid[data-group=together]{grid-template-columns:repeat(3,minmax(0,1fr))}.growth-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767px){main{padding:8px 12px 24px}.topbar{padding:8px 12px;min-height:44px}.topbar .breadcrumb{font-size:12px}.g-hero{min-height:200px;margin-bottom:16px;border-radius:16px}.g-hero-copy{min-height:200px;max-width:70%;padding:16px}.g-hero h1{font-size:28px}.g-hero p{font-size:14px}.g-hero:after{background:linear-gradient(90deg,#fffffff2,#ffffffc9 40%,transparent 85%)}.g-hero .g-back{margin-top:0;margin-bottom:4px}.g-card{padding:16px}.g-card h2{font-size:20px;margin-bottom:12px}.g-home-grid,.g-parent-grid,.g-module-layout,.g-today-grid{grid-template-columns:1fr;gap:12px}.g-wide{grid-column:auto}.g-summary-stats{gap:8px}.g-summary-stats a{padding:12px 4px}.g-summary-stats strong{font-size:22px}.g-summary-stats small{font-size:12px}.g-module-links{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.g-module-links a{padding:12px 4px}.g-row{padding:12px;gap:8px;font-size:16px}.g-row small{font-size:12px}.g-my-links .g-row{min-height:68px}.g-date label{flex-basis:60%;font-size:12px}.g-date button:last-child{flex-grow:1}.task-main{padding:8px}.task-name strong{font-size:16px}.task-reward{font-size:12px}.g-buddy-snapshot .home-pet{display:block}.cp-home .cp-layout{grid-template-columns:1fr}.cp-home .cp-scene{min-height:260px;height:300px}.cp-home .cp-status{padding:16px}.cp-home .buddy-action-grid,.cp-home .buddy-action-grid[data-group=together]{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.cp-home .buddy-action-grid .buddy-action-card{padding:16px 10px;min-height:172px}.cp-home .buddy-action-title{font-size:18px}.cp-home .buddy-action-group h2{font-size:20px}.growth-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.growth-badge{padding:12px 8px}.growth-badge img{height:96px}.growth-badge strong{font-size:14px}.app-dialog{padding:16px}.g-card .parent-profile .profile-avatar{width:72px;height:72px}.g-hero-buddy{min-height:160px}.g-hero-buddy .g-hero-copy{min-height:160px}#mobile-nav{padding-top:8px;gap:4px}#mobile-nav .nav-link{font-size:12px;min-height:58px}.announcement{max-width:calc(100vw - 24px)}}
@media(prefers-reduced-motion:reduce){.g-row:active{transform:none}}
.g-snapshot{display:flex;align-items:center;gap:16px}.g-snapshot>.cp-art{width:112px;min-width:112px;height:128px;margin:0}.g-snapshot>.cp-art .cp-image{max-height:128px}.g-snapshot>div:last-child{min-width:0;flex:1}.g-snapshot p{margin:0 0 8px}.g-snapshot small{display:block;margin-bottom:8px}.g-snapshot .g-row{font-size:14px;padding:8px}.g-snapshot>.g-icon{width:48px;height:48px}
.cp-home .buddy-action-grid,.cp-home .buddy-action-grid[data-group=together]{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:767px){.cp-home .buddy-action-grid,.cp-home .buddy-action-grid[data-group=together]{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Room for bilingual titles without changing card geometry. */
.cp-home .buddy-action-grid .buddy-action-card{min-height:192px}
.g-hero h1>.g-icon{width:44px;height:44px;margin-right:8px}.cp-stat .g-icon,.cp-bond .g-icon{width:24px;height:24px}
/* Phase 4.0G.1: presentation only; transparent production art stays intact. */
:root{--g-space-1:4px;--g-space-2:8px;--g-space-3:12px;--g-space-4:16px;--g-space-5:20px;--g-space-6:24px;--g-space-7:32px;--g-space-8:40px;--g-space-9:48px;--g-soft-border:color-mix(in srgb,var(--border) 40%,var(--surface));--g-soft-surface:color-mix(in srgb,var(--surface) 96%,var(--accent));--g-shadow:0 4px 16px rgb(57 44 81 / 3%)}
.g-icon{position:relative;display:inline-grid;place-items:center;overflow:visible;line-height:1}
.g-icon>.g-icon-art{position:absolute;width:calc(100% * var(--icon-fit,1));height:calc(100% * var(--icon-fit,1));max-width:none;object-fit:contain;pointer-events:none}
.g-hero{border-radius:32px;border-color:var(--g-soft-border)}
.g-card{border-radius:24px;border-color:var(--g-soft-border);background:var(--g-soft-surface);box-shadow:var(--g-shadow);padding:32px}
.g-card h2{display:flex;align-items:center;gap:12px;line-height:1.25;margin:0 0 24px}.g-card h2>.g-icon{width:28px;height:28px}
.g-row{border-radius:18px;border-color:var(--g-soft-border);box-shadow:none}.g-row>.g-icon{width:24px;height:24px}.g-row>.g-chevron{width:22px;height:22px}
.g-home-grid .g-chevron{display:none}.g-summary-stats a{border-radius:20px;border-color:var(--g-soft-border);background:color-mix(in srgb,var(--surface) 97%,var(--accent));box-shadow:none}.g-summary-stats .g-icon{width:36px;height:36px}
.g-module-links a{border-radius:20px;border-color:var(--g-soft-border);padding:24px 12px;gap:16px;background:var(--surface)}.g-module-links .g-icon{width:60px;height:60px}
.g-module-layout{grid-template-columns:minmax(0,1fr)}.g-module-layout .task-panel{border-color:var(--g-soft-border);border-radius:24px;padding:24px}
.cp-home .buddy-action-group{padding:24px 32px;background:var(--g-soft-surface);border:1px solid var(--g-soft-border);border-radius:24px}
.cp-home .buddy-action-group h2{display:flex;align-items:center;line-height:1.25;margin:0 0 24px}
.cp-home .buddy-action-grid .buddy-action-card{min-height:224px;padding:24px 16px;gap:0;border-radius:22px;border-color:var(--g-soft-border);background:var(--surface);box-shadow:var(--g-shadow)}
.cp-home .buddy-action-card .buddy-action-icon{width:72px;height:72px;border-radius:20px;margin-bottom:16px;background:color-mix(in srgb,var(--action-accent) 10%,transparent)}
.cp-home .buddy-action-icon .g-icon{width:60px;height:60px}.cp-home .buddy-action-title{line-height:1.25;margin-bottom:8px}.cp-home .buddy-action-subtitle{line-height:1.5}
.cp-home .buddy-action-grid .buddy-action-card:hover{background:color-mix(in srgb,var(--surface) 96%,var(--accent));border-color:var(--g-soft-border);box-shadow:0 5px 18px rgb(57 44 81 / 7%)}
.cp-home .cp-scene{border-radius:28px}.cp-home .cp-status,.growth-surface{border-radius:24px;border-color:var(--g-soft-border)}.growth-badge{border-radius:20px;border-color:var(--g-soft-border)}
@media(min-width:768px){:root{--sidebar:92px}.sidebar{padding:24px 8px;border-color:var(--nav-border);box-shadow:none}.sidebar #navigation{display:grid;gap:12px;margin:0}.sidebar .nav-link{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;height:84px;min-height:84px;padding:8px 4px;font-size:14px;line-height:1.25;background:transparent;border:1px solid transparent;box-shadow:none;border-radius:18px}.sidebar .nav-link .g-icon{width:34px;height:34px}.sidebar .nav-link:hover{background:var(--nav-hover-background);border-color:transparent}.sidebar .nav-link[aria-current="page"]{background:color-mix(in srgb,var(--nav-active-background) 35%,var(--nav-surface));border-color:transparent;box-shadow:0 3px 10px rgb(57 44 81 / 4%)}.sidebar .nav-link span{font-size:14px}}
@media(min-width:1280px){:root{--sidebar:112px}.sidebar{padding:24px 12px}.sidebar .nav-link,.sidebar .nav-link span{font-size:15px}}
@media(max-width:767px){.g-hero{border-radius:28px}.g-card{padding:20px;border-radius:24px}.g-card h2{margin-bottom:20px;gap:12px}.g-module-links a{padding:20px 4px;gap:16px}.g-module-links .g-icon{width:52px;height:52px}.cp-home .buddy-action-group{padding:20px 16px}.cp-home .buddy-action-grid .buddy-action-card{padding:20px 8px;min-height:224px}.cp-home .buddy-action-group h2{margin-bottom:20px}.g-module-layout .task-panel{padding:16px}}
.g-row>.g-icon{flex:0 0 auto}.cp-home .buddy-action-grid .buddy-action-card{min-height:240px}
