@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Newsreader:opsz,wght@6..72,400..800&family=Noto+Serif+TC:wght@400;500;600;700;900&display=swap");
:root {
    color-scheme: dark;
    --bg: #070a12;
    --panel: rgba(18, 25, 40, 0.78);
    --panel-strong: rgba(22, 31, 50, 0.92);
    --line: rgba(255, 255, 255, 0.13);
    --text: #fffaf1;
    --muted: rgba(255, 250, 241, 0.68);
    --accent: #ffd166;
    --blue: #74d7ff;
    --green: #8fe6bd;
    --red: #ff7a59;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
    --font-sans: "Manrope", "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
    --font-serif: "Newsreader", "Noto Serif TC", "Songti TC", serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    overflow-x: clip;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 122, 89, 0.24), transparent 28rem),
        radial-gradient(circle at 78% 14%, rgba(116, 215, 255, 0.23), transparent 30rem),
        radial-gradient(circle at 50% 92%, rgba(141, 123, 255, 0.18), transparent 32rem),
        var(--bg);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

body::before {
    background:
        linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 54px 54px,
        linear-gradient(90deg, rgba(255,255,255,0.038) 1px, transparent 1px) 0 0 / 54px 54px;
    mask-image: radial-gradient(circle at 50% 40%, black, transparent 76%);
}

body::after {
    background:
        linear-gradient(110deg, transparent 20%, rgba(255, 209, 102, 0.08) 38%, transparent 56%),
        linear-gradient(150deg, transparent 12%, rgba(116, 215, 255, 0.09) 45%, transparent 70%);
    transform: translate3d(calc((var(--mx, 0.5) - 0.5) * 22px), calc((var(--my, 0.5) - 0.5) * 18px), 0);
}

a {
    color: inherit;
}

.tool-shell {
    width: min(1180px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 28px 0 64px;
}

.tool-nav {
    position: sticky;
    top: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 54px;
}

.tool-brand,
.tool-lang,
.tool-action,
.tool-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(18, 25, 40, 0.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    backdrop-filter: blur(18px);
}

.tool-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 14px 10px 10px;
    text-decoration: none;
}

.tool-brand img {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.tool-brand strong,
.tool-brand small {
    display: block;
}

.tool-brand strong {
    font-size: 17px;
    font-weight: 950;
}

.tool-brand small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}

.tool-actions {
    display: flex;
    gap: 10px;
}

.tool-lang,
.tool-action {
    min-height: 48px;
    padding: 0 18px;
    color: var(--text);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.tool-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.tool-hero {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(330px, 0.72fr);
    gap: 28px;
    align-items: stretch;
    margin-bottom: 28px;
}

.tool-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 34px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.025)),
        var(--panel);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.14);
}

.tool-panel::before {
    content: "";
    position: absolute;
    inset: -45%;
    background: radial-gradient(circle, rgba(116, 215, 255, 0.14), transparent 42%);
    transform: translate3d(calc((var(--mx, 0.5) - 0.5) * 36px), calc((var(--my, 0.5) - 0.5) * 28px), 0);
    pointer-events: none;
}

.tool-copy,
.tool-form,
.tool-output,
.tool-list {
    position: relative;
    z-index: 1;
}

.tool-copy {
    padding: clamp(28px, 5vw, 64px);
    min-height: 470px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 950;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

h1 {
    max-width: 820px;
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(50px, 8vw, 110px);
    line-height: 0.94;
    letter-spacing: 0;
    text-wrap: balance;
}

.tool-lead {
    max-width: 720px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: clamp(18px, 2.1vw, 24px);
    line-height: 1.65;
    text-wrap: pretty;
}

.tool-form {
    padding: 24px;
    display: grid;
    gap: 14px;
}

.tool-form h2,
.tool-output h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-grid .wide {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 820;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 12px 14px;
    color: var(--text);
    background: rgba(4, 8, 18, 0.45);
    font: inherit;
    outline: none;
}

textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(116, 215, 255, 0.65);
    box-shadow: 0 0 0 4px rgba(116, 215, 255, 0.13);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-button {
    position: relative;
    min-height: 48px;
    padding: 0 18px;
    color: var(--text);
    font: inherit;
    font-weight: 950;
    cursor: pointer;
}

.tool-button.primary {
    color: #10131d;
    border-color: transparent;
    background: linear-gradient(120deg, #ffe5a8, #8ee8f1);
    box-shadow: 0 12px 34px rgba(116, 215, 255, 0.18), 0 12px 34px rgba(255, 209, 102, 0.16);
}

.tool-button.danger {
    color: #ffd0c6;
}

.tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.68fr);
    gap: 28px;
}

.tool-output {
    padding: 24px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.metric {
    min-height: 88px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.055);
}

.metric strong,
.metric small {
    display: block;
}

.metric strong {
    font-size: 24px;
}

.metric small {
    margin-top: 6px;
    color: var(--muted);
    font-weight: 760;
}

.item-list {
    display: grid;
    gap: 12px;
    padding: 24px;
}

.item-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    background: rgba(255,255,255,0.06);
}

.item-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.item-card h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.08;
}

.item-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.58;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    color: rgba(255,250,241,0.86);
    background: rgba(255,255,255,0.09);
    font-size: 12px;
    font-weight: 880;
}

.status-live { color: var(--green); }
.status-warn { color: var(--accent); }
.status-stop { color: var(--red); }

.remove-item {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    color: var(--muted);
    background: rgba(255,255,255,0.07);
    cursor: pointer;
}

.empty {
    padding: 32px;
    color: var(--muted);
    text-align: center;
}

@media (hover: hover) and (min-width: 900px) {
    .tool-button,
    .tool-action,
    .tool-lang,
    .item-card {
        transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    }

    .tool-button:hover,
    .tool-action:hover,
    .tool-lang:hover {
        transform: translateY(-2px);
        border-color: rgba(116, 215, 255, 0.52);
        box-shadow: 0 0 0 1px rgba(116, 215, 255, 0.12), 0 16px 44px rgba(116, 215, 255, 0.16);
    }

    .item-card:hover {
        transform: translateY(-3px);
        border-color: rgba(255, 209, 102, 0.32);
    }
}

@media (max-width: 920px) {
    .tool-shell {
        width: min(100% - 24px, 720px);
        padding-top: 14px;
    }

    .tool-nav {
        position: relative;
        top: auto;
        margin-bottom: 18px;
    }

    .tool-brand small {
        display: none;
    }

    .tool-hero,
    .tool-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-copy {
        min-height: 330px;
        padding: 28px;
        justify-content: flex-end;
    }

    h1 {
        font-size: clamp(42px, 13vw, 58px);
        line-height: 0.98;
    }

    .tool-lead {
        font-size: 16px;
        line-height: 1.65;
    }

    .field-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .tool-shell {
        width: calc(100% - 20px);
    }

    .tool-nav {
        align-items: flex-start;
    }

    .tool-brand {
        max-width: calc(100vw - 118px);
        padding-right: 12px;
    }

    .tool-brand strong {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tool-actions {
        gap: 6px;
    }

    .tool-action,
    .tool-lang {
        min-height: 44px;
        padding: 0 13px;
    }

    .tool-copy,
    .tool-form,
    .tool-output,
    .item-list {
        padding: 18px;
    }

    .tool-panel {
        border-radius: 26px;
    }

    .tool-copy {
        min-height: 300px;
    }

    h1 {
        font-size: clamp(38px, 12.5vw, 48px);
    }
}
