:root{
  --bg:#f4f7fb;--surface:#fff;--text:#0f172a;--muted:#64748b;--border:#dbe4ee;
  --green:#15803d;--green-bg:#eaf7ef;--blue:#315f83;--blue-bg:#edf4f8;
  --red:#9f3445;--red-bg:#f9edf0;--amber:#8a5a13;--amber-bg:#fff6df;
  --radius:18px;--nav-h:72px
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",sans-serif}
body{overflow:hidden}
button,input,select{font:inherit}

#a16-shell{height:100vh;display:grid;grid-template-rows:1fr var(--nav-h)}
#a16-stage{position:relative;min-height:0;overflow:hidden;background:var(--bg)}
#a16-native{width:100%;height:100%;border:0;background:var(--bg);display:block}
#a16-custom{position:absolute;inset:0;overflow:auto;background:var(--bg);padding:20px max(16px,calc((100vw - 1120px)/2)) 96px}
#a16-native[hidden],#a16-custom[hidden]{display:none!important}

#a16-nav{height:var(--nav-h);display:grid;grid-template-columns:repeat(6,minmax(0,1fr));background:rgba(255,255,255,.985);border-top:1px solid var(--border)}
#a16-nav[hidden]{display:none!important}
.a16-nav-btn{min-width:0;border:0;background:transparent;color:#64748b;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
.a16-nav-btn.active{color:#0f172a;background:#f8fafc;box-shadow:inset 0 2px 0 #0f172a}
.a16-nav-icon{font-size:17px;line-height:1}
.a16-nav-label{font-size:11px;font-weight:850;white-space:nowrap}

.a16-page{max-width:1120px;margin:0 auto}
.a16-brand{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:18px}
.a16-brand h1{font-size:20px;margin:0;font-weight:950}
.a16-brand small{display:block;margin-top:2px;color:var(--muted)}
.a16-logout{border:1px solid var(--border);border-radius:10px;background:#fff;color:#172033;padding:8px 11px;font-weight:850;cursor:pointer}
.a16-page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}
.a16-title{font-size:26px;font-weight:950;letter-spacing:-.03em}
.a16-sub{font-size:11px;line-height:1.65;color:var(--muted);margin-top:5px}
.a16-btn{border:1px solid var(--border);border-radius:10px;background:#fff;color:#172033;padding:8px 10px;font-size:10px;font-weight:850;cursor:pointer}
.a16-card{position:relative;background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:16px}

/* strategy */
.a16-strategy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.a16-strategy{position:relative;border:1px solid var(--border);border-radius:var(--radius);padding:15px;background:#fff}
.a16-strategy[data-tone=good]{background:#f8fcf9;border-color:#cfe5d7}
.a16-strategy[data-tone=weak]{background:#fffdfd;border-color:#eadde0}
.a16-card-top{display:flex;justify-content:space-between;gap:10px}
.a16-name{font-size:15px;font-weight:900}
.a16-state{font-size:9px;font-weight:900;padding:5px 8px;border-radius:999px;white-space:nowrap}
.a16-state.good{background:var(--green-bg);color:var(--green)}
.a16-state.watch{background:var(--blue-bg);color:var(--blue)}
.a16-state.weak{background:var(--red-bg);color:var(--red)}
.a16-state.starve{background:var(--amber-bg);color:var(--amber)}
.a16-money{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px;padding:9px 10px;border:1px solid #edf2f6;border-radius:11px;background:#fff}
.a16-money small{display:block;font-size:8px;color:var(--muted);margin-bottom:2px}
.a16-money strong{font-size:13px}
.a16-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:8px}
.a16-kpi{padding:7px 8px;border:1px solid #edf2f6;border-radius:9px;background:#fff}
.a16-kpi span{display:block;font-size:8px;color:var(--muted)}
.a16-kpi b{font-size:10px}
.a16-legend{position:relative;margin-top:12px;padding:12px;border:1px solid var(--border);border-radius:13px;background:#fff;font-size:10px;line-height:1.7;color:var(--muted)}
.a16-legend-line{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:4px}
.a16-dot{display:inline-flex;gap:5px;align-items:center;color:#334155;font-weight:800}
.a16-dot i{display:inline-block;width:8px;height:8px;border-radius:50%}
.a16-dot.good i{background:var(--green)}.a16-dot.watch i{background:var(--blue)}.a16-dot.weak i{background:var(--red)}.a16-dot.starve i{background:var(--amber)}

/* market */
.a16-banner{margin-bottom:12px;padding:10px 12px;border-radius:12px;font-size:10px;line-height:1.6;border:1px solid #d6e3ef;background:#f7fbff;color:#38536a}
.a16-banner.warn{border-color:#ead9a7;background:#fff9e8;color:#6d5415}
.a16-market-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:12px}
.a16-outlook{font-size:28px;font-weight:950}
.a16-outlook.bullish{color:var(--green)}.a16-outlook.bearish{color:var(--red)}.a16-outlook.neutral{color:var(--blue)}
.a16-comment{font-size:12px;line-height:1.8;color:#475569;white-space:pre-wrap}
.a16-driver h4,.a16-news h3{margin:0 0 8px;font-size:14px}
.a16-driver ul{margin:0;padding-left:18px;font-size:11px;line-height:1.7;color:#526175}
.a16-news{margin-top:12px}
.a16-news-item{position:relative;display:grid;grid-template-columns:1fr auto;gap:10px;padding:14px 0;border-top:1px solid #edf2f7}
.a16-news-item:first-of-type{border-top:0}
.a16-news-title{font-size:12px;font-weight:900;line-height:1.5;color:#172033;text-decoration:none}
.a16-news-meta{font-size:9px;color:#7a8899;margin-top:3px}
.a16-news-summary{font-size:10px;line-height:1.65;color:#475569;margin-top:6px}
.a16-news-view{margin-top:7px;padding:8px 10px;border-radius:10px;background:#f8fafc;border:1px solid #e8eef5;font-size:10px;line-height:1.7;color:#334155}
.a16-news-view b{color:#0f172a}
.a16-importance{font-size:9px;color:#64748b;margin-top:5px}
.a16-chip{font-size:9px;font-weight:850;border-radius:999px;padding:4px 7px;height:max-content}
.a16-chip.pos{background:var(--green-bg);color:var(--green)}.a16-chip.neg{background:var(--red-bg);color:var(--red)}.a16-chip.neu{background:var(--blue-bg);color:var(--blue)}

/* user blocks */
.a16-user-block{position:relative;border:1px solid var(--border);border-radius:var(--radius);padding:15px;background:#fff;min-height:58px}
.a16-user-title{font-size:20px;font-weight:900}.a16-user-text{font-size:12px;line-height:1.7;color:#526175}
.a16-divider{height:1px;background:var(--border);margin:14px 0}.a16-spacer{height:48px}
.a16-user-button{display:inline-block;border:0;border-radius:10px;background:#172033;color:#fff;padding:9px 13px;font-size:11px;font-weight:900;text-decoration:none}

/* Studio */
#a16-studio{position:fixed;inset:0;z-index:5000;background:#e8edf4;display:grid;grid-template-rows:56px 1fr;color:#0f172a}
.a16-studio-top{display:flex;align-items:center;gap:8px;padding:7px 10px;background:#111827;color:#fff}
.a16-studio-brand{font-weight:950;margin-right:4px}
.a16-studio-top button,.a16-studio-top select{border:1px solid #374151;border-radius:8px;background:#1f2937;color:#fff;padding:7px 9px;font-size:10px;font-weight:800;cursor:pointer}
.a16-studio-top .publish{margin-left:auto;background:#0f766e;border-color:#0f766e}
.a16-studio-body{min-height:0;display:grid;grid-template-columns:310px 1fr}
.a16-studio-side{overflow:auto;background:#fff;border-right:1px solid #d6dee8;padding:13px}
.a16-studio-side h3{font-size:15px;margin:0 0 4px}.a16-studio-side p{font-size:9px;line-height:1.55;color:#64748b;margin:0 0 10px}
.a16-section{padding:10px 0;border-top:1px solid #edf2f7}.a16-section:first-of-type{border-top:0}
.a16-section-title{font-size:10px;font-weight:900;margin-bottom:7px}
.a16-side-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.a16-side-grid button,.a16-side-grid select,.a16-side-grid input{min-width:0;border:1px solid #dbe4ee;border-radius:8px;background:#fff;color:#172033;padding:7px;font-size:9px;font-weight:800}
.a16-side-grid button{cursor:pointer}
.a16-field{display:grid;grid-template-columns:.85fr 1.15fr;gap:7px;align-items:center;margin:6px 0;font-size:9px;color:#526175}
.a16-field input[type=color]{width:100%;height:30px;padding:2px}.a16-field input[type=range]{width:100%}
.a16-status{font-size:9px;line-height:1.5;color:#64748b}
.a16-canvas{min-width:0;min-height:0;overflow:auto;padding:18px;display:flex;justify-content:center;align-items:flex-start}
.a16-device{width:100%;height:100%;min-height:560px;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 16px 46px rgba(15,23,42,.18);transition:width .2s ease}
.a16-device[data-device=tablet]{width:820px}.a16-device[data-device=mobile]{width:390px}
#a16-preview{width:100%;height:100%;min-height:560px;border:0;background:#fff}

.a16-editable{outline:2px dashed #7695ae!important;outline-offset:2px!important;position:relative!important}
.a16-selected{outline:3px solid #0f766e!important;outline-offset:2px!important}
.a16-drag-handle{position:absolute!important;top:5px!important;right:5px!important;z-index:2147480000!important;display:flex!important;align-items:center!important;gap:4px!important;padding:5px 7px!important;border:0!important;border-radius:8px!important;background:#111827!important;color:#fff!important;font-size:8px!important;font-weight:900!important;cursor:grab!important;touch-action:none!important;user-select:none!important}
.a16-drop-before{box-shadow:inset 0 4px 0 #0f766e!important}.a16-drop-after{box-shadow:inset 0 -4px 0 #0f766e!important}

#a16-context{position:fixed;z-index:8000;min-width:185px;padding:6px;border:1px solid #dbe4ee;border-radius:12px;background:#fff;box-shadow:0 16px 40px rgba(15,23,42,.22)}
#a16-context[hidden]{display:none!important}
#a16-context button{display:block;width:100%;border:0;border-radius:8px;background:transparent;padding:8px 9px;text-align:left;font-size:10px;font-weight:800;color:#172033;cursor:pointer}
#a16-context button:hover{background:#f1f5f9}

@media(max-width:760px){
  :root{--nav-h:66px}
  .a16-nav-label{font-size:9px}.a16-nav-icon{font-size:15px}
  #a16-custom{padding:15px 10px 86px}
  .a16-strategy-grid,.a16-market-grid{grid-template-columns:1fr}
  .a16-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .a16-page-head{display:block}
}
