/* ============================================================
   LOOM — 亮色主题 · Paper Blueprint
   暖纸底 / 墨色排版 / 赭石信号 / 细网格蓝图
   ============================================================ */

:root{
  --c-scheduler:#F2A93B;
  --c-executor:#6FD8C6;
  --c-sampler:#9BB0F2;
  --c-logic:#E4D06A;
  --c-notifier:#E88C6A;
}

html[data-theme="light"]{
  color-scheme:light;

  --bg:#F1EDE2;
  --bg-2:#EAE5D7;
  --panel:#FAF7EE;
  --panel-2:#F3EFE3;
  --ink:#1B1E17;
  --muted:#596052;
  --dim:#767D6D;
  --line:#DAD3C1;
  --line-2:#C7BFAA;
  --amber:#A8620A;
  --mint:#0F7A6A;
  --blue:#4A5FA8;
  --yellow:#8A6D06;
  --coral:#B6512F;
  --red:#B33A25;

  --c-scheduler:#A8620A;
  --c-executor:#0F7A6A;
  --c-sampler:#4A5FA8;
  --c-logic:#8A6D06;
  --c-notifier:#B6512F;
}

html[data-theme="light"] body{
  background-color:var(--bg);
  color:var(--ink);
  background-image:
    linear-gradient(to right, rgba(27,30,23,.048) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27,30,23,.048) 1px, transparent 1px);
}
html[data-theme="light"] body::before{
  background:
    radial-gradient(900px 520px at 82% -8%, rgba(168,98,10,.075), transparent 62%),
    radial-gradient(760px 520px at 4% 108%, rgba(15,122,106,.055), transparent 62%);
}
html[data-theme="light"] .grain{opacity:.055; mix-blend-mode:multiply}
html[data-theme="light"] ::selection{background:rgba(168,98,10,.22); color:#1B1E17}

html[data-theme="light"] ::-webkit-scrollbar-thumb{background:#CFC7B3; border-color:var(--bg)}
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover{background:#B4AB94}

/* ---------------------------- rail ---------------------------- */
html[data-theme="light"] .rail{
  background:linear-gradient(180deg,#F9F6ED 0%,#F2EEE2 100%);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.6);
}
html[data-theme="light"] .brand-mark{background:rgba(168,98,10,.07)}
html[data-theme="light"] .brand-mark i:nth-child(1){opacity:.45}
html[data-theme="light"] .nav-item:hover{background:rgba(27,30,23,.045)}
html[data-theme="light"] .nav-item.active{
  background:linear-gradient(90deg,rgba(168,98,10,.12),rgba(168,98,10,0) 84%);
}
html[data-theme="light"] .engine{
  background:linear-gradient(160deg,#FFFDF7,#F4F0E4);
  box-shadow:0 1px 0 rgba(255,255,255,.8) inset;
}
html[data-theme="light"] .engine-bars i{
  background:linear-gradient(180deg,rgba(168,98,10,.85),rgba(168,98,10,.18));
}
html[data-theme="light"] .engine-bars i:nth-child(2n){
  background:linear-gradient(180deg,rgba(15,122,106,.7),rgba(15,122,106,.14));
}
html[data-theme="light"] .avatar{background:rgba(168,98,10,.09)}
html[data-theme="light"] .user-meta .urole{color:var(--dim)}

/* ---------------------------- topbar ---------------------------- */
html[data-theme="light"] .topbar{
  background:rgba(246,243,234,.9);
  box-shadow:0 1px 0 rgba(255,255,255,.55);
}
html[data-theme="light"] .icon-btn{background:#FBF8F0}
html[data-theme="light"] .icon-btn:hover{background:#FFFDF7; border-color:var(--line-2)}
.theme-btn .ic-moon{display:none}
html[data-theme="light"] .theme-btn .ic-sun{display:none}
html[data-theme="light"] .theme-btn .ic-moon{display:block}

/* ---------------------------- buttons ---------------------------- */
html[data-theme="light"] .btn:hover{border-color:#A9A18B; background:rgba(27,30,23,.035)}
html[data-theme="light"] .btn.primary{
  color:#FFFCF3;
  box-shadow:0 1px 0 rgba(255,255,255,.28) inset;
}
html[data-theme="light"] .btn.primary:hover{
  background:#B96F12;
  box-shadow:0 1px 0 rgba(255,255,255,.3) inset, 0 10px 24px -8px rgba(168,98,10,.4);
}
html[data-theme="light"] .btn.danger{border-color:rgba(179,58,37,.32)}
html[data-theme="light"] .btn.danger:hover{background:rgba(179,58,37,.07); border-color:rgba(179,58,37,.55)}
html[data-theme="light"] .btn.ghost{border-color:transparent}

/* ---------------------------- stats ---------------------------- */
html[data-theme="light"] .stats{
  background:linear-gradient(180deg,rgba(255,255,255,.6),rgba(255,255,255,.12));
}

/* ---------------------------- panels ---------------------------- */
html[data-theme="light"] .panel{
  background:linear-gradient(180deg,#FCF9F1,#F7F3E8);
  box-shadow:0 1px 0 rgba(255,255,255,.8) inset, 0 14px 30px -26px rgba(62,52,26,.55);
}
html[data-theme="light"] .panel-title .sq{background:var(--amber)}

/* ---------------------------- chart / summary ---------------------------- */
html[data-theme="light"] .chart-legend span{color:var(--dim)}
html[data-theme="light"] .comp-row{border-bottom-color:rgba(199,191,170,.5)}
html[data-theme="light"] .comp-row:hover{background:rgba(27,30,23,.03)}
html[data-theme="light"] .comp-row .bar{background:#E5DFCE}

/* ---------------------------- table ---------------------------- */
html[data-theme="light"] .table th{background:#F1EDE0}
html[data-theme="light"] .table td{border-bottom-color:rgba(199,191,170,.45)}
html[data-theme="light"] .table tbody tr:hover{background:rgba(27,30,23,.028)}
html[data-theme="light"] .mini-bar,
html[data-theme="light"] .track{background:#E4DECC}
html[data-theme="light"] .mini-bar i{background:linear-gradient(90deg,var(--mint),#3E9E8D)}
html[data-theme="light"] .track i{background:linear-gradient(90deg,var(--mint),var(--amber))}
html[data-theme="light"] .mini-pipe .mn{box-shadow:0 0 0 1px rgba(255,255,255,.5) inset}

/* status pills */
html[data-theme="light"] .status-pill.running{
  color:var(--amber);
  border-color:color-mix(in srgb,var(--amber) 34%,transparent);
  background:color-mix(in srgb,var(--amber) 7%,transparent);
}
html[data-theme="light"] .status-pill.success{
  color:var(--mint);
  border-color:color-mix(in srgb,var(--mint) 30%,transparent);
  background:color-mix(in srgb,var(--mint) 6%,transparent);
}
html[data-theme="light"] .status-pill.fail{
  color:var(--red);
  border-color:color-mix(in srgb,var(--red) 30%,transparent);
  background:color-mix(in srgb,var(--red) 6%,transparent);
}

/* ---------------------------- toolbar / tabs ---------------------------- */
html[data-theme="light"] .toolbar{background:#F6F2E6}
html[data-theme="light"] .tab:hover{color:var(--ink)}
html[data-theme="light"] .tab.active{color:var(--ink)}

/* ---------------------------- registry ---------------------------- */
html[data-theme="light"] .reg-card{
  background:
    linear-gradient(150deg,color-mix(in srgb,var(--c) 7%,transparent),transparent 42%),
    linear-gradient(180deg,#FFFDF7,#F7F3E8);
  box-shadow:0 1px 0 rgba(255,255,255,.8) inset;
}
html[data-theme="light"] .reg-card:hover{
  border-color:color-mix(in srgb,var(--c) 42%,var(--line));
  box-shadow:0 18px 36px -20px rgba(62,52,26,.45);
}
html[data-theme="light"] .param-chips span{background:rgba(255,255,255,.55)}
html[data-theme="light"] .switch{background:#E8E2D2}
html[data-theme="light"] .switch::after{background:#9C9C8C}
html[data-theme="light"] .switch.on{
  border-color:color-mix(in srgb,var(--mint) 45%,transparent);
  background:color-mix(in srgb,var(--mint) 10%,transparent);
}
html[data-theme="light"] .switch.on::after{background:var(--mint)}

/* ---------------------------- compose ---------------------------- */
html[data-theme="light"] .meta-strip{background:#F7F3E8}
html[data-theme="light"] .steps{background:linear-gradient(180deg,#FBF8F0,#F5F1E5)}
html[data-theme="light"] .step:hover{background:rgba(27,30,23,.03)}
html[data-theme="light"] .step.active{background:rgba(168,98,10,.06)}

html[data-theme="light"] .input{
  background-color:#FFFDF7;
  border-color:#CCC4AF;
  color:var(--ink);
}
html[data-theme="light"] .input::placeholder{color:#A7A28F}
html[data-theme="light"] .input:focus{
  border-color:color-mix(in srgb,var(--amber) 72%,transparent);
  box-shadow:0 0 0 3px rgba(168,98,10,.1);
}
html[data-theme="light"] select.input{
  background-color:#FFFDF7;
  background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:calc(100% - 14px) 50%,calc(100% - 9px) 50%;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
}

html[data-theme="light"] .pick{background:rgba(255,255,255,.55)}
html[data-theme="light"] .pick:hover{border-color:#A9A18B}
html[data-theme="light"] .pick:has(input:checked){
  border-color:color-mix(in srgb,var(--amber) 55%,transparent);
  background:rgba(168,98,10,.06);
}
html[data-theme="light"] .pick:has(input:checked) .tick{
  background:var(--amber);
  border-color:var(--amber);
  color:#FFFCF3;
}

html[data-theme="light"] .sampler-row{background:rgba(255,255,255,.5)}
html[data-theme="light"] .icon-mini{background:#FBF8F0}
html[data-theme="light"] .icon-mini:hover{background:rgba(179,58,37,.06)}

html[data-theme="light"] .pnode{background:linear-gradient(180deg,rgba(255,255,255,.78),rgba(255,255,255,.35))}
html[data-theme="light"] .chip{background:rgba(255,255,255,.55)}
html[data-theme="light"] .chip:hover{background:rgba(168,98,10,.06)}
html[data-theme="light"] .empty-hint{background:rgba(255,255,255,.25)}

/* ---------------------------- logs ---------------------------- */
html[data-theme="light"] .seg{background:#EFEADD}
html[data-theme="light"] .seg button.active{background:rgba(168,98,10,.13)}
html[data-theme="light"] .log-toolbar{background:#F5F1E6}
html[data-theme="light"] .facet:hover{background:rgba(27,30,23,.04)}
html[data-theme="light"] .facet.active{background:rgba(168,98,10,.06); border-color:rgba(168,98,10,.18)}
html[data-theme="light"] .live-toggle{background:#FBF8F0}
html[data-theme="light"] .live-toggle.on{
  color:var(--mint);
  border-color:color-mix(in srgb,var(--mint) 42%,transparent);
  background:color-mix(in srgb,var(--mint) 7%,transparent);
}
html[data-theme="light"] .log-stream{background:#FCFAF3}
html[data-theme="light"] .log-group-head{background:#F2EEE1}
html[data-theme="light"] .log-row{border-bottom-color:rgba(199,191,170,.45)}
html[data-theme="light"] .log-row:hover{background:rgba(27,30,23,.032)}
html[data-theme="light"] .lg-time{color:#9A9A88}
html[data-theme="light"] .lg-msg{color:#333A2E}
html[data-theme="light"] .lg-msg b{color:var(--ink)}
html[data-theme="light"] .empty{background:rgba(255,255,255,.4)}

/* ---------------------------- statusbar ---------------------------- */
html[data-theme="light"] .statusbar{
  background:rgba(241,237,226,.95);
  color:var(--dim);
}
html[data-theme="light"] .sb-ticker{color:#8B8F7E}

/* ---------------------------- modal / toast ---------------------------- */
html[data-theme="light"] .modal-root{background:rgba(52,45,30,.34)}
html[data-theme="light"] .modal{
  background:linear-gradient(180deg,#FBF8F0,#F6F2E7);
  box-shadow:0 40px 90px rgba(62,52,26,.35), 0 0 0 1px rgba(168,98,10,.06);
}
html[data-theme="light"] .modal-head{background:#F3EFE2}
html[data-theme="light"] .close-x{background:#FBF8F0}
html[data-theme="light"] .kv > div:nth-child(odd){background:rgba(27,30,23,.025)}
html[data-theme="light"] .code-block{
  background:#22261E;
  border-color:#2E342A;
  color:#BFDCA9;
}
html[data-theme="light"] .toast{
  background:#FFFDF7;
  border-color:var(--line-2);
  box-shadow:0 16px 34px -12px rgba(62,52,26,.3);
}
html[data-theme="light"] .toast.ok{border-left-color:var(--mint)}
html[data-theme="light"] .toast.err{border-left-color:var(--red)}

/* 亮色主题下的登录页 */
html[data-theme="light"] .auth-root{background:var(--bg)}
html[data-theme="light"] .auth-root::before{
  background:
    radial-gradient(760px 480px at 12% 6%, rgba(168,98,10,.10), transparent 62%),
    radial-gradient(680px 460px at 92% 96%, rgba(15,122,106,.08), transparent 62%);
}
html[data-theme="light"] .auth-brand{
  background-image:
    linear-gradient(to right, rgba(27,30,23,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27,30,23,.035) 1px, transparent 1px);
}
html[data-theme="light"] .auth-stages li{background:var(--panel-2)}
html[data-theme="light"] .auth-field input{background:var(--panel)}
html[data-theme="light"] .auth-field input:focus{box-shadow:0 0 0 3px rgba(168,98,10,.12)}
