:root {
    --bg: #0d0d12;
    --panel: #16161a;
    --panel-border: #2c2c35;
    --text: #e2e2e5;
    --text-muted: #8b8b99;
    --gold: #ebd288;
    --gold-dim: #b89b4d;
    --gold-glow: rgba(235, 210, 136, 0.15);
    --font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    background-image: radial-gradient(circle at 50% 0%, #1a1a24 0%, var(--bg) 60%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
}
::selection {
    background: var(--gold);
    color: #000;
}
::-moz-selection {
    background: var(--gold);
    color: #000;
}
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
html {
    scrollbar-width: thin;
    scrollbar-color: var(--panel-border) var(--bg);
}
.layout-wrapper {
    width: 100%;
    max-width: 95%;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.layout {
    display: flex;
    gap: 32px;
    width: 100%;
    align-items: stretch;
}
.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    padding: 32px;
    border-radius: 16px;
    flex: 1;
    min-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}
.header {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--gold);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 16px;
    text-shadow: 0 0 20px var(--gold-glow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-ico {
    width: 32px;
    height: 32px;
}
.rate-preview {
    position: relative;
    margin-bottom: 24px;
    background: rgba(235, 210, 136, 0.03);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(235, 210, 136, 0.1);
}
.section-mt {
    margin-top: 24px;
}
.rate-preview label {
    color: var(--gold-dim);
    margin-bottom: 4px;
    display: block;
}
.rate-preview input {
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 16px;
    font-weight: 600;
    padding: 4px 0 0 0;
    pointer-events: none;
    box-shadow: none;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    flex-grow: 1;
}
.display {
    flex: 1.5;
    min-width: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: #0a0a0d;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}
.placeholder-msg {
    color: var(--text-muted);
    font-size: 15px;
    text-align: center;
    padding: 30px;
    animation: pulse 2s infinite ease-in-out;
}
.display img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
    animation: zoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.input-group {
    display: flex;
    flex-direction: column;
}
.emo-group {
    display: none;
}
label {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
input, select {
    width: 100%;
    padding: 14px;
    background: #0a0a0d;
    border: 1px solid var(--panel-border);
    color: var(--text);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: var(--font);
    transition: all 0.3s ease;
    appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b8b99' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--gold-dim);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}
.btn-group {
    margin-top: 32px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
button {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font);
    flex: 1;
    min-width: 150px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px var(--gold-glow);
}
button:hover {
    transform: translateY(-2px);
    background: #fdf0ba;
    box-shadow: 0 6px 16px rgba(235, 210, 136, 0.25);
}
button:active {
    transform: translateY(1px);
}
button.alt-btn {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold-dim);
    box-shadow: none;
}
button.alt-btn:hover {
    background: var(--gold-glow);
    border-color: var(--gold);
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.github-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: none;
    letter-spacing: 0;
}
.rate-source {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
    text-align: right;
}
#preview {
    display: none;
}
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 16px;
    border-left: 3px solid var(--gold);
    padding-left: 10px;
    letter-spacing: 0.5px;
}
.rate-header {
    margin-bottom: 6px;
}
.rate-header label { margin-bottom: 0; }
.icon-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--gold-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: none;
    min-width: auto;
}
.icon-btn:hover {
    color: var(--gold);
    background: rgba(235, 210, 136, 0.1);
    transform: translateY(0);
    box-shadow: none;
}
.icon-btn.spinning svg {
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.cm-header, .eom-header, .field-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.cm-header label, .eom-header label, .field-header label { margin-bottom: 0; }
.tooltip-container {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    cursor: help;
}
.tooltip-container:hover { color: var(--gold); }
.tooltip {
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: #202026;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    border: 1px solid var(--panel-border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    z-index: 10;
    line-height: 1.5;
}
.tooltip-container:hover .tooltip {
    opacity: 1;
    visibility: visible;
}
.capsule-switch {
    display: flex;
    background: #0a0a0d;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    position: relative;
    padding: 4px;
    height: 44px;
    box-sizing: border-box;
}
.cm-btn, .eom-btn {
    flex: 1;
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s;
    box-shadow: none;
    min-width: auto;
}
.cm-btn.active, .eom-btn.active { color: #000; }
.cm-btn:hover, .eom-btn:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
}
.capsule-bg {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: calc(50% - 4px);
    background: var(--gold);
    border-radius: 6px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    left: 4px;
}
.capsule-switch.is-real .capsule-bg {
    left: 50%;
}
.capsule-switch.is-exact .capsule-bg {
    left: 50%;
}
@media (max-width: 1200px) {
    body { align-items: flex-start; }
    .layout { flex-direction: column; }
    .panel { min-width: 0; }
    .display { min-width: 0; min-height: 400px; }
}
@media (max-width: 600px) {
    .layout-wrapper { padding: 12px; max-width: 100%; }
    .panel { padding: 20px; }
    .header { font-size: 20px; margin-bottom: 20px; }
    .form-grid { grid-template-columns: 1fr; gap: 16px; }
    .display { min-height: 260px; border-radius: 12px; }
    .btn-group { gap: 12px; margin-top: 24px; }
    button { min-width: calc(50% - 6px); padding: 12px 16px; }
    .tooltip { white-space: normal; width: max-content; max-width: 200px; text-align: center; }
}
@media (max-width: 380px) {
    button { min-width: 100%; }
}