/* style.css */
:root {
    --bg: #0c1216;
    --panel: rgba(16, 26, 32, .70);
    --card: rgba(255, 255, 255, .06);
    --card2: rgba(255, 255, 255, .08);
    --border: rgba(255, 255, 255, .12);
    --text: #eef5f8;
    --muted: rgba(238, 245, 248, .72);
    --accent: #39c6e6;
    --shadow: 0 18px 44px rgba(0, 0, 0, .40);
    --radius: 18px;
    --radius2: 14px;
}

body[data-theme="light"] {
    --bg: #f4f7fb;
    --panel: rgba(255, 255, 255, .82);
    --card: rgba(0, 0, 0, .04);
    --card2: rgba(0, 0, 0, .06);
    --border: rgba(0, 0, 0, .12);
    --text: #0b1220;
    --muted: rgba(11, 18, 32, .70);
    --accent: #0ea5e9;
    --shadow: 0 18px 44px rgba(0, 0, 0, .10);
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(57, 198, 230, .18), transparent 55%),
        radial-gradient(1000px 600px at 90% 0%, rgba(57, 198, 230, .12), transparent 55%),
        var(--bg);
    color: var(--text);
}

.app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 14px 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brandLogo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow:
        0 0 0 1px rgba(57, 198, 230, .25),
        0 10px 24px rgba(0, 0, 0, .35);
}

.brandTitle {
    font-weight: 900;
    letter-spacing: .2px;
}

.brandSub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topActions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .12s ease, border-color .12s ease, background .12s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(57, 198, 230, .35);
}

.btn:active {
    transform: translateY(0px);
}

.btn-primary {
    border-color: rgba(57, 198, 230, .45);
    background: linear-gradient(135deg, rgba(57, 198, 230, .28), rgba(255, 255, 255, .06));
}

.btn-ghost {
    background: rgba(255, 255, 255, .04);
}

.tabs {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .12s ease, border-color .12s ease;
}

.tab:hover {
    transform: translateY(-1px);
    border-color: rgba(57, 198, 230, .35);
}

.tab.active {
    border-color: rgba(57, 198, 230, .45);
    background: linear-gradient(135deg, rgba(57, 198, 230, .22), rgba(255, 255, 255, .06));
}

.views {
    margin-top: 14px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.titleRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 10px;
}

h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: .2px;
}

.pill {
    font-size: 12px;
    font-weight: 900;
    color: rgba(238, 245, 248, .92);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(57, 198, 230, .30);
    background: rgba(57, 198, 230, .10);
}

.card {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

.row3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.row2 {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 12px;
    margin-top: 12px;
}

.field label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 850;
}

input,
select {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 12px;
    outline: none;
}

input:focus,
select:focus {
    border-color: rgba(57, 198, 230, .55);
    box-shadow: 0 0 0 3px rgba(57, 198, 230, .12);
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(238, 245, 248, .75) 50%),
        linear-gradient(135deg, rgba(238, 245, 248, .75) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.meta {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.miniCard {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

.miniTitle {
    font-weight: 900;
    margin-bottom: 4px;
}

.miniSub {
    color: var(--muted);
    font-size: 12px;
}

.chips {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chipBtn {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    padding: 9px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 900;
}

.chipBtn small {
    opacity: .75;
    font-weight: 800
}

.grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cardHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.cardHead h3 {
    margin: 0;
    font-size: 16px;
}

.chip {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    font-weight: 900;
    color: var(--text);
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.arrow {
    opacity: .8;
    font-weight: 900;
}

.favHeader,
.historyHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.favList,
.historyList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.favItem,
.histItem {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.favItem .title {
    font-weight: 900;
}

.favItem .sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.favItem .right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.histTop {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.histTitle {
    font-weight: 900;
}

.histTime {
    font-size: 12px;
    color: var(--muted);
}

.histBody {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.empty {
    padding: 12px;
    border: 1px dashed rgba(255, 255, 255, .22);
    border-radius: 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, .03);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.show {
    display: flex;
}

.modalCard {
    width: min(520px, 100%);
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

.modalHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.modalTitle {
    font-weight: 900;
    font-size: 16px;
}

.modalSub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.modalBody {
    display: grid;
    gap: 12px;
}

.modalHint {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid rgba(255, 255, 255, .10);
    padding-top: 10px;
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: all .16s ease;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(57, 198, 230, .30);
    background: rgba(16, 26, 32, .92);
    color: var(--text);
    font-weight: 900;
    box-shadow: var(--shadow);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 860px) {
    .row3 {
        grid-template-columns: 1fr;
    }

    .row2 {
        grid-template-columns: 1fr;
    }

    .split {
        grid-template-columns: 1fr;
    }

    .grid2 {
        grid-template-columns: 1fr;
    }
}