@charset "utf-8";

/* CodeChat mobile design system — intentionally separate from desktop */
:root{
  --mobile-gutter:12px;
  --mobile-card-radius:9px;
  --mobile-shadow:4px 4px 0 #d2cec5;
  --mobile-safe-top:max(6px,calc(env(safe-area-inset-top) - 16px));
}
html,body{height:100%}
body.app-page{background:#f2f0ea}
.app-shell{display:flex;flex-direction:column;height:100dvh;min-height:100dvh;grid-template-columns:none}
.app-main{flex:1;min-width:0;min-height:0}
.sidebar{display:none}
.topbar{height:calc(54px + var(--mobile-safe-top));flex:0 0 calc(54px + var(--mobile-safe-top));padding:var(--mobile-safe-top) 12px 0;border-bottom:2px solid var(--ink);background:#fbfaf7;backdrop-filter:none}
.mobile-menu{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;font-size:17px;border-radius:6px}
.mobile-menu:hover{background:var(--surface-3)}
.topbar-title{font-size:13px;font-weight:850;letter-spacing:-.02em}
.topbar-actions-wrap{gap:6px}
.topbar-actions{gap:6px}
.quick-note-btn{height:36px;padding:0 11px;border:1px solid var(--ink);border-radius:6px;font-size:10px;box-shadow:2px 2px 0 #c9c5bc}
.topbar-actions .primary-btn,.topbar-actions .secondary-btn{height:36px;padding:0 11px;border-radius:6px;font-size:10px;display:inline-flex;align-items:center;justify-content:center;line-height:1;text-align:center}
.topbar-actions .primary-btn{box-shadow:2px 2px 0 #c9c5bc}
.view{flex:1;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch}
.mobile-nav{height:calc(58px + env(safe-area-inset-bottom));flex:0 0 calc(58px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;gap:3px;padding:5px 8px calc(5px + env(safe-area-inset-bottom));border-top:1px solid rgba(31,35,40,.72);background:rgba(251,250,247,.96);box-shadow:0 -7px 22px rgba(31,35,40,.06);backdrop-filter:blur(14px);overflow:visible}
.mobile-nav>a,.mobile-more-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;height:46px;gap:3px;border-radius:12px;color:#6f757c;font-size:9.5px;font-weight:750;transition:background .16s ease,color .16s ease,transform .16s ease}
.mobile-nav>a b,.mobile-more-btn b{font-size:16px;line-height:1}
.mobile-nav>a span,.mobile-more-btn span{display:block;white-space:nowrap}
.mobile-nav>a.active,.mobile-more-btn.active{background:transparent;color:#fff;font-weight:800;flex-direction:column}
.mobile-nav>a.active span,.mobile-more-btn.active span{display:block}
.mobile-nav>a:active,.mobile-more-btn:active{transform:scale(.96)}
.mobile-more-btn{position:relative;z-index:1;border:0;padding:0;background:transparent;font-family:inherit;cursor:pointer}
.mobile-more-menu{position:absolute;right:6px;bottom:calc(100% + 8px);z-index:8;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;width:min(300px,calc(100vw - 24px));padding:8px;border:1px solid var(--ink);border-radius:13px;background:rgba(255,254,250,.98);box-shadow:0 18px 44px rgba(20,24,30,.2);opacity:0;visibility:hidden;transform:translateY(8px) scale(.97);transform-origin:100% 100%;transition:opacity .16s ease,transform .18s cubic-bezier(.22,.9,.28,1.08),visibility .18s}
.mobile-more-menu.open{opacity:1;visibility:visible;transform:translateY(0) scale(1)}
.mobile-more-menu a{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:56px;gap:4px;padding:8px;border-radius:9px;background:var(--surface-2);color:var(--ink);font-size:10px;font-weight:750}
.mobile-more-menu a b{font-size:17px;line-height:1}
.mobile-more-menu a.active{background:var(--ink);color:#fff}

.page{max-width:none;padding:14px var(--mobile-gutter) 30px}
.page.narrow{max-width:none}
.page-head{gap:10px;margin-bottom:16px}
.page-head h1{font-size:26px;line-height:1.08}
.section-head{margin:24px 2px 12px;align-items:flex-end}
.section-head h2{font-size:16px;font-weight:850;letter-spacing:-.035em}
.section-head a,.section-head span{font-size:10.5px;font-weight:750}
.card{padding:16px;border-color:#c7c4bd;border-radius:var(--mobile-card-radius);box-shadow:3px 3px 0 rgba(31,35,40,.07)}
.card.interactive:hover{transform:none;box-shadow:3px 3px 0 rgba(31,35,40,.07)}
.primary-btn,.secondary-btn,.danger-btn,.ghost-btn{min-height:40px;padding:9px 12px;border-radius:6px;font-size:11px;font-weight:800}
.primary-btn{box-shadow:2px 2px 0 #c7c3ba}
.primary-btn:active{transform:translate(1px,1px);box-shadow:1px 1px 0 #c7c3ba}
.secondary-btn,.ghost-btn{background:var(--surface)}
.icon-btn{width:36px;height:36px;border-radius:6px}
.badge{padding:4px 8px;font-size:9.5px}
.empty{padding:44px 18px;font-size:12px}

.hero-panel{min-height:170px;padding:16px;border:2px solid var(--ink);border-radius:var(--mobile-card-radius);background:var(--ink);color:#fff;box-shadow:5px 5px 0 #c9c5bc}
.hero-panel:after{right:8px;bottom:-18px;color:rgba(255,255,255,.055);font-size:82px;letter-spacing:-.14em}
.hero-panel h1{max-width:100%;margin:5px 0 14px;color:#fff;font-size:29px;line-height:1.04;letter-spacing:-.055em}
.hero-panel p{color:rgba(255,255,255,.7);font-size:12px}
.hero-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:14px}
.hero-actions .primary-btn,.hero-actions .secondary-btn{width:100%;min-height:38px;padding:7px 9px;font-size:10.5px}
.hero-panel .primary-btn{background:#fff;color:var(--ink);border-color:#fff;box-shadow:2px 2px 0 rgba(255,255,255,.22)}
.hero-panel .secondary-btn{background:transparent;color:#fff;border-color:rgba(255,255,255,.4);box-shadow:none}
.homeData .grid-3,.grid-2,.grid-3,.post-grid,.profile-sections,.profile-columns{grid-template-columns:1fr}
.homeData .grid-3,.post-grid,.grid-2,.grid-3{gap:14px}

.feed-card{min-height:0;padding:16px;border:1px solid var(--ink);border-top:4px solid var(--ink);border-radius:var(--mobile-card-radius);box-shadow:var(--mobile-shadow)}
.feed-card:hover{transform:none;border-color:var(--ink);box-shadow:var(--mobile-shadow)}
.feed-card:active{transform:translate(2px,2px);box-shadow:2px 2px 0 #d2cec5}
.feed-card-top{gap:10px}
.feed-owner strong{font-size:12px}
.feed-owner small{font-size:9.5px}
.feed-card-body h3{margin:14px 0 6px!important;font-size:19px;line-height:1.26;letter-spacing:-.035em}
.feed-card-body p{min-height:0;font-size:12px;line-height:1.65}
.feed-visual{height:72px;margin-top:13px;border:1px solid rgba(31,35,40,.08);border-radius:5px}
.feed-visual span{left:14px;bottom:-12px;font-size:56px}
.blog-visual span{font-size:72px;bottom:-21px}
.post-card h3{font-size:20px}
.card-meta{gap:7px;margin-top:13px;font-size:9.5px}

.blog-tools{display:grid;gap:10px;width:100%;margin:10px 0 14px}
.blog-tools input{width:100%;height:42px;padding:9px 12px;border-color:var(--line-strong);border-radius:6px;font-size:11px}
.segmented{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;padding:3px;border:1px solid var(--line);border-radius:6px}
.segmented button{min-width:0;padding:9px 3px;border-radius:4px;font-size:10.5px}

.friend-space-toolbar{display:grid;gap:10px;margin:12px 0 14px}
.friend-space-toolbar input{width:100%;height:42px;padding:9px 12px;border-radius:6px;font-size:11px}
.friend-space-grid{grid-template-columns:1fr;gap:14px}
.friend-space-card{padding:16px;border-color:#c3c0b8;border-left:4px solid var(--ink);border-radius:var(--mobile-card-radius);box-shadow:var(--mobile-shadow)}
.friend-space-head{gap:10px}
.friend-space-head strong{font-size:13px}
.friend-space-head small{font-size:9.5px}
.friend-space-links{gap:7px;margin-top:13px}
.friend-space-links a{padding:11px;border-radius:5px;font-size:11px}
.friend-space-links a small{font-size:9px}
.friend-space-empty{padding:22px 8px;font-size:11px}
.wide-request{margin-top:14px}

.plaza-grid{grid-template-columns:1fr;gap:14px}
.plaza-entry{padding:16px;border-color:#c3c0b8;border-left:4px solid var(--ink);border-radius:var(--mobile-card-radius);box-shadow:var(--mobile-shadow)}
.plaza-entry:hover{transform:none;box-shadow:var(--mobile-shadow)}
.plaza-entry:active{transform:translate(2px,2px);box-shadow:2px 2px 0 #d2cec5}
.plaza-entry-head strong{font-size:13px}
.plaza-entry-head small{font-size:9.5px}
.plaza-entry p{min-height:0;margin-top:12px;font-size:12px;line-height:1.65}
.plaza-entry-foot{margin-top:14px;font-size:9.5px}
.plaza-entry-foot a{font-size:10.5px}

.profile-page{padding-top:14px}
.profile-hero{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:14px;padding:18px;border:1px solid var(--ink);border-top:4px solid var(--ink);border-radius:var(--mobile-card-radius);box-shadow:var(--mobile-shadow)}
.profile-hero:after{right:8px;bottom:-32px;font-size:118px}
.profile-hero .avatar.large{width:64px;height:64px}
.profile-identity{width:100%}
.profile-identity h1{margin:0 0 3px;font-size:27px;line-height:1.05}
.profile-identity>p:not(.eyebrow){font-size:10px}
.profile-bio{margin-top:8px;font-size:11px;line-height:1.6}
.profile-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;margin-top:2px}
.profile-actions .primary-btn,.profile-actions .secondary-btn,.profile-actions .ghost-btn{width:100%;min-height:38px}
.profile-actions .mobile-only{display:grid!important}
.relation-panel{margin-top:14px;padding:16px;border-color:#c3c0b8;border-left:4px solid var(--ink);border-radius:var(--mobile-card-radius);box-shadow:var(--mobile-shadow)}
.mode-row{gap:10px;padding:12px 0}
.mode-row strong{font-size:11px}
.mode-row small{font-size:9.5px}
.mode-switch{align-self:stretch;display:grid;grid-template-columns:1fr 1fr}
.mode-btn{padding:9px 10px;font-size:10px}
.plaza-card{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:start;gap:13px;margin-top:14px;padding:16px;border-color:#c3c0b8;border-left:4px solid var(--ink);border-radius:var(--mobile-card-radius);box-shadow:var(--mobile-shadow)}
.plaza-card>.avatar.card{width:48px;height:48px}
.plaza-body h2{margin:7px 0 5px;font-size:21px}
.plaza-body p{margin-bottom:10px;font-size:11px;line-height:1.6}
.plaza-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;width:100%;gap:8px}
.plaza-actions .primary-btn,.plaza-actions .secondary-btn{width:100%}
.profile-sections{gap:14px;margin-top:14px}
.profile-sections>.card{padding:16px}
.profile-sections .section-head{margin:0 0 12px}
.profile-list a{padding:11px 9px;font-size:11px}
.profile-list small{font-size:9.5px}

.blog-body{padding:18px;border-top:4px solid var(--ink);border-radius:var(--mobile-card-radius);font-size:14px;line-height:1.82}
.title-with-back{gap:8px}
.title-with-back .icon-btn{flex-basis:36px}
.title-with-back h1{font-size:26px;line-height:1.15}

.modal-backdrop{align-items:end;padding:0}
.modal{width:100%;max-height:90dvh;border:0;border-top:2px solid var(--ink);border-radius:16px 16px 0 0;box-shadow:0 -18px 60px rgba(20,24,30,.24);padding-bottom:env(safe-area-inset-bottom)}
.modal-head{position:sticky;top:0;z-index:3;padding:15px 16px;background:var(--surface)}
.modal-body{padding:16px;gap:13px}
.modal-body textarea.large{min-height:280px}
.modal-actions{gap:8px;padding:0 16px calc(16px + env(safe-area-inset-bottom))}
.form-row,.visibility-options{grid-template-columns:1fr}
.toast-stack{top:62px;right:12px;left:12px}
.toast{width:100%;max-width:none;min-width:0;padding:11px 13px;font-size:11px}

.space-shell{height:calc(100dvh - 54px - var(--mobile-safe-top) - 58px - env(safe-area-inset-bottom))}
.space-head{display:flex;flex-wrap:wrap;align-items:center;padding:10px 12px;gap:7px;border-bottom:2px solid var(--ink)}
.space-head>.icon-btn:first-child{display:none}
.space-title{flex:1 1 calc(100% - 58px);min-width:0;order:1}
.space-title h1{font-size:18px;line-height:1.2;white-space:nowrap}
.space-title p{margin-top:3px;font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.space-head>.badge{order:1}
.space-head .spacer{display:none}
.space-head>.ghost-btn,.space-head>.secondary-btn,.space-head>.primary-btn{order:2;min-height:34px;padding:7px 9px;font-size:10px}
.space-head>.mobile-only{order:2;width:34px;height:34px;min-height:34px;margin-left:0}
.space-overview{padding:18px 14px}
.space-overview>h2{display:none}
.space-overview .description{font-size:12px;line-height:1.7}
.space-overview>.description{display:none}
.space-overview .section-head{margin:0 0 14px}
.space-overview .section-head h2{font-size:15px}
.space-overview .empty{padding:30px 10px}
.overview-grid{grid-template-columns:1fr;gap:14px}
.member-row{padding:10px 0;font-size:11px}
.friend-layout{height:calc(100dvh - 54px - var(--mobile-safe-top) - 58px - env(safe-area-inset-bottom))}
.friend-tools input{height:40px;font-size:11px}
.chat-head{height:56px}
.chat-composer{grid-template-columns:minmax(0,1fr) auto;padding:10px}
.chat-composer textarea{font-size:12px}
.chat-composer button{height:42px}
.chat-composer-action{width:58px;min-width:58px}
.chat-composer-action .chat-plus-btn{width:42px;height:42px}
.chat-send-btn{width:58px;min-width:58px;height:42px}
.chat-more-menu{right:10px;bottom:calc(100% + 8px)}
.chat-attachment-image img{max-width:min(250px,72vw);max-height:240px}
.chat-attachment-file{min-width:170px;max-width:min(270px,72vw)}

.auth-page{display:block;min-height:100dvh;padding:0;background:#f2f0ea}
.auth-shell{display:flex;flex-direction:column;min-height:100dvh;gap:0}
.auth-intro{display:flex;min-height:calc(202px + env(safe-area-inset-top));padding:calc(24px + env(safe-area-inset-top)) 20px 24px;border:0;border-radius:0;background:var(--ink);color:#fff;box-shadow:none;justify-content:flex-start;overflow:hidden}
.auth-intro:after{right:-92px;bottom:-152px;width:300px;height:300px;border-color:rgba(255,255,255,.12)}
.auth-intro .brand-lockup{color:#fff}
.auth-intro .brand-glyph{background:#fff;color:var(--ink)}
.auth-intro .eyebrow{margin-top:32px;color:rgba(255,255,255,.55)}
.auth-intro h1{max-width:320px;margin:8px 0 0;color:#fff;font-size:28px;line-height:1.12;letter-spacing:-.05em}
.auth-copy,.feature-strip{display:none}
.auth-card{flex:1;min-height:0;padding:24px 20px calc(30px + env(safe-area-inset-bottom));border:0;border-radius:0;box-shadow:none;background:#fbfaf7;justify-content:flex-start}
.auth-card>*{width:100%;max-width:430px}
.auth-tabs{margin-bottom:22px}
#authHead h2{font-size:27px}
#authHead p{font-size:11px}
#authForm{gap:15px;margin-top:20px}
#authForm input,.field input,.field textarea,.field select{min-height:44px;font-size:14px}
.public-link{margin-top:22px;font-size:11px}

.collab-tabs.three{grid-template-columns:repeat(3,1fr)}

.profile-sections .empty{padding:24px 8px}

.mobile-nav .nav-active-indicator{border-radius:12px}
.mobile-nav>a,.mobile-more-btn{transition:color 110ms ease,transform 160ms ease}
.mobile-nav>a.active,.mobile-more-btn.active{background:transparent;color:#fff;transition:color 50ms ease 300ms,transform 160ms ease}

.modal.wide{width:100%}

.friend-contact-list,.friend-list-summary,.moment-feed,.moment-feed-head{max-width:none}
.friend-contact-main{padding:11px 12px}
.friend-contact-count{font-size:9.5px}
.friend-contact .friend-remove-btn{margin-right:5px}
.moment-feed-head{margin:10px 2px 12px}
.moment-entry{padding:15px}
.moment-entry-body h3{font-size:19px}
.moment-entry-body p{font-size:11.5px}
.moment-entry-foot{flex-wrap:wrap}

.friend-contact-list{border-left:0;border-right:0;margin:0 calc(var(--mobile-gutter) * -1)}
.friend-list-summary{padding:0 2px}
.friend-contact-main{padding:13px 14px}
.friend-contact-main .avatar.card{width:54px;height:54px;border-radius:11px}
.friend-contact-copy strong{font-size:16px}
.friend-contact-copy small{font-size:10px}
.wechat-profile-page{padding:12px var(--mobile-gutter) 28px}
.wechat-profile-hero{padding:17px 15px;gap:14px;border-radius:9px}
.wechat-profile-hero .avatar.large{width:68px;height:68px;border-radius:10px}
.wechat-profile-identity h1{font-size:25px}
.wechat-profile-block{margin-top:8px;border-radius:7px}
.wechat-profile-row{min-height:64px;padding:11px 13px;gap:10px}
.wechat-profile-row>strong{font-size:16px}
.wechat-moment-thumb{width:43px;height:43px}
.wechat-message-row{min-height:58px;font-size:15px}
.wechat-permission summary{padding:15px 14px}
.wechat-profile-content .card{padding:15px}

.wechat-profile-more{right:12px;top:12px;width:32px;height:32px}
.wechat-profile-block .profile-list{padding:2px 8px 8px}
.wechat-space-row small{max-width:190px}
.friend-setting-readonly{padding:11px}

.direct-chat-page{height:100%}
.direct-chat-head{min-height:58px;padding:8px 12px}
.direct-chat-page .chat-messages{padding:12px}
.direct-chat-page .chat-message .bubble{max-width:82%;font-size:12px}
.direct-chat-page .chat-composer{padding:9px 10px calc(9px + env(safe-area-inset-bottom))}

.public-hub-tabs{display:grid;width:100%;margin:10px 0 14px}
.public-hub-tabs button{padding:9px 12px;font-size:11px}
.profile-self-blog{margin-top:12px}
.profile-space-edit{font-size:9.5px}

.hero-panel{min-height:96px;padding:18px 16px}
.hero-panel h1{margin:0}

.page{padding:14px 12px 30px}
.section-head{margin:22px 2px 10px}
.grid-2,.grid-3,.post-grid,.homeData .grid-3{gap:14px}
.card{padding:16px}
.feed-card{padding:16px;min-height:0}
.feed-card-body h3{margin:14px 0 6px!important}
.feed-card-body p{min-height:0}
.feed-visual{margin-top:13px}
.card-meta{margin-top:13px}
.blog-tools{margin:10px 0 14px}
.public-hub-tabs{margin:10px 0 14px}
.friend-space-toolbar{margin:12px 0 14px}
.profile-sections,.profile-self-blog{margin-top:12px}
.profile-self-blog .section-head{margin:0 0 12px}

.topbar-search-btn{width:34px;height:34px;font-size:17px}
.topbar-search-popover{right:0;width:min(366px,calc(100vw - 24px));padding:7px;border-radius:9px}
.topbar-search-field input{height:40px;font-size:12px}

.editor-tabs{height:46px;flex-basis:46px;padding:0 7px;gap:3px;overflow-x:auto;scrollbar-width:none}
.editor-tabs::-webkit-scrollbar{display:none}
.editor-file{max-width:112px;flex:0 0 auto;font-size:10px}
.editor-tools{gap:3px;margin-left:3px}
.editor-font-family span{display:none}
.editor-font-family select{width:48px;max-width:48px;height:24px;padding:0 2px;font-size:8px}
.editor-font-size button{min-width:22px;height:20px;font-size:8px}
.editor-font-size span{min-width:26px;font-size:7px}
.editor-status{flex:0 0 auto;font-size:8px}
.editor-pagination{flex-wrap:wrap;gap:5px;padding:6px 8px}
.chunk-buttons{width:100%;justify-content:space-between}
.chunk-buttons #chunkLabel{min-width:0;flex:1;font-size:8px}
.chunk-jump{width:100%;margin-left:0}
.chunk-jump input{flex:1;width:auto}

.space-editor-shell .space-head{flex-wrap:nowrap;justify-content:flex-start;gap:5px;padding:8px 10px;overflow-x:auto;scrollbar-width:none}
.space-editor-shell .space-head::-webkit-scrollbar{display:none}
.space-editor-shell .space-title{display:none}
.space-editor-shell .space-head>.ghost-btn,.space-editor-shell .space-head>.secondary-btn,.space-editor-shell .space-head>.primary-btn{flex:0 0 auto;min-height:32px;padding:6px 9px}
.space-editor-shell .space-head>.mobile-only{flex:0 0 32px;width:32px;height:32px;min-height:32px}

.hot-update-banner{top:calc(68px + var(--mobile-safe-top));align-items:flex-start;flex-direction:column;gap:9px}
.hot-update-actions{width:100%;margin-left:0}
.hot-update-actions button{flex:1}

.group-space-overview .overview-grid{grid-template-columns:1fr}
.group-member-grid{grid-template-columns:1fr}
.space-invite-card{width:100%}
.space-title-main .group-avatar-stack .avatar.card{width:30px;height:30px}

.file-delete-btn{opacity:.7}

.mobile-nav .nav-unread-badge{top:1px;right:calc(50% - 29px);transform:none;min-width:17px;height:17px;border-color:#fbfaf7;font-size:7.5px}
.friend-unread-badge{min-width:19px;height:19px;border-color:var(--surface);font-size:8.5px}

.group-member-head-actions{gap:7px}
.group-member-head-actions .group-invite-btn{min-height:30px;padding:5px 8px;font-size:8.5px}
