:root {
    --bg: #0a0a0a;
    --fg: #ddd;
    --muted: #555;
    --border: #333;
    --border-light: #111;
    --accent: #3a3a5a;
    --accent-blur: rgba(58, 58, 90, 0.5);
    --error: #a22;
    --link: #5bf;
    --indent: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body::-webkit-scrollbar {
    display: none;
}

body {
    font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    scrollbar-width: 0;
    -ms-overflow-style: none;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image: 
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.03) 0px,
            rgba(255, 255, 255, 0.03) 1px,
            transparent 1px,
            transparent 40px
        ),
        repeating-linear-gradient(
            to right,
            rgba(255, 255, 255, 0.03) 0px,
            rgba(255, 255, 255, 0.03) 1px,
            transparent 1px,
            transparent 40px
        );
        animation: gridMove 30s linear infinite;
}
@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 800px; }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20%,
    60% {
        transform: translateX(-4px);
    }
    40%,
    80% {
        transform: translateX(4px);
    }
}

.anim-fade-up {
    opacity: 0;
    animation: fadeUp 0.4s ease forwards;
}

.anim-slide-up {
    animation: slideUp 0.35s ease both;
}

.anim-shake {
    animation: shake 0.3s ease;
}

.navbar {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 var(--indent);
    border-bottom: 1px solid var(--border);
    background: #060606;
}

.nav-brand {
    font-weight: 700;
    font-size: 13px;
    color: var(--fg);
    text-decoration: none;
}

.nav-sep {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 14px;
}

.nav-title {
    font-size: 12px;
    color: var(--muted);
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 var(--indent);
}

.block {
    position: relative;
    padding-bottom: 28px;
    margin-bottom: 28px;
}

.block::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom: 1px solid var(--border-light);
}

.hero {
    padding: 56px 0 40px;
}

.hero h1 {
    margin: 0 auto;
    text-align: center;
}

.hero h2 {
    margin: 12px auto 0;
    text-align: center;
}

.hero-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 8px;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
}

.hero-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 10px;
}

.tool-grid {
    display: flex;
    flex-direction: column;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    text-decoration: none;
    color: var(--fg);
    border-bottom: 1px solid var(--border-light);
    transition: padding-left 0.15s ease, background 0.15s ease;
}

.tool-card:first-child {
    border-top: 1px solid var(--border-light);
}

.tool-card:hover {
    padding-left: 8px;
    background: rgba(255, 255, 255, 0.015);
}

.tool-card:hover .tool-icon {
    border-color: var(--accent);
}

.tool-card:hover .tool-icon svg {
    stroke: #fff;
}

.tool-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease;
}

.tool-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--fg);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s ease;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 14px;
    font-weight: 600;
}

.tool-desc {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    font-family: -apple-system, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.tool-arrow {
    color: var(--muted);
    font-size: 16px;
    transition: transform 0.12s;
}

.tool-card:hover .tool-arrow {
    transform: translateX(3px);
}

.tool-page {
    padding: 28px 0 60px;
}

.section {
    padding: 24px 0;
}

.section-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 14px;
}

.text-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 12px 14px;
    color: var(--fg);
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    font-family: inherit;
    transition: border-color 0.12s;
}

.text-input:focus {
    border-color: var(--accent);
}

.text-input::placeholder {
    color: #333;
}

.char-count {
    text-align: right;
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
}

.select-grid {
    display: flex;
    flex-wrap: wrap;
}

.select-btn {
    padding: 8px 18px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.1s;
    margin-right: -1px;
    margin-bottom: -1px;
}

.select-btn:hover {
    color: var(--fg);
    z-index: 1;
}

.select-btn.active {
    background: var(--fg);
    border-color: var(--fg);
    color: var(--bg);
    z-index: 2;
    animation: pop 0.15s ease;
}

@keyframes pop {
    50% {
        transform: scale(0.95);
    }
}

.custom-block {
    margin-top: 16px;
    border: 1px solid var(--border-light);
    padding: 14px;
}

.custom-toggle {
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    transition: color 0.12s;
}

.custom-toggle:hover {
    color: var(--fg);
}

.custom-toggle::before {
    content: "+ ";
    display: inline-block;
    transition: transform 0.2s ease;
}

.custom-block.open .custom-toggle::before {
    content: "- ";
}

.custom-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin-top 0.2s ease;
    margin-top: 0;
}

.custom-block.open .custom-body {
    max-height: 200px;
    opacity: 1;
    margin-top: 10px;
}

.btn-primary {
    display: block;
    width: 100%;
    margin: 28px 0;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s;
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--fg);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

.btn-primary:disabled:active {
    transform: none;
}

.btn-sm {
    padding: 5px 14px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.1s;
}

.btn-sm:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    font-size: 12px;
    color: var(--muted);
}

.spinner {
    width: 14px;
    height: 14px;
    border: 1px solid var(--border);
    border-top-color: var(--fg);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-section {
    animation: slideUp 0.35s ease both;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.result-header .section-label {
    margin-bottom: 0;
}

.audio-player {
    width: 100%;
    margin-top: 6px;
    height: 36px;
    filter: invert(1) hue-rotate(180deg);
}

.error-bar {
    padding: 14px 0;
    animation: slideUp 0.25s ease both;
}

.error-text {
    color: var(--error);
    font-size: 12px;
    padding: 10px 14px;
    border: 1px solid var(--error);
    background: #1a0808;
}

.error-bar.shake {
    animation: shake 0.3s ease, slideUp 0.25s ease both;
}

.footer {
    border-top: 1px solid var(--border);
    padding: 16px var(--indent);
    font-size: 11px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 560px) {
    :root {
        --indent: 16px;
    }
    .hero {
        padding: 40px 0 32px;
    }
    .hero-title {
        font-size: 24px;
    }
    .tool-card {
        gap: 12px;
    }
    .tool-icon {
        width: 40px;
        height: 40px;
    }
    .select-btn {
        padding: 7px 14px;
        font-size: 12px;
    }
}

.tool-card.coming-soon {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.6);
}

.coming-badge {
    font-size: 10px;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 2px 8px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    color: var(--muted);
    margin-right: 6px;
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.tag:hover {
    border-color: var(--accent);
    color: var(--fg);
}

audio.audio-player::-webkit-media-controls-panel {
    background-color: #0a0a0a;
}

hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 24px 0;
}

ul,
ol {
    padding-left: 20px;
    color: var(--muted);
    font-size: 13px;
}

li {
    margin-bottom: 6px;
}

code {
    background: #1a1a1a;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 12px;
    color: var(--fg);
    border: 1px solid var(--border);
}

a {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--border);
    transition: text-decoration-color 0.2s;
}

a:hover {
    text-decoration-color: var(--fg);
}

::selection {
    background: var(--accent);
    color: #fff;
}

.transition-all {
    transition: all 0.2s ease;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--muted);
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-family: inherit;
    color: var(--muted);
    background: #111;
    border: 1px solid var(--border);
    margin: 0 2px;
}

@media (max-width: 400px) {
    .nav-sep {
        margin: 0 8px;
    }
    .btn-primary {
        padding: 12px;
        font-size: 13px;
    }
}

header,
footer {
    padding: 16px var(--indent);
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: #060606;
}

footer {
    border-top: 1px solid var(--border);
    border-bottom: none;
    font-size: 11px;
    color: var(--muted);
    position: sticky;
    top: 100vh;
}

.logo h2 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 0;
    max-width: 960px;
    margin: 0 auto;
    justify-content: center;
    padding-left: var(--indent);
    padding-right: var(--indent);
    margin-bottom: 40px;
}

.card {
    display: flex;
    position: relative;
    overflow: hidden;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: var(--bg);
    box-shadow: 0 0 4px 0 var(--muted);
    border: 1px solid var(--border);
    color: var(--fg);
    text-decoration: none;
    text-align: center;
    flex: 0 0 200px;
    transition: all 0.2s ease;
}

.card-disabled {
    display: flex;
    position: relative;
    overflow: hidden;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: var(--bg);
    box-shadow: 0 0 4px 0 var(--muted);
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
    text-align: center;
    flex: 0 0 200px;
    transition: all 0.2s ease;
    cursor: not-allowed;
}

.card i,
.card-disabled i {
    font-size: 24px;
    color: var(--muted);
    transition: color 0.3s ease-in-out;
}

.card h3,
.card-disabled h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    transition: color 0.3s ease-in-out;
}

.card p,
.card-disabled p {
    font-size: 11px;
    color: var(--muted);
    margin: 0;
    font-family: -apple-system, "Noto Sans SC", sans-serif;
    transition: color 0.3s ease-in-out;
}

.card:hover {
    box-shadow: 0 20px 40px rgba(63, 63, 63, 0.5), inset 0 0 0 5px var(--muted);
    transform: translateY(-10px);
}

.card-disabled:hover {
    box-shadow: 0 -20px 80px rgba(255, 63, 63, 0.3), inset 0 0 0 1px var(--error);
    transform: translateY(2px);
}

.card:hover h3, .card:hover p, .card:hover i {
    color: var(--fg);
    text-shadow: 0 -10px 50px var(--fg);
    transition: all 0.2s ease;
}

.card-disabled:hover h3, .card-disabled:hover p, .card-disabled:hover i {
    color: var(--error);
    text-shadow: 0 5px 50px var(--error);
    transition: all 0.2s ease;
}

.unavail-badge {
    font-size: 10px;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 2px 8px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    padding: 0 var(--indent);
    border-bottom: 1px solid var(--border);
    background: #060606;
    position: sticky;
    top: 0;
    z-index: 32767;
}

header h2 {
    font-weight: 700;
    font-size: 2em;
    color: var(--fg);
    text-decoration: none;
}

header h3 {
    font-weight: 700;
    font-size: 2em;
    color: var(--muted);
    text-decoration: none;
}

header nav a {
    color: var(--link);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.12s;
}

header nav a:hover {
    color: var(--fg);
}

.logo h2 {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: var(--fg);
    margin: 0;
}

.logo h3 {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    margin: 0;
}

.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    max-width: 720px;
    margin: 0 auto;
    padding: 32px var(--indent) 48px;
}

.random-card {
    flex: 1 1 300px;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.random-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header i {
    font-size: 20px;
    color: var(--muted);
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    margin: 0;
}

.input-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 80px;
}

.control-group label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="number"] {
    appearance: none;
    -moz-appearance: textfield;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 8px 10px;
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    width: 100%;
    transition: border-color 0.12s;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:focus {
    border-color: var(--accent);
}

.result-area {
    padding: 16px;
    background: #0a0a0a;
    border: 1px solid var(--border-light);
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--fg);
    line-height: 1.2;
}

.result-detail {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    font-family: "Fira Code", "Consolas", monospace;
    word-break: break-all;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.1s;
}

.btn:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

.history-section {
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
    margin-top: 8px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--muted);
}

.clear-history {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: color 0.12s;
}

.clear-history:hover {
    color: var(--fg);
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

.history-text {
    flex: 1;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.history-copy {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 11px;
    transition: all 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.history-copy:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--fg);
    color: var(--bg);
    padding: 8px 20px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 32767;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.animate-result {
    animation: pop 0.3s ease;
}

@media (max-width: 560px) {
    .cards-grid {
        flex-direction: column;
        padding: 24px var(--indent);
    }
    .random-card {
        flex: 1 1 auto;
    }
    .result-value {
        font-size: 28px;
    }
}

.page-title {
    text-align: center;
    padding: 40px 0 24px;
}

.page-title h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--fg);
}

.wheel-container {
    display: flex;
    gap: 32px;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--indent);
    align-items: flex-start;
}

.wheel-section {
    flex: 1;
    min-width: 280px;
}

.wheel-section.controls {
    max-width: 360px;
}

.wheel-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--fg);
}

.wheel-title i {
    margin-right: 8px;
    color: var(--muted);
}

.wheel-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 400px;
    margin: 0 auto 20px;
    background: #060606;
    border: 1px solid var(--border);
    overflow: hidden;
}

#wheelCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 24px solid var(--fg);
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.8));
    z-index: 1023;
    pointer-events: none;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: var(--bg);
    border: 2px solid var(--fg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg);
    font-size: 18px;
    z-index: 1023;
    pointer-events: none;
}

.spin-btn.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0 auto;
    padding: 12px 32px;
    gap: 8px;
}

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.gameheader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 32767;
    background: var(--bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gameheader h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--fg);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#optionInput {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px 12px;
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.12s;
}

#optionInput:focus {
    border-color: var(--accent);
}

.btn-danger {
    background: #2a1215;
    border-color: #5a2a2a;
    color: #f88;
}

.btn-danger:hover {
    background: #3a1a1f;
    border-color: #f88;
    color: #faa;
}

.btn-ok {
    background: var(--accent);
    border-color: var(--border);
    color: var(--fg);
}

.btn-ok:hover {
    background: var(--accent);
    border-color: var(--fg);
    color: var(--fg);
}

.options-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    padding: 4px;
    background: #060606;
    margin-top: 8px;
}

.options-list::-webkit-scrollbar {
    width: 4px;
}

.options-list::-webkit-scrollbar-track {
    background: transparent;
}

.options-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--fg);
}

.option-item:last-child {
    border-bottom: none;
}

.option-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.delete-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
    transition: all 0.1s;
}

.delete-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

.result-section {
    max-width: 720px;
    margin: 48px auto 60px;
    padding: 0 var(--indent);
    text-align: center;
    animation: slideUp 0.35s ease both;
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 16px;
}

.result-title i {
    margin-right: 6px;
}

.result-display {
    font-size: 36px;
    font-weight: 700;
    color: var(--fg);
    min-height: 60px;
    line-height: 1.4;
    word-break: break-word;
}

.history-container {
    margin-top: 32px;
    text-align: left;
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 6px;
}

.result-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-tag {
    display: inline-block;
    padding: 6px 14px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    color: var(--fg);
    font-size: 13px;
    border-radius: 2px;
    transition: border-color 0.2s;
}

.history-tag:hover {
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .wheel-container {
        flex-direction: column;
        padding: 0 var(--indent);
    }
    .wheel-section.controls {
        max-width: 100%;
    }
    .page-title h1 {
        font-size: 2rem;
    }
}

.control-panel {
    max-width: 720px;
    margin: 0 auto 32px;
    padding: 24px var(--indent);
    background: var(--bg);
    border: 1px solid var(--border);
    animation: fadeUp 0.4s ease both;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

.panel-title i {
    color: var(--muted);
    font-size: 16px;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    flex: 1;
}

.input-container label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 12px 14px;
    color: var(--fg);
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    font-family: inherit;
    transition: border-color 0.12s;
}

textarea:focus {
    border-color: var(--accent);
}

textarea::placeholder {
    color: #333;
}

.error-message {
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
    display: none;
    animation: shake 0.3s ease;
}

.correction-level-info {
    margin: 16px 0 20px;
    padding: 14px;
    border: 1px solid var(--border-light);
    background: #060606;
    font-size: 12px;
    color: var(--muted);
}

.correction-level-info h4 {
    font-size: 13px;
    color: var(--fg);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.correction-level-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.correction-level-info li {
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--muted);
}

.correction-level-info li strong {
    color: var(--fg);
    font-weight: 600;
    margin-right: 6px;
}

.result-panel {
    max-width: 720px;
    margin: 0 auto 48px;
    padding: 0 var(--indent);
    animation: slideUp 0.35s ease both;
}

.result-display {
    text-align: center;
    padding: 32px 20px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.result-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
}

#qrcode {
    display: inline-block;
    margin: 0 auto;
}

#qrcode img,
#qrcode canvas {
    display: block;
    margin: 0 auto;
}

#infoLabel {
    margin-top: 12px;
    font-size: 11px;
    color: var(--muted);
    word-break: break-all;
}

.history-panel {
    margin-top: 16px;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

select {
    background-color: var(--bg);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 32px 8px 12px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.12s;
}

details {
    border: 1px solid var(--border-light);
    background: #060606;
    padding: 14px;
    margin-top: 16px;
}

details summary {
    font-size: 13px;
    color: var(--fg);
    margin-bottom: 12px;
}

:root {
    --primary: #6a6aff;
    --primary-dark: #5555cc;
}

.tab-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 24px 0 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
}

.tab-btn i {
    font-size: 14px;
}

.tab-btn:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    border-radius: 0;
    background: transparent;
}

.tab-pane {
    display: none;
    animation: fadeUp 0.3s ease;
}

.tab-pane.active {
    display: block;
}

.crypto-card {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 24px;
    margin: 0 auto 32px;
    max-width: 720px;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.crypto-card:hover {
    border-color: var(--accent);
}

.field-group {
    margin-bottom: 20px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.field-label i {
    font-size: 10px;
    color: var(--primary);
}

.action-btns {
    display: flex;
    gap: 16px;
    margin: 24px 0 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.result-header span {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 4px 12px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 4px;
}

.copy-btn:hover {
    border-color: var(--fg);
    color: var(--fg);
    background: rgba(255, 255, 255, 0.03);
}

.copy-btn:active {
    transform: scale(0.96);
}

.result-area {
    word-break: break-word;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
}

textarea,
input[type="text"],
input[type="password"] {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 12px 14px;
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.12s;
    width: 100%;
}

textarea:focus,
input:focus {
    border-color: var(--primary);
}

@media (max-width: 480px) {
    .action-btns {
        flex-direction: column;
        gap: 10px;
    }
    .tab-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .crypto-card {
        padding: 16px;
    }
}

main > h1 {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    margin: 24px 0 32px;
    color: var(--fg);
    letter-spacing: -0.3px;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 var(--indent) 48px;
}

.password-display {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    padding: 4px 4px 4px 16px;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.password-display:focus-within {
    border-color: var(--primary);
}

.password-display input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 18px;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    letter-spacing: 0.5px;
    padding: 14px 0;
    color: var(--fg);
    outline: none;
}

.password-display .copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    width: 44px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.password-display .copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(106, 106, 255, 0.1);
}

.strength-meter {
    background: var(--border-light);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin: 12px 0 8px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.25s ease, background 0.2s;
    border-radius: 3px;
}

.strength-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 28px;
    padding: 0 4px;
}

.controls {
    background: #060606;
    border: 1px solid var(--border);
    padding: 20px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    text-align: left;
}

.control-group {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--fg);
    cursor: pointer;
    user-select: none;
}

.control-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

.control-group input[type="range"] {
    flex: 1;
    min-width: 160px;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--fg);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.1s;
    border: none;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary);
    transform: scale(1.2);
}

.length-value {
    color: var(--primary);
    font-weight: 600;
    margin-left: 6px;
    background: rgba(106, 106, 255, 0.15);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.btn-group button {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
}

.btn-group button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(106, 106, 255, 0.05);
}

.btn-group button:active {
    transform: scale(0.97);
}

.info-box {
    background: #060606;
    border-left: 3px solid var(--primary);
    padding: 18px 22px;
    margin-top: 20px;
    border-radius: 8px;
}

.info-box h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg);
}

.info-box h3 i {
    color: var(--primary);
}

.info-box p {
    font-size: 12px;
    color: var(--muted);
    margin: 6px 0;
    line-height: 1.5;
}

@media (max-width: 560px) {
    .password-display input {
        font-size: 14px;
        padding: 12px 0;
    }
    .controls {
        padding: 16px;
    }
    .btn-group {
        flex-direction: column;
        gap: 10px;
    }
    .btn-group button {
        padding: 10px;
    }
}

#monthPicker {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 12px;
    outline: none;
}

header button {
    padding: 6px 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.12s;
}

header button:hover {
    border-color: var(--accent);
    color: var(--fg);
}

#calendar {
    width: 100%;
    max-width: 640px;
    margin: 24px auto;
    border-collapse: collapse;
    border: 1px solid var(--border);
}

#calendar th,
#calendar td {
    border: 1px solid var(--border-light);
    padding: 10px 6px;
    text-align: center;
    vertical-align: top;
    font-size: 13px;
    height: 80px;
    width: 14.28%;
}

#calendar th {
    background: #060606;
    color: var(--muted);
    font-weight: 500;
    height: auto;
    padding: 10px 0;
}

.day-number {
    cursor: pointer;
    font-weight: 600;
    transition: color 0.1s;
}

.day-number:hover {
    color: var(--accent);
}

.highlight {
    background: var(--accent);
    color: #fff;
    padding: 4px;
    display: inline-block;
    min-width: 24px;
    border-radius: 2px;
}

.remark {
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
    word-break: break-all;
    line-height: 1.3;
}

.modal,
#remarkModal,
#settingsModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 32767;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 24px;
    min-width: 300px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: popUp 0.3s ease forwards;
}

#remarkModal h3,
#settingsModal h3 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
}

#remarkModal label,
#settingsModal label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--fg);
}

#remarkModal textarea,
#settingsModal select {
    width: 100%;
    margin: 6px 0 12px;
}

#remarkModal button,
#settingsModal button {
    margin-top: 8px;
    margin-right: 8px;
}

@keyframes popUp {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.converter-card {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 32px;
    border-radius: 6px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.card-title i {
    font-size: 18px;
    color: var(--muted);
}

.card-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    margin: 0;
}

.converter-body .input-group {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.converter-body .input-group label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 16px 0;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    border-radius: 4px;
    transition: all 0.15s;
}

.swap-btn:hover {
    border-color: var(--accent);
    color: var(--fg);
    background: rgba(255, 255, 255, 0.03);
}

.unit-selector-container {
    margin-bottom: 24px;
}

.unit-selector-title {
    margin-bottom: 12px;
}

.selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.selector-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--fg);
}

.selector-header h3 i {
    margin-right: 6px;
    color: var(--muted);
}

.selector-mode {
    display: flex;
    gap: 4px;
}

.mode-btn {
    padding: 4px 16px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.12s;
    border-radius: 4px;
}

.mode-btn.active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.mode-btn:hover:not(.active) {
    border-color: var(--accent);
    color: var(--fg);
}

.unit-selector-title > span {
    font-size: 11px;
    color: var(--muted);
}

.unit-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.unit-option {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    background: #060606;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    min-width: 70px;
    border-radius: 4px;
}

.unit-option:hover {
    border-color: var(--accent);
    color: var(--fg);
}

.unit-option .unit-abbr {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
}

.unit-option .unit-name {
    font-size: 10px;
    margin-top: 2px;
}

.unit-option.selected-input {
    border-color: var(--accent);
    background: rgba(58, 58, 90, 0.3);
    color: var(--fg);
}

.unit-option.selected-output {
    border-color: var(--fg);
    background: rgba(224, 224, 224, 0.08);
    color: var(--fg);
}

.unit-selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 12px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.unit-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.unit-display .unit-abbr {
    font-size: 24px;
    font-weight: 700;
    color: var(--fg);
}

.unit-display .unit-name {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.unit-arrow {
    color: var(--muted);
    font-size: 20px;
    margin: 0 16px;
}

.output-display .unit-abbr {
    color: var(--accent);
}

.converter-section {
    margin-top: 8px;
}

.converter-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 6px;
}

.converter-section h3 i {
    color: var(--muted);
}

.converter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.unit-card {
    flex: 1 1 200px;
    background: #060606;
    border: 1px solid var(--border-light);
    padding: 16px;
    border-radius: 4px;
    transition: border-color 0.15s;
}

.unit-card:hover {
    border-color: var(--accent);
}

.unit-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 6px;
}

.unit-card h3 i {
    color: var(--muted);
}

.unit-card p {
    font-size: 12px;
    color: var(--muted);
    margin: 4px 0;
    line-height: 1.5;
}

@media (max-width: 560px) {
    .unit-selector-row {
        flex-direction: column;
        gap: 12px;
    }
    .unit-arrow {
        transform: rotate(90deg);
    }
    .unit-display {
        min-width: auto;
    }
    .unit-card {
        flex: 1 1 100%;
    }
    .mode-btn {
        padding: 4px 12px;
        font-size: 11px;
    }
}

.unit-display {
    cursor: pointer;
    user-select: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
}

.unit-display:hover {
    border-color: var(--border);
    background: #0a0a0a;
}

.unit-display.active-mode {
    border-color: var(--accent);
    background: rgba(58, 58, 90, 0.15);
}

.converter-body {
    display: flex;
    align-items: center;
    gap: 20px;
}

.column {
    flex: 1;
}

.swap-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 8px;
}

.swap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
}

.swap-btn i {
    font-size: 18px;
}

.converter-section {
    text-align: center;
}

#convert-btn {
    margin: 20px auto 0;
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.rates-table th,
.rates-table td {
    border: 1px solid var(--border-light);
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
}

.rates-table th {
    background: #060606;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.rates-table td {
    color: var(--fg);
}

.rates-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.change-up {
    color: #4caf50;
}

.change-down {
    color: #f44336;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--fg);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

#error-message {
    display: none;
}

#currentCurrency {
    font-weight: 600;
    color: var(--fg);
}

@media (max-width: 560px) {
    .converter-body {
        flex-direction: column;
        gap: 10px;
    }
    .swap-container {
        padding: 8px 0;
    }
    .swap-btn {
        transform: rotate(90deg);
    }
    .rates-table th,
    .rates-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
}

.converter-container {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 32px;
    border-radius: 6px;
}

.back-btn {
    color: var(--link);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.12s;
}

.back-btn:hover {
    color: var(--fg);
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group input[type="number"] {
    width: 70px;
}

.error-message {
    margin-top: 12px;
}

.result-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.result-card {
    background: #060606;
    border: 1px solid var(--border-light);
    padding: 16px;
    border-radius: 4px;
    text-align: center;
    transition: border-color 0.15s;
}

.result-card:hover {
    border-color: var(--accent);
}

.result-card h3 {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 8px;
    font-weight: 500;
}

.result-card .result-value {
    font-size: 18px;
    font-weight: 600;
    word-break: break-all;
}

.binary-value {
    color: #4caf50;
}

.octal-value {
    color: #ff9800;
}

.decimal-value {
    color: var(--fg);
}

.hex-value {
    color: #2196f3;
}

.custom-value {
    color: var(--accent);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 0.3s ease;
}

@media (max-width: 560px) {
    .result-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .result-card .result-value,
    .result-card-long .result-value {
        font-size: 16px;
    }
}

.calculator-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 24px;
    margin: 0 35%;
    backdrop-filter: none;
}

.calc-display {
    background: #060606;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 16px;
    text-align: right;
    font-size: 1.6rem;
    font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
    color: var(--fg);
    min-height: 64px;
    word-break: break-all;
    white-space: pre-wrap;
    margin-bottom: 16px;
}

.calculator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.calc-btn {
    padding: 12px 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.12s;
}

.calc-btn:hover {
    background: #1a1a2e;
    border-color: var(--accent);
}

.calc-btn:active {
    transform: scale(0.96);
}

.calc-btn.operator {
    background: #0f1a2a;
    border-color: var(--accent);
    color: #a0b0ff;
}

.calc-btn.special {
    background: #1a1a2e;
    border-color: var(--accent);
    color: #c0a0ff;
}

.calc-btn.equals {
    background: var(--accent);
    color: #fff;
    grid-column: span 2;
}

.calc-btn.equals:hover {
    background: #4a4a7a;
}

.calc-btn.clear {
    background: #2a1215;
    border-color: #5a2a2a;
    color: #f88;
    grid-column: span 2;
}

.calc-btn.clear:hover {
    background: #3a1a1f;
}

.custom-functions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.function-panel {
    background: #060606;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 16px;
}

.function-panel h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--fg);
    text-align: center;
}

.function-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: "Fira Code", monospace;
    font-size: 14px;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    outline: none;
}

.function-input:focus {
    border-color: var(--accent);
}

.history-panel {
    margin-top: 24px;
    background: #060606;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 16px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-header h3 {
    margin: 0;
    font-size: 14px;
    color: var(--fg);
}

.clear-history-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.1s;
}

.clear-history-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

#history-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#history-list::-webkit-scrollbar {
    width: 4px;
}

#history-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent);
    border-radius: 2px;
    font-family: "Fira Code", monospace;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.history-expr {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.history-result {
    color: var(--fg);
    font-weight: 600;
}

@media (max-width: 560px) {
    .custom-functions {
        grid-template-columns: 1fr;
    }
    .calculator {
        gap: 6px;
    }
    .calc-btn {
        padding: 10px 2px;
        font-size: 12px;
    }
}

.page-header {
    text-align: center;
    padding: 40px 0 24px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--fg);
    margin: 0;
}

.converters-container {
    max-width: 720px;
    margin: 0 auto 48px;
    padding: 0 var(--indent);
}

.input-section {
    margin-bottom: 24px;
}

.input-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 10px;
}

.input-section label i {
    color: var(--muted);
    font-size: 14px;
}

.options-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.option-card {
    background: #060606;
    border: 1px solid var(--border-light);
    padding: 18px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.15s;
}

.option-card:hover {
    border-color: var(--accent);
    background: #0e0e1a;
}

.option-card.active {
    border-color: var(--accent);
    background: rgba(58, 58, 90, 0.2);
}

.option-card i {
    font-size: 24px;
    color: var(--muted);
    margin-bottom: 10px;
    display: block;
}

.option-card.active i {
    color: var(--fg);
}

.option-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin: 0 0 6px;
}

.option-card p {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
    font-family: "Fira Code", monospace;
    word-break: break-all;
}

.action-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
}

.output-section {
    margin-bottom: 16px;
}

.output-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 10px;
}

.output-section label i {
    color: var(--muted);
    font-size: 14px;
}

.output-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn-secondary {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    padding: 10px 18px;
    cursor: pointer;
    transition: all 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    border-color: var(--fg);
    color: var(--fg);
}

@media (max-width: 560px) {
    .page-header h1 {
        font-size: 24px;
    }
    .options-section {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .action-buttons {
        flex-direction: column;
        gap: 12px;
    }
}

.button-group .btn-primary {
    display: inline-flex;
    width: auto;
    margin: 0;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s;
}

.btn-secondary:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.btn-explode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--error);
    background: #2a1215;
    color: #f88;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s;
}

.btn-explode:hover {
    background: #3a1a1f;
    color: #faa;
}

.tool-container {
    max-width: 720px;
    margin: 0 auto 48px;
    padding: 0 var(--indent);
}

.input-area {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    padding: 14px 16px;
    resize: vertical;
    outline: none;
    min-height: 180px;
    margin-bottom: 20px;
    border-radius: 4px;
    transition: border-color 0.12s;
}

.input-area:focus {
    border-color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.stat-card,
.stat-card-long {
    background: #060606;
    border: 1px solid var(--border-light);
    padding: 16px;
    border-radius: 4px;
    text-align: center;
    transition: border-color 0.15s;
}

.stat-card:hover,
.stat-card-long:hover {
    border-color: var(--accent);
}

.stat-card h3,
.stat-card-long h3 {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--fg);
    word-break: break-all;
}

.stat-card-long {
    grid-column: 1 / -1;
}

@keyframes shakeEffect {
    0%,
    100% {
        transform: translateX(0);
    }
    20%,
    60% {
        transform: translateX(-4px);
    }
    40%,
    80% {
        transform: translateX(4px);
    }
}

.shake-effect {
    animation: shakeEffect 0.3s ease;
}

.explosion-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 32767;
}

.particle {
    position: absolute;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 20px;
    color: #fff;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    font-family: "Fira Code", monospace;
    z-index: 32767;
}

@media (max-width: 560px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .stat-value {
        font-size: 18px;
    }
}

.contact-card {
    max-width: 680px;
    margin: 32px auto 48px;
    padding: 0 var(--indent);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-item {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: #060606;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.contact-item:hover {
    border-color: var(--accent);
}

.contact-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    font-size: 20px;
    color: var(--muted);
}

.contact-details {
    flex: 1;
    min-width: 0;
}

.contact-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-value {
    font-size: 14px;
    color: var(--fg);
    line-height: 1.8;
    word-break: break-all;
}

.contact-value a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.12s;
}

.contact-value a:hover {
    color: var(--fg);
    text-decoration: underline;
}

@media (max-width: 560px) {
    .contact-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }
    .contact-value {
        font-size: 13px;
    }
}

.reply-hint {
    background: #e7f3ff;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.reply-hint button {
    margin-left: 1rem;
    background: #ddd;
    border: none;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
}

.reply-btn {
    font-size: 0.85rem;
    background: none;
    color: #007bff;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.5rem;
}

.reply-btn:hover {
    text-decoration: underline;
}

.floor {
    color: #aaa;
    margin-right: 0.5rem;
    font-weight: normal;
}

input[type="file"] {
    padding: 10px;
    color: #333;
}

input[type="file"]::file-selector-button {
    background: var(--accent);
    border-color: var(--border);
    color: var(--fg);
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--fg);
    color: var(--accent);
}