      :root {
        color-scheme: light;
        --bg: #fff8f1;
        --card: rgba(255, 255, 255, 0.18);
        --card-2: rgba(255, 255, 255, 0.14);
        --line: rgba(255, 255, 255, 0.42);
        --text: #2d2b32;
        --muted: #7b7580;
        --accent: #f6b989;
        --accent-2: #b8c4ef;
        --good: #72b98f;
        --warn: #c58a2f;
        --danger: #df6f6f;
        --shadow: 0 24px 80px rgba(90, 94, 120, 0.13);
        font-family:
          Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
      }

      * { box-sizing: border-box; }
      body {
        margin: 0;
        min-height: 100vh;
        color: var(--text);
        background:
          radial-gradient(circle at 18% 0%, rgba(246, 185, 137, 0.5), transparent 34rem),
          radial-gradient(circle at 88% 8%, rgba(184, 196, 239, 0.56), transparent 30rem),
          linear-gradient(135deg, #fff8f1, #f7f1ff 58%, #fffaf4);
      }

      header {
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 10px clamp(16px, 4vw, 44px);
        backdrop-filter: blur(22px) saturate(1.45);
        background: rgba(255, 249, 242, 0.72);
        border-bottom: 1px solid var(--line);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
      }

      h1 { margin: 0; font-size: clamp(24px, 4vw, 42px); letter-spacing: -0.04em; }
      .header-actions { display: flex; gap: 8px; flex-shrink: 0; }
      .export-btn {
        width: auto;
        padding: 8px 14px;
        border-radius: 14px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
      }
      .img-btn, .txt-btn { background: rgba(255,255,255,0.22); border: 1px solid rgba(255,255,255,0.44); color: var(--text); }
      .img-btn:hover, .txt-btn:hover { background: rgba(255,255,255,0.32); }
      h2 { margin: 0 0 14px; font-size: 20px; }
      h3 { margin: 14px 0 10px; color: var(--muted); font-size: 14px; font-weight: 700; }
      p { color: var(--muted); margin: 8px 0 0; }

      main { padding: 24px clamp(16px, 4vw, 44px) 56px; }
      .grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; align-items: start; }
      .card {
        grid-column: span 6;
        padding: 18px;
        border: 1px solid var(--line);
        border-radius: 28px;
        background: var(--card);
        box-shadow: var(--shadow);
        backdrop-filter: blur(34px) saturate(1.65);
        -webkit-backdrop-filter: blur(34px) saturate(1.65);
      }
      .wide { grid-column: 1 / -1; }
      .third { grid-column: span 4; }

      .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
      .team-slots {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
      }
      .team-slot {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 8px;
        padding: 10px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.24);
        cursor: pointer;
      }
      .team-slot-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 700;
      }
      .team-slot-btns {
        display: inline-flex;
        gap: 4px;
        flex-shrink: 0;
      }
      .team-slot-rename,
      .team-slot-confirm,
      .team-slot-copy {
        width: 26px;
        height: 26px;
        min-width: 26px;
        padding: 0;
        border-radius: 12px;
        font-size: 14px;
        line-height: 1;
        flex-shrink: 0;
      }
      .team-slot.active {
        border-color: rgba(246, 185, 137, 0.95);
        box-shadow: 0 0 0 3px rgba(246, 185, 137, 0.16);
      }
      label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
      input, select, button {
        width: 100%;
        border: 1px solid rgba(255, 255, 255, 0.11);
        border-radius: 16px;
        color: var(--text);
        background: rgba(255, 255, 255, 0.24);
        padding: 11px 12px;
        outline: none;
        font: inherit;
      }
      input:focus, select:focus { border-color: rgba(184, 196, 239, 0.9); box-shadow: 0 0 0 4px rgba(184, 196, 239, 0.22); }
      input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
      #questStatus { width: auto; min-width: 0; flex: 0 0 auto; padding: 4px 10px; font-size: 12px; border: none; background: transparent; color: var(--muted); }
      button { cursor: pointer; background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.44); font-weight: 800; color: #2d2b32; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }

      .row { display: grid; grid-template-columns: 0.7fr 0.85fr 0.5fr repeat(3, auto) 0.95fr 1.4fr; gap: 2px; align-items: end; margin-bottom: 8px; }
      .row.debuff { grid-template-columns: 0.7fr 0.85fr 0.5fr repeat(4, auto) 0.95fr 1.5fr; }
      .row .checks { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
      .add-row-btn {
        width: 100%;
        margin-top: 6px;
        padding: 8px;
        border-radius: 14px;
        font-size: 13px;
        color: var(--muted);
        background: rgba(255, 255, 255, 0.12);
        border: 1px dashed rgba(255, 255, 255, 0.32);
        cursor: pointer;
      }
      .add-row-btn:hover { color: var(--text); border-color: rgba(184, 196, 239, 0.6); background: rgba(255, 255, 255, 0.2); }
      .row-result {
        align-self: center;
        text-align: right;
        font-weight: 800;
        font-size: 14px;
        color: var(--accent);
        padding: 4px 6px;
      }
      .inline-stats {
        display: flex;
        gap: 2px;
        align-items: center;
        flex-wrap: nowrap;
        font-size: 11px;
        color: var(--muted);
      }
      .inline-stats input { width: auto; min-width: 0; padding: 4px 2px; }
      .row-del-btn {
        width: 20px;
        height: 20px;
        padding: 0;
        border-radius: 10px;
        font-size: 12px;
        line-height: 1;
        flex-shrink: 0;
        background: rgba(223, 111, 111, 0.15);
        border: 1px solid rgba(223, 111, 111, 0.3);
        color: var(--danger);
        cursor: pointer;
      }
      .row label { min-width: 0; }
      .row input[data-k="max"],
      .row input[data-k="min"],
      .row input[data-k="orb"],
      .row input[data-k="gap"] { width: 80px; min-width: 0; max-width: 80px; padding: 6px 4px; justify-self: start; }
      .row .checks,
      .row .inline-stats { align-self: center; }
      .check-pill { display: inline-flex; align-items: center; gap: 2px; padding: 4px 5px; border-radius: 999px; background: rgba(255,255,255,.2); color: var(--muted); border: 1px solid rgba(255,255,255,.34); }
      .check-pill span { font-size: 12px; }
      .orb-pill { justify-self: start; align-self: center; }
      .orb-pill input { width: 20px; height: 20px; }

      .result { display: grid; gap: 10px; align-self: stretch; }
      .result .fields { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
      .metric { padding: 14px; border-radius: 22px; background: var(--card-2); border: 1px solid var(--line); backdrop-filter: blur(22px) saturate(1.45); -webkit-backdrop-filter: blur(22px) saturate(1.45); }
      .member-card { cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
      .member-card.active { border-color: rgba(246, 185, 137, .92); box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 0 0 4px rgba(246, 185, 137, .18), 0 18px 50px rgba(184,196,239,.2); transform: translateY(-1px); }
      .member-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
      .member-title strong { color: var(--text); font-size: 14px; }
      .metric strong { display: block; font-size: clamp(22px, 4vw, 36px); letter-spacing: -0.03em; }
      .calc-breakdown .metric strong { font-size: clamp(16px, 2.5vw, 22px); }
      .calc-breakdown .fields { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
      .metric span { color: var(--muted); font-size: 13px; }
      .accent { color: var(--accent); }
      .blue { color: var(--accent-2); }
      .green { color: var(--good); }

      .tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
      .tab { width: auto; padding: 10px 16px; background: rgba(255,255,255,.16); box-shadow: 0 12px 36px rgba(90, 94, 120, 0.1); }
      .tab.active { background: rgba(255,255,255,.26); color: #2d2b32; border-color: rgba(255,255,255,.7); box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 16px 44px rgba(90,94,120,.14); }
      .panel { display: none; }
      .panel.active { display: block; }
      .hint { font-size: 12px; color: var(--muted); }
      .compact { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
      .skill-detail {
        grid-column: 1 / -1;
        padding: 12px 14px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.16);
        border: 1px solid rgba(255, 255, 255, 0.32);
        color: var(--muted);
      }
      .skill-detail summary {
        cursor: pointer;
        color: var(--text);
        font-weight: 800;
      }
      .skill-detail-body {
        display: grid;
        gap: 6px;
        margin-top: 10px;
        font-size: 13px;
        line-height: 1.55;
      }
      .toast {
        position: fixed;
        left: 50%;
        top: auto;
        bottom: 20px;
        transform: translateX(-50%);
        display: inline-block;
        padding: 6px 14px;
        width: auto;
        height: fit-content;
        max-height: 32px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.8);
        color: var(--text);
        font-size: 13px;
        font-weight: 500;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.15s ease, visibility 0.15s;
        z-index: 9999;
      }
      .toast.visible {
        opacity: 1;
        visibility: visible;
      }

      .copy-modal {
        position: fixed;
        inset: 0;
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .copy-modal-bg {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
      }
      .copy-modal-card {
        position: relative;
        padding: 20px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
        text-align: center;
        min-width: 220px;
      }
      .copy-modal-card p {
        margin: 0 0 12px;
        font-size: 14px;
        font-weight: 700;
      }
      .copy-slot-btn {
        display: block;
        width: 100%;
        margin: 4px 0;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 13px;
      }
      #copyModalCancel {
        margin-top: 10px;
        padding: 6px 16px;
        border-radius: 10px;
        font-size: 12px;
        width: auto;
      }

      @media (max-width: 980px) {
        .card, .third { grid-column: 1 / -1; }
        .row, .row.debuff { grid-template-columns: 1fr 1fr; }
        .team-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .team-slot { padding: 8px 6px; border-radius: 14px; }
        .team-slot-name { font-size: 13px; }
        .team-slot-rename,
        .team-slot-confirm,
        .team-slot-copy { width: 22px; height: 22px; min-width: 22px; font-size: 12px; border-radius: 10px; }
      }
      @media (max-width: 480px) {
        .team-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      }
