:root {
    --ink: #101b35;
    --muted: #71809a;
    --line: #dce5f1;
    --soft: #edf4ff;
    --blue: #1267ff;
    --green: #11b978;
    --danger: #ef4444;
    --canvas: #f5f9ff;
    --shadow: 0 18px 46px rgba(36, 59, 97, .08);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--ink);
}
* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
body { margin: 0; min-width: 1120px; background: linear-gradient(180deg, #fbfdff 0%, var(--canvas) 100%); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; color: inherit; }
[hidden] { display: none !important; }

.settings-shell { min-height: 100vh; display: grid; grid-template-columns: 72px minmax(0, 1fr); }
.product-rail {
    position: sticky; top: 0; z-index: 30; height: 100vh; padding: 18px 12px;
    border-right: 1px solid #e5edf8; background: #fff; display: flex; flex-direction: column;
    align-items: center; gap: 10px; color: #556780;
}
.brand-mark { width: 42px; height: 42px; margin-bottom: 14px; display: grid; place-items: center; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.rail-link {
    position: relative; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
    color: inherit; text-decoration: none; transition: .16s ease;
}
.rail-link svg { width: 20px; height: 20px; }
.rail-link span {
    position: absolute; left: 68px; z-index: 80; width: max-content; padding: 7px 10px; border-radius: 9px;
    color: #fff; background: #15223a; font-size: 11px; font-weight: 800; opacity: 0;
    pointer-events: none; transform: translateX(-5px); transition: .16s ease;
}
.rail-link:hover, .rail-link.active { color: var(--blue); background: #eef5ff; }
.rail-link:hover span { opacity: 1; transform: translateX(0); }
.rail-link.active::before {
    content: ""; position: absolute; left: -12px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--blue);
}
.account-anchor { position: relative; margin-top: auto; }
.account-button {
    position: relative; width: 42px; height: 42px; padding: 0; border: 2px solid #dce7f6; border-radius: 50%;
    background: linear-gradient(145deg, #2d70ff, #554fe8); color: #fff; display: grid; place-items: center;
    overflow: hidden; font-weight: 850; box-shadow: 0 10px 24px rgba(18, 103, 255, .12);
}
.account-button.has-avatar { color: var(--ink); background: #fff; }
.account-button > #accountAvatar { width: 100%; height: 100%; border-radius: inherit; display: grid; place-items: center; background-size: cover; background-position: center; }
.account-popover {
    position: absolute; left: 56px; bottom: 0; z-index: 120; width: 336px; padding: 14px;
    border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 22px 58px rgba(23,36,59,.16);
}
.account-summary { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding-bottom: 11px; border-bottom: 1px solid #eaf0f7; }
.account-avatar-large { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--soft); background-size: cover; background-position: center; font-weight: 850; }
.account-summary strong, .account-summary span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.popover-action { width: 100%; min-height: 38px; margin-top: 8px; border: 0; border-radius: 11px; background: transparent; display: flex; align-items: center; gap: 9px; }
.popover-action:hover { background: #f4f7fb; }
.popover-action.danger { color: var(--danger); }

.settings-main { min-height: 100vh; padding: 42px clamp(28px, 4vw, 58px) 36px; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--blue); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.settings-health {
    min-width: 174px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
    background: #fff; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow);
}
.health-dot { width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 6px rgba(245, 158, 11, .11); }
.health-dot.ok { background: var(--green); box-shadow: 0 0 0 6px rgba(17, 185, 120, .12); }
.settings-health strong, .settings-health small { display: block; }
.settings-health small { margin-top: 2px; color: var(--muted); font-size: 12px; }

.settings-grid { max-width: 1420px; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav {
    position: sticky; top: 42px; margin-top: 20px; padding: 9px; border: 1px solid var(--line); border-radius: 16px;
    background: rgba(255,255,255,.9); box-shadow: 0 14px 34px rgba(36,59,97,.07); display: grid; gap: 7px;
}
.settings-nav button {
    min-height: 38px; padding: 0 11px; border: 0; border-radius: 11px; background: transparent;
    display: inline-flex; align-items: center; gap: 10px; color: #52627b; font-weight: 850; text-align: left;
}
.settings-nav button.active, .settings-nav button:hover { color: var(--blue); background: #eef5ff; }
.settings-section { display: none; }
.settings-section.active { display: grid; gap: 14px; }
.section-heading {
    min-height: 46px; display: flex; align-items: center; justify-content: flex-end; gap: 18px;
}
.section-heading h2 { margin: 0; font-size: 22px; letter-spacing: 0; }
.section-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.settings-card {
    border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.94);
    box-shadow: 0 14px 36px rgba(36, 59, 97, .065);
}
.model-tabs {
    width: max-content; padding: 4px; border: 1px solid #dce6f5; border-radius: 13px; background: #eef4fc;
    display: inline-flex; gap: 3px;
}
.model-tabs button {
    min-height: 34px; padding: 0 18px; border: 0; border-radius: 10px; background: transparent;
    color: #54647c; font-weight: 850;
}
.model-tabs button.active { color: var(--blue); background: #fff; box-shadow: 0 8px 18px rgba(35,58,92,.08); }
.model-use-card {
    max-width: 920px; padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.model-use-card h3 { margin: 0; font-size: 16px; }
.model-use-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.default-model-chip {
    min-height: 38px; padding: 0 12px 0 14px; border: 1px solid #cfe0f6; border-radius: 12px;
    display: inline-flex; align-items: center; gap: 8px; color: #284260; background: #f6f9fe; font-weight: 900;
}
.default-model-chip:hover, .default-model-chip[aria-expanded="true"] {
    color: var(--blue);
    border-color: #9fc0ff;
    background: #eef5ff;
}
.default-model-picker { position: relative; flex: 0 0 auto; }
.default-model-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 150;
    width: 310px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 48px rgba(24, 42, 73, .15);
    display: grid;
    gap: 6px;
}
.default-model-option {
    min-height: 42px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 9px;
    text-align: left;
    color: #33445f;
    font-weight: 850;
}
.default-model-option img { width: 24px; height: 24px; object-fit: contain; }
.default-model-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.default-model-option:hover, .default-model-option.active { color: var(--blue); background: #eef5ff; }
.default-model-empty { margin: 4px; color: var(--muted); font-size: 12px; font-weight: 780; }
.model-usage-card {
    max-width: 1220px;
    padding: 22px 24px 26px;
    display: grid;
    gap: 18px;
    background: rgba(255,255,255,.96);
}
.usage-card-heading, .usage-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.usage-card-heading h3 { margin: 0; font-size: 24px; }
.usage-panel h4 { margin: 0; font-size: 15px; }
.usage-card-heading p { margin: 6px 0 0; color: #64748b; font-size: 13px; }
.usage-range-tabs {
    width: max-content;
    max-width: 100%;
    padding: 3px;
    border: 1px solid #dce6f5;
    border-radius: 12px;
    background: #fff;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    box-shadow: 0 8px 20px rgba(35, 58, 92, .04);
}
.usage-range-tabs button {
    min-height: 38px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #52627b;
    font-weight: 900;
}
.usage-range-tabs button.active {
    color: #fff;
    background: linear-gradient(180deg, #4a91ff 0%, #1267ff 100%);
    box-shadow: 0 12px 22px rgba(18, 103, 255, .2);
}
.usage-custom-range {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.usage-custom-range label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #625978;
    font-size: 12px;
    font-weight: 850;
}
.usage-custom-range input {
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d7d0e8;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}
.usage-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.usage-summary-grid div {
    position: relative;
    overflow: hidden;
    min-height: 114px;
    padding: 21px 98px 21px 24px;
    border: 1px solid #dfe8f5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(36, 59, 97, .055);
}
.usage-summary-grid span, .usage-summary-grid strong { display: block; }
.usage-summary-grid span { position: relative; z-index: 1; color: #52627b; font-size: 13px; font-weight: 850; }
.usage-summary-grid strong { position: relative; z-index: 1; margin-top: 16px; font-size: 28px; font-weight: 950; letter-spacing: 0; }
.usage-summary-grid svg {
    position: absolute;
    right: 28px;
    top: 50%;
    z-index: 1;
    width: 46px;
    height: 46px;
    padding: 10px;
    border-radius: 16px;
    color: #1267ff;
    background: #edf4ff;
    transform: translateY(-50%);
}
.usage-summary-grid div:nth-child(2) svg { color: #10a6a0; background: #ecfbf8; }
.usage-summary-grid div:nth-child(3) svg { color: #8b5cf6; background: #f3efff; }
.usage-panel {
    padding: 18px 20px 20px;
    border: 1px solid #dfe8f5;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(36, 59, 97, .045);
}
.heatmap-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}
.heatmap-legend i {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #edf4ff;
}
.heatmap-legend i:nth-of-type(2) { background: #cfe0ff; }
.heatmap-legend i:nth-of-type(3) { background: #92bbff; }
.heatmap-legend i:nth-of-type(4) { background: #4f91ff; }
.heatmap-legend i:nth-of-type(5) { background: #1267ff; }
.usage-heatmap {
    margin-top: 16px;
    display: grid;
    grid-template-rows: repeat(5, 16px);
    grid-auto-flow: column;
    grid-auto-columns: 16px;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.usage-day {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 4px;
    background: #edf4ff;
    transition: transform .08s ease, box-shadow .08s ease, outline-color .08s ease;
}
.usage-day.level-1 { background: #cfe0ff; }
.usage-day.level-2 { background: #92bbff; }
.usage-day.level-3 { background: #4f91ff; }
.usage-day.level-4 { background: #1267ff; }
.usage-day:hover { transform: translateY(-1px); outline: 2px solid rgba(18, 103, 255, .38); outline-offset: 2px; }
.usage-tooltip {
    position: fixed;
    z-index: 260;
    min-width: 184px;
    padding: 13px 14px;
    border: 1px solid rgba(198, 215, 239, .96);
    border-radius: 14px;
    background: rgba(255,255,255,.99);
    box-shadow: 0 18px 44px rgba(18, 36, 66, .16);
    color: var(--ink);
    pointer-events: none;
    opacity: 0;
    transform: translateY(2px) scale(.99);
    transition: opacity .02s ease, transform .02s ease;
}
.usage-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.usage-tooltip strong, .usage-tooltip span { display: block; }
.usage-tooltip strong { margin-bottom: 8px; font-size: 14px; font-weight: 950; }
.usage-tooltip span { color: #52627b; font-size: 12px; line-height: 1.9; font-weight: 780; }
.model-usage-panel {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    align-items: center;
    gap: 28px;
}
.usage-donut {
    --donut-color: #4798e7;
    width: 190px;
    height: 190px;
    margin: 26px 0 14px;
    border-radius: 50%;
    background: conic-gradient(var(--donut-color) var(--donut-percent, 0%), #edf3ff 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
}
.usage-donut::after {
    content: "";
    position: absolute;
    inset: 36px;
    border-radius: 50%;
    background: #fff;
}
.usage-donut strong, .usage-donut span { position: relative; z-index: 1; display: block; text-align: center; }
.usage-donut strong { font-size: 30px; font-weight: 950; }
.usage-donut span { margin: 0; color: #817899; font-size: 12px; font-weight: 850; }
#usageThroughDate { margin: 0; color: #8a82a0; font-size: 13px; font-weight: 800; }
.usage-model-list { display: grid; gap: 12px; }
.usage-model-row {
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 14px;
    color: #1d1933;
    font-size: 15px;
}
.usage-model-row i {
    width: 5px;
    height: 22px;
    border-radius: 999px;
    background: var(--model-color, #4798e7);
}
.usage-model-row strong, .usage-model-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-model-row strong { font-size: 15px; font-weight: 750; }
.usage-model-row span { color: #928aa8; }
.usage-empty { color: #827a98; font-weight: 800; }
.provider-layout { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.provider-layout.use-only {
    max-width: 1040px;
    grid-template-columns: minmax(0, 1fr);
}
.provider-layout.use-only .provider-list-card {
    display: none;
}
.provider-list-card { padding: 10px 12px; }
.provider-list-card h3 { display: none; }
.provider-config-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.provider-list-empty {
    margin: 4px 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 780;
    line-height: 1.6;
}
.provider-config-item {
    flex: 0 0 210px; min-height: 58px; padding: 9px; border: 1px solid #e1eaf7; border-radius: 12px;
    background: #fff; display: grid; grid-template-columns: 34px minmax(0, 1fr) 10px; gap: 10px; align-items: center; text-align: left;
}
.provider-config-item.active, .provider-config-item:hover { border-color: #9ec1ff; background: #f4f8ff; }
.provider-config-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--blue); background: #eef5ff; }
.provider-config-icon img { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 5px 12px rgba(70, 110, 255, .18)); }
.provider-config-copy strong, .provider-config-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-config-copy strong { font-size: 13px; }
.provider-config-copy span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.provider-config-state { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.provider-config-state.ready { background: var(--green); box-shadow: 0 0 0 5px rgba(17,185,120,.11); }

.provider-form-card { padding: 16px; }
.provider-form-heading, .models-heading, .provider-form-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.provider-form-heading h3 { margin: 0; font-size: 18px; }
.provider-form-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.status-pill {
    min-height: 28px; padding: 0 10px; border-radius: 999px; color: #8a5a00; background: #fff7df;
    display: inline-flex; align-items: center; font-size: 12px; font-weight: 900;
}
.status-pill.ready { color: #047857; background: #ecfdf5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 15px; }
.form-grid label { display: grid; gap: 7px; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid span { color: #52627b; font-size: 12px; font-weight: 850; }
.form-grid input, .form-grid select {
    width: 100%; height: 38px; padding: 0 11px; border: 1px solid #d8e3f1; border-radius: 10px;
    outline: 0; background: #fff; color: var(--ink);
}
.form-grid input:focus, .form-grid select:focus { border-color: #8ab1ff; box-shadow: 0 0 0 3px rgba(18,103,255,.1); }
.provider-layout.use-only .endpoint-field { display: none; }
.models-heading { margin-top: 16px; }
.models-heading h4 { margin: 0; font-size: 15px; }
.models-heading div, .provider-form-actions div { display: flex; gap: 8px; flex-wrap: wrap; }
.provider-model-header {
    display: grid;
    grid-template-columns: minmax(120px, .8fr) minmax(120px, .8fr) minmax(260px, 1fr) 34px;
    gap: 8px;
    margin-top: 10px;
    padding: 0 10px;
    color: #52627b;
    font-size: 12px;
    font-weight: 900;
}
.provider-model-rows { display: grid; gap: 9px; margin-top: 10px; }
.provider-model-row {
    display: grid; grid-template-columns: minmax(120px, .8fr) minmax(120px, .8fr) minmax(260px, 1fr) 34px; gap: 8px; align-items: center;
}
.provider-model-row input {
    height: 36px; min-width: 0; padding: 0 10px; border: 1px solid #d8e3f1; border-radius: 10px; outline: 0; background: #fff; color: var(--ink);
}
.capability-checks { min-height: 36px; padding: 5px; border: 1px solid #d8e3f1; border-radius: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.capability-checks label { display: inline-flex; align-items: center; gap: 5px; color: #51617a; font-size: 12px; font-weight: 780; }
.provider-model-row > button {
    width: 34px; height: 34px; border: 1px solid #d8e3f1; border-radius: 10px; background: #fff; color: #64748b;
}
.provider-form-message { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 12px; font-weight: 760; }
.provider-form-message.success { color: #047857; }
.provider-form-message.error { color: #b91c1c; }
.provider-form-actions { margin-top: 12px; padding-top: 14px; border-top: 1px solid #e8eef7; }

.primary-button, .secondary-button, .quiet-button, .danger-quiet-button {
    min-height: 38px; padding: 0 13px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 850;
}
.primary-button { border: 0; color: #fff; background: linear-gradient(180deg, #166dff 0%, #0053fb 100%); box-shadow: 0 14px 24px rgba(18,103,255,.18); }
.secondary-button, .quiet-button, .danger-quiet-button { border: 1px solid #d9e5f5; background: #fff; color: #40516a; }
.secondary-button:hover, .quiet-button:hover { color: var(--blue); background: #f5f9ff; }
.danger-quiet-button { color: var(--danger); }
.danger-quiet-button:hover { background: #fff1f2; }
.primary-button:disabled, .quiet-button:disabled { opacity: .62; cursor: wait; }

.appearance-card { padding: 16px; }
.assistant-settings-card { max-width: 1040px; padding: 0; overflow: hidden; }
.assistant-preference-group { padding: 22px 24px; }
.assistant-preference-group + .assistant-preference-group { border-top: 1px solid var(--line); }
.assistant-preference-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.assistant-preference-title { display: flex; min-width: 0; align-items: center; gap: 12px; }
.assistant-preference-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; color: var(--blue); border-radius: 10px; background: #eef5ff; }
.assistant-preference-icon svg { width: 18px; height: 18px; }
.assistant-preference-title h3 { margin: 0; font-size: 15px; }
.assistant-preference-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.sound-switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.sound-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sound-switch > span { position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; transition: background-color .18s ease; }
.sound-switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(29, 47, 76, .22); transition: transform .18s ease; }
.sound-switch input:checked + span { background: var(--blue); }
.sound-switch input:checked + span::after { transform: translateX(18px); }
.sound-switch input:focus-visible + span { outline: 3px solid rgba(18, 103, 255, .2); outline-offset: 3px; }
.sound-controls { display: grid; gap: 14px; margin: 20px 0 0 48px; padding: 14px 0 0; border-top: 1px solid #e8eef7; }
.sound-source-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.sound-source-row > div:first-child { min-width: 0; }
.sound-source-row span, .sound-source-row strong { display: block; }
.sound-source-row span { color: var(--muted); font-size: 11px; font-weight: 760; }
.sound-source-row strong { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sound-source-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.sound-source-actions .quiet-button { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12px; }
.sound-source-actions .quiet-button svg { width: 15px; height: 15px; }
.sound-reset-button { width: 32px; height: 32px; border-radius: 8px; }
.sound-reset-button svg { width: 15px; height: 15px; }
.sound-volume { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 14px; }
.sound-volume span { color: #52627b; font-size: 12px; font-weight: 850; }
.sound-volume input { width: 100%; accent-color: var(--blue); }
.assistant-width-settings { display: grid; gap: 18px; margin: 20px 0 0 48px; }
.assistant-width-settings label { display: grid; gap: 9px; }
.assistant-width-settings label > span { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.assistant-width-settings strong { font-size: 13px; }
.assistant-width-settings output { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.assistant-width-settings input { width: 100%; accent-color: var(--blue); }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-options button {
    min-height: 118px; padding: 16px; border: 1px solid #dce6f5; border-radius: 16px; background: #fff;
    display: grid; gap: 8px; align-content: center; text-align: left;
}
.theme-options button svg { color: var(--blue); }
.theme-options button strong { font-size: 16px; }
.theme-options button span { color: var(--muted); font-size: 12px; }
.theme-options button.active { border-color: #8ab1ff; background: #f2f7ff; box-shadow: inset 0 0 0 1px #8ab1ff; }
.account-card { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.account-card strong, .account-card span { display: block; }
.account-card span { margin-top: 4px; color: var(--muted); font-size: 13px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { max-width: 340px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 12px 30px rgba(18,32,57,.14); font-size: 13px; font-weight: 750; }
.toast.error { color: #b91c1c; border-color: #fecaca; background: #fff5f5; }

@media (max-width: 1280px) {
    .settings-main { padding-inline: 28px; }
    .provider-layout { grid-template-columns: minmax(0, 1fr); }
    .provider-model-header { grid-template-columns: 1fr 1fr; }
    .provider-model-header span:nth-child(n + 3) { display: none; }
    .provider-model-row { grid-template-columns: 1fr 1fr; }
    .capability-checks { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
    body { min-width: 0; overflow: auto; }
    .settings-shell { grid-template-columns: 1fr; min-height: 100dvh; }
    .product-rail {
        position: fixed;
        z-index: 60;
        inset: auto 0 0;
        height: 62px;
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        padding: 8px 16px;
        border-right: 0;
        border-top: 1px solid #e5edf8;
        overflow-x: auto;
    }
    .rail-link { width: 40px; height: 40px; }
    .rail-link span { display: none; }
    .brand-mark { width: 40px; height: 40px; margin: 0 auto 0 0; }
    .account-anchor { margin: 0 0 0 auto; }
    .account-popover { left: auto; right: 0; bottom: 52px; }
    .settings-main { padding: 20px 14px 76px; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-nav { position: static; margin-top: 0; display: flex; overflow-x: auto; }
    .settings-nav button { flex: 1 0 auto; }
    .assistant-preference-group { padding: 18px; }
    .sound-controls, .assistant-width-settings { margin-left: 0; }
    .sound-source-row { align-items: flex-start; flex-direction: column; }
    .sound-source-actions { width: 100%; }
    .sound-source-actions .quiet-button { flex: 1; }
    .theme-options { grid-template-columns: 1fr; }
    .toast-region { right: 12px; bottom: 76px; left: 12px; }
    .toast { min-width: 0; max-width: none; }
}

/* 2026-08-20 · 修复账户操作文字继承并换用轻量按钮 */
.account-card #openProfileButton {
    flex: 0 0 auto; width: auto; min-width: 196px; min-height: 44px; padding: 0 16px;
    border: 1px solid #c8d9ef; border-radius: 14px; color: #18385f;
    background: linear-gradient(180deg, #fff 0%, #f2f7fd 100%);
    box-shadow: 0 8px 20px rgba(42,72,111,.10), inset 0 1px 0 rgba(255,255,255,.96);
    font-weight: 850; white-space: nowrap;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
}
.account-card #openProfileButton span { display: inline; margin: 0; color: inherit; font-size: inherit; }
.account-card #openProfileButton svg { color: #1169ff; stroke-width: 2.15; }
.account-card #openProfileButton:hover {
    color: #0b3978; border-color: #8eb4ea; background: linear-gradient(180deg, #fff 0%, #eaf3ff 100%);
    box-shadow: 0 11px 24px rgba(42,87,145,.14); transform: translateY(-1px);
}
.account-card #openProfileButton:active { transform: translateY(0); box-shadow: 0 5px 12px rgba(42,72,111,.10); }
.account-card #openProfileButton:focus-visible { outline: 3px solid rgba(17,105,255,.18); outline-offset: 2px; }
@media (max-width: 640px) {
    .account-card { align-items: stretch; flex-direction: column; }
    .account-card #openProfileButton { width: 100%; min-width: 0; }
}
