/* ============================================================
   流萤「春日手信」 DSH 皮肤样板 · 单版（春信 · 晨光）
   参照 @smalltailqwq/dsh-client-ui-skin-maid-atelier 的形态：
     全幅背景插画 → 半透明面板 → 立绘压在界面上
   ============================================================ */

:root {
  /* ---- 取自官方立绘的配色（见 README 的取样表） ---- */
  --canvas:        #F2EFE3;
  --canvas-2:      #FAF8F0;
  --surface:       rgba(255, 253, 247, .55);
  --surface-2:     rgba(255, 255, 255, .55);
  --surface-solid: #FFFDF7;
  --line:          rgba(255, 255, 255, .88);
  --line-soft:     rgba(150, 175, 145, .30);

  --ink:           #2C3A31;
  --ink-2:         #67766C;
  --ink-3:         #93A096;

  --accent:        #7FA85C;   /* 春草绿：领结 / 主按钮 */
  --accent-strong: #5C8A4A;
  --accent-soft:   #CFE0BC;
  --accent-tint:   rgba(237, 244, 227, .88);

  --sakura:        #E8A9B8;   /* 樱粉点缀 */
  --glow:          #A9E38C;   /* 萤火 */
  --plaid-a:       #8E9691;   /* 灰格纹 */
  --plaid-b:       #C3C8C0;

  --blur:          blur(7px) saturate(130%);
  --shadow:        0 20px 46px -26px rgba(52, 70, 52, .48);
  --shadow-soft:   0 10px 26px -18px rgba(52, 70, 52, .40);

  --radius-lg: 22px;
  --font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 1920px; height: 1080px; overflow: hidden;
  font-family: var(--font); color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   1. 背景层：春日橱窗（原创 SVG 场景）
   ============================================================ */
.scene {
  position: absolute; inset: 0; z-index: 0;
  display: block;
  background:
    radial-gradient(1200px 700px at 74% 12%, #FFFDF4, transparent 62%),
    radial-gradient(900px 640px at 10% 88%, rgba(207, 224, 188, .75), transparent 62%),
    linear-gradient(158deg, #FAF8F0, #EDEADB 58%, #E7EBDD);
}
.scene .s-line  { fill: none; stroke: #93A886; stroke-width: 2; }
.scene .s-line2 { fill: none; stroke: #A8BC98; stroke-width: 1.4; }
.scene .s-pane  { fill: #FFF8E2; }
.scene .s-glow  { fill: #FFEFC0; opacity: .9; }
.scene .s-ray   { fill: #FFE9A8; opacity: .38; }
.scene .s-iron  { fill: none; stroke: #4A5450; stroke-width: 6; stroke-linecap: round; }
.scene .s-board { fill: #FBF6E6; stroke: #4A5450; stroke-width: 5; }
.scene .s-leaf  { fill: #93B87A; }
.scene .s-leaf2 { fill: #B7D19E; }
.scene .s-bloom { fill: #F2B4C4; }
.scene .s-bloom2{ fill: #FFFBFD; }
.scene .s-box   { fill: #C0AC8B; stroke: #9C8863; stroke-width: 2.5; }
.scene .s-floor { fill: #DFDCC7; opacity: .6; }

/* ============================================================
   2. 应用框架（面板半透明，背景透出来）
   ============================================================ */
.app {
  position: absolute; inset: 0; z-index: 2;
  display: flex; gap: 18px; padding: 26px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}

/* ---- 最左图标栏 ---- */
.rail {
  width: 62px; flex: 0 0 62px;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 12px 0;
}
.rail .logo {
  width: 38px; height: 38px; border-radius: 12px; margin-bottom: 14px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(150deg, var(--accent-soft), var(--accent));
}
.rail .ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-2);
}
.rail .ico.on { background: var(--accent-tint); color: var(--accent-strong); }
.rail .spacer { flex: 1; }

/* ---- 侧栏 ---- */
.side {
  width: 322px; flex: 0 0 322px;
  display: flex; flex-direction: column; overflow: hidden;
}
.collar { position: relative; height: 82px; flex: 0 0 82px; overflow: hidden;
  border-bottom: 1px solid var(--line-soft); }
.collar svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.collar .collar-fill   { fill: rgba(255, 255, 255, .92); }
.collar .collar-trim   { fill: none; stroke: var(--accent-soft); stroke-width: 3; }
.collar .collar-stripe { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .55; }

.bow { position: absolute; pointer-events: none; }
.bow .loop { fill: var(--accent); }
.bow .knot { fill: var(--accent-strong); }
.collar-bow   { left: 50%; transform: translateX(-50%); top: 46px; width: 46px; height: 27px; }
.composer-bow { left: 50%; transform: translateX(-50%); top: -13px; width: 38px; height: 22px; }

.side-head { display: flex; align-items: center; padding: 16px 18px 10px; }
.newchat {
  display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 16px;
  border-radius: 12px; font-size: 14.5px; font-weight: 600;
  background: var(--accent-tint); border: 1px solid var(--accent-soft); color: var(--accent-strong);
}
.side-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 6px; font-size: 12.5px; letter-spacing: .06em; color: var(--ink-3);
}
.side-label .tools { display: flex; gap: 12px; }
.workspace {
  display: flex; align-items: center; gap: 8px; margin: 2px 12px 10px; padding: 9px 12px;
  border-radius: 11px; background: var(--surface-2); font-size: 13px; color: var(--ink-2);
}
.workspace b { color: var(--ink); font-weight: 600; }
.sessions { flex: 1; padding: 0 10px; }
.session {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 11px; font-size: 13.5px; color: var(--ink-2);
}
.session .t { font-size: 11.5px; color: var(--ink-3); }
.session.on {
  background: var(--accent-tint); border: 1px solid var(--accent-soft);
  color: var(--ink); font-weight: 600;
}
.session.dot { padding-left: 16px; }
.session.dot::before {
  content: ""; position: absolute; left: 3px; top: 50%; margin-top: -2.5px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--sakura);
}
.side-foot {
  display: flex; align-items: center; gap: 9px; padding: 12px 18px 16px;
  border-top: 1px solid var(--line-soft); font-size: 13.5px; color: var(--ink-2);
}

/* ---- 主区 ---- */
.main {
  flex: 1; position: relative; display: flex; flex-direction: column; overflow: hidden;
}
.topbar {
  height: 66px; flex: 0 0 66px; display: flex; align-items: center; gap: 16px;
  padding: 0 22px; border-bottom: 1px solid var(--line-soft);
}
.title { font-size: 15px; font-weight: 700; }
.chipmod {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: 12px; color: var(--ink-2);
}
.tabs { display: flex; gap: 20px; margin-left: 14px; font-size: 13.5px; }
.tab { color: var(--ink-3); padding-bottom: 4px; }
.tab.on { color: var(--accent-strong); font-weight: 600; border-bottom: 2px solid var(--accent); }
.topbar .right { margin-left: auto; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: 10px; border: 1px solid var(--line-soft); background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-2);
}
.main-collar {
  position: absolute; left: 0; right: 0; top: 66px; height: 4px; z-index: 1;
  background: linear-gradient(90deg, transparent, var(--accent-soft) 24%, var(--accent) 50%,
                              var(--accent-soft) 76%, transparent);
  opacity: .9;
}

/* 聊天区：中间留白给立绘让位 */
.chat { flex: 1; position: relative; display: flex; }
.welcome {
  margin: auto; transform: translateX(52px);
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
}
.welcome .crest {
  width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center;
  background: linear-gradient(150deg, #fff, var(--accent-tint));
  border: 1px solid var(--accent-soft);
  box-shadow: 0 16px 34px -20px rgba(70, 110, 70, .60);
}
.welcome h1 {
  font-size: 32px; font-weight: 700; letter-spacing: .05em;
  background: linear-gradient(96deg, var(--ink), var(--accent-strong));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.welcome .sub { font-size: 12.5px; color: var(--ink-3); letter-spacing: .14em; }
.welcome .picks { display: flex; gap: 10px; margin-top: 4px; }
.pick {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-soft); font-size: 12.5px; color: var(--ink-2);
}

/* 输入区：窄一点、居中，和女仆皮肤一样给两侧立绘让路 */
.composer-wrap { padding: 0 0 12px; display: flex; justify-content: center; }
.composer {
  position: relative; width: 640px; padding: 16px 18px 12px; border-radius: 18px;
  background: rgba(255, 255, 255, .90); border: 1.5px solid var(--accent-soft);
  box-shadow: 0 18px 38px -26px rgba(60, 90, 60, .60);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.composer .ph { font-size: 14px; color: var(--ink-3); padding: 4px 2px 22px; }
.composer .row { display: flex; align-items: center; gap: 10px; }
.composer .row .sp { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
.pill.plus { width: 32px; padding: 0; justify-content: center; font-size: 17px; }
.pill.model { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.send {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; box-shadow: 0 8px 18px -8px rgba(70, 130, 80, .8);
}
.stats {
  display: flex; justify-content: center; gap: 22px; padding: 0 0 20px;
  font-size: 11.5px; color: var(--ink-3);
}
.stats b { color: var(--ink-2); font-weight: 600; }

/* ============================================================
   3. 立绘层（压在界面之上）
   ============================================================ */
.char {
  position: absolute; bottom: 0; z-index: 4;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 26px 30px rgba(48, 62, 48, .28));
}
.char.left  { left: 418px;  bottom: -52px; width: 612px; }
.char.right { right: 10px;  bottom: -16px; width: 452px; opacity: .96; transform: scaleX(-1); }

/* ============================================================
   4. 天气层：花瓣 + 萤火
   ============================================================ */
.weather { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.weather .petal  { fill: #F1BDCB; opacity: .62; }
.weather .petal2 { fill: #CFE0BC; opacity: .72; }
.weather .fly    { fill: var(--glow); }
.weather .halo   { fill: var(--glow); opacity: .20; }

/* 署名 */
.credit {
  position: absolute; right: 30px; bottom: 14px; z-index: 6;
  font-size: 10.5px; letter-spacing: .04em; color: rgba(70, 88, 72, .62);
  text-shadow: 0 1px 4px rgba(255, 255, 255, .95);
}
