@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

:root {
    --brand-h: 215;
    --brand-s: 95%;
    --brand-l: 50%;
    --brand: hsl(var(--brand-h), var(--brand-s), var(--brand-l));

    --bg-dark: #0f131a;
    --bg-darker: #06080b;

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --font-body: 'Noto Sans TC', sans-serif;
    --highlight: #fbbf24;
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
    --fz: 1;
}

html[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-darker: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-bg: #ffffff;
    --glass-border: #e2e8f0;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --highlight: #d97706;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.65;
    font-size: calc(16px * var(--fz));
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
    padding-bottom: 80px;
    /* Space for floating icon */
}

/* Glow */
.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-glow::before,
.bg-glow::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.25;
    animation: drift 12s infinite alternate var(--ease-out);
}

.bg-glow::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--brand), transparent 70%);
    top: -100px;
    left: -100px;
}

.bg-glow::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #0ea5e9, transparent 70%);
    bottom: -50px;
    right: -100px;
    animation-delay: -6s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 40px);
    }
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

.wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 700;
    line-height: 1.4;
}

h1 {
    font-size: calc(20px * var(--fz));
}

h2 {
    font-size: calc(24px * var(--fz));
    margin-bottom: 12px;
}

h3 {
    font-size: calc(18px * var(--fz));
    margin-bottom: 8px;
}

.text-sm {
    font-size: calc(14px * var(--fz));
}

.text-xs {
    font-size: calc(12px * var(--fz));
}

.text-muted {
    color: var(--text-muted);
}

/* Highlight Text */
.marker {
    color: var(--highlight);
    font-weight: bold;
    border-bottom: 2px solid rgba(251, 191, 36, 0.3);
}

html[data-theme="light"] .marker {
    border-bottom-color: rgba(217, 119, 6, 0.3);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
}

.brand-title h1 {
    font-size: calc(18px * var(--fz));
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-title p {
    margin: 2px 0 0;
    font-size: calc(12px * var(--fz));
    color: var(--text-muted);
}

.brand-badge {
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 800;
    display: inline-block;
}

.name-mobile {
    display: none;
}

.name-desktop {
    display: inline;
}

@media (max-width: 600px) {
    .name-mobile {
        display: inline;
        font-size: 18px;
        font-weight: 900;
    }

    .name-desktop {
        display: none;
    }

    .brand-badge {
        display: none;
    }

    .brand-title h1 {
        font-size: 20px;
    }
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

/* Buttons (Standard) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: calc(14px * var(--fz));
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transition: all 0.2s;
}

html[data-theme="light"] .btn {
    background: #fff;
    border-color: #cbd5e1;
    color: #334155;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Text Tabs (Elegant) - Replaces button tabs */
.tabs {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0;
}

.tab {
    padding: 10px 4px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 15px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab:hover {
    color: var(--text-main);
}

.tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

html[data-theme="light"] .tab.active {
    color: #0f172a;
    border-bottom-color: #0f172a;
}

/* Large Action Cards */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.2));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

html[data-theme="light"] .action-card {
    background: #fff;
}

.action-card h3 {
    font-size: calc(18px * var(--fz));
    margin-bottom: 6px;
}

.action-card p {
    font-size: calc(13px * var(--fz));
    color: var(--text-muted);
    margin: 0;
}

.action-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand);
    opacity: 0.8;
}

/* Floating Group (LINE + Share) */
.float-group {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.float-btn {
    width: 64px;
    height: 64px;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    display: block;
}

.float-btn:hover {
    transform: scale(1.05);
}

.float-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.float-btn.square {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    /* Slightly rounded for modern square look */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .float-btn.square {
    background: #fff;
    color: #333;
}

.float-btn.square:hover {
    background: var(--brand);
    color: #fff;
    transform: translateY(-2px);
    border-color: transparent;
}

@media (max-width: 600px) {
    .float-group {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }

    .float-btn {
        width: 56px;
        height: 56px;
    }

    /* Mobile matches desktop size for readability */
}

/* Details/Accordion */
details {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

html[data-theme="light"] details {
    background: #fff;
    border-color: #e2e8f0;
}

summary {
    padding: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    transition: 0.3s;
}

details[open] summary::after {
    transform: rotate(45deg);
}

.detail-content {
    padding: 0 16px 16px;
    color: var(--text-muted);
    font-size: calc(14px * var(--fz));
    border-top: 1px solid var(--glass-border);
    padding-top: 12px;
}

html[data-theme="light"] .detail-content {
    border-top-color: #f1f5f9;
}

/* Utilities */
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.pill {
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.2);
    font-size: calc(12px * var(--fz));
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

html[data-theme="light"] .pill {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
}

.note {
    background: rgba(14, 165, 233, 0.1);
    border-left: 4px solid var(--brand);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: calc(14px * var(--fz));
    color: var(--text-muted);
}

html[data-theme="light"] .note {
    background: #e0f2fe;
    color: #334155;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-field {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

html[data-theme="light"] .form-field {
    background: #fff;
    border-color: #cbd5e1;
}

.form-field input {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 100%;
    font-size: 14px;
    outline: none;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mt-4 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

/* Phrase Box in Langpack */
.phrase-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    position: relative;
}

html[data-theme="light"] .phrase-box {
    background: #f1f5f9;
}

.phrase-box pre {
    white-space: pre-wrap;
    font-family: var(--font-body);
    margin: 0;
    color: var(--text-main);
    font-size: 1.05em;
}

html[data-theme="light"] .phrase-box pre {
    color: #0f172a;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    padding: 4px 10px;
}

/* Check & Columns */
.cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
}

.box {
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .box {
    background: #f8fafc;
    border-color: #e2e8f0;
}