:root {
    --bg: #0a0a0a;
    --fg: #e0e0e0;
    --muted: #555;
    --border: #2a2a2a;
    --border-light: #1a1a1a;
    --accent: #3a3a5a;
    --error: #e44;
    --link: #58a6ff;
    --indent: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body::-webkit-scrollbar {
    display: none;
}

body {
    font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    padding-bottom: 80px;
    -webkit-font-smoothing: antialiased;
    scrollbar-width: 0;
    -ms-overflow-style: none;
}

::selection {
    background: var(--accent);
    color: #fff;
}


header,
.gameheader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #060606;
    border-bottom: 1px solid var(--border);
    padding: 0 var(--indent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
}

header h1,
.gameheader h1 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--fg);
}

header h2,
.gameheader h2 {
    color: var(--fg);
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.logo h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--fg);
    margin: 0;
}

nav a {
    color: var(--link);
    text-decoration: none;
    font-size: 12px;
    margin-left: 20px;
    padding: 6px 10px;
    transition: color 0.12s;
}

nav a:hover {
    color: var(--fg);
}


main {
    position: relative;
    height: calc(100vh - 150px);
    margin-top: 20px;
    padding: 0;
    overflow: hidden;
}

.title-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

h1 {
    color: var(--fg);
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.subtitle {
    color: var(--muted);
    font-size: 1rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
    font-family: -apple-system, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}


.quote-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: visible;
    z-index: 2;
}

.quote-card {
    width: 320px;
    height: 380px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    position: absolute;
    transition: border-color 0.2s ease, transform 0.2s linear;
    cursor: grab;
    overflow: hidden;
    z-index: 1;
    transform-origin: center;
}

.dragging {
    cursor: grabbing;
    border-color: var(--accent);
    z-index: 100;
    transition: none;
}

.quote-card::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.04);
    font-family: Georgia, serif;
    opacity: 0.6;
    pointer-events: none;
}

.quote-content {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-top: 60px;
    margin-bottom: 25px;
    color: var(--fg);
    flex-grow: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.quote-author {
    text-align: right;
    font-style: italic;
    color: var(--muted);
    font-size: 1.1rem;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.quote-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--muted);
    padding: 4px 10px;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}


.copy-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 30px;
    height: 30px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    z-index: 10;
}

.copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border-light);
}

.copy-btn:disabled:hover {
    border-color: var(--border-light);
    color: var(--muted);
}

.copy-btn:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.copy-notification {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--fg);
    color: var(--bg);
    padding: 6px 12px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid var(--border);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.copy-notification.show {
    opacity: 1;
}


.controls {
    display: flex;
    gap: 12px;
}

.home-btn,
.add-btn,
.clear-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.1s;
    font-family: inherit;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.home-btn:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.add-btn {
    color: var(--link);
    border-color: #2a2a5a;
    background: #12152a;
}

.add-btn:hover {
    border-color: var(--link);
    color: #aaf;
    background: #1a1f3a;
}

.clear-btn {
    color: var(--error);
    border-color: #5a2a2a;
    background: #2a1215;
}

.clear-btn:hover {
    border-color: #f88;
    color: #faa;
    background: #3a1a1f;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-family: inherit;
}

.btn:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

.btn-clear {
    background: #2a1215;
    border-color: #5a2a2a;
    color: #f88;
}

.btn-clear:hover {
    background: #3a1a1f;
    border-color: #f88;
    color: #faa;
}

.btn-new {
    background: var(--bg);
    border-color: var(--border);
    color: var(--muted);
}

.btn-new:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0 auto;
    padding: 12px 32px;
    gap: 8px;
    background: var(--fg);
    border: 1px solid var(--fg);
    color: var(--bg);
    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-danger {
    background: #2a1215;
    border-color: #5a2a2a;
    color: #f88;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.1s;
    padding: 8px 14px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #3a1a1f;
    border-color: #f88;
    color: #faa;
}

.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);
}


.api-selector {
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 8px 14px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.api-selector:focus {
    border-color: var(--accent);
}


input[type="number"] {
    -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: 6em;
    text-align: center;
    transition: border-color 0.12s;
    appearance: textfield;
}

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);
}

#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);
}

.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;
}


.instructions {
    text-align: center;
    color: var(--muted);
    margin-top: 20px;
    font-size: 12px;
    animation: pulse 2.5s infinite;
    position: relative;
    z-index: 100;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.85;
    }
    100% {
        opacity: 0.5;
    }
}


footer {
    text-align: center;
    padding: 14px var(--indent);
    background: #060606;
    font-size: 11px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}

footer a {
    color: var(--link);
    text-decoration: none;
}

footer a:hover {
    color: var(--fg);
}


.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 50px 20px;
    font-size: 1rem;
    border: 1px dashed var(--border);
    margin: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 500px;
    font-family: -apple-system, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}


.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-top-color: var(--fg);
    animation: spin 0.6s linear infinite;
    margin: 20px auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}


.page-title {
    text-align: center;
    padding: 40px 0 24px;
}

.page-title h1 {
    font-size: 28px;
    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: 14px;
    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 4px rgba(0, 0, 0, 0.6));
    z-index: 10;
    pointer-events: none;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--bg);
    border: 1px solid var(--fg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg);
    font-size: 16px;
    z-index: 10;
    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;
}

.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;
}


.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: 13px;
    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: 3px 8px;
    font-size: 11px;
    transition: all 0.1s;
    font-family: inherit;
}

.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: 14px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 16px;
}

.result-title i {
    margin-right: 6px;
}

.result-display {
    font-size: 32px;
    font-weight: 700;
    color: var(--fg);
    min-height: 60px;
    line-height: 1.4;
    word-break: break-word;
}

.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;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.result-header .section-label {
    margin-bottom: 0;
}


.history-container {
    margin-top: 32px;
    text-align: left;
}

.history-title {
    font-size: 13px;
    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: 12px;
    transition: border-color 0.2s;
}

.history-tag:hover {
    border-color: var(--accent);
}

.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: 999;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}


.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-spinner 0.6s linear infinite;
}

@keyframes spin-spinner {
    to {
        transform: rotate(360deg);
    }
}


@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);
    }
}

@keyframes pop {
    50% {
        transform: scale(0.95);
    }
}

.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;
}

.animate-result {
    animation: pop 0.3s ease;
}


.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;
}

.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;
}

.audio-player {
    width: 100%;
    margin-top: 6px;
    height: 36px;
    filter: invert(1) hue-rotate(180deg);
}

audio.audio-player::-webkit-media-controls-panel {
    background-color: #0a0a0a;
}

.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;
}

.section {
    padding: 24px 0;
}

.section-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 14px;
}

.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);
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}


@media (max-width: 768px) {
    :root {
        --indent: 16px;
    }

    header,
    .gameheader {
        flex-direction: column;
        height: auto;
        padding: 12px var(--indent);
        gap: 10px;
        text-align: center;
    }

    nav a {
        margin: 0 6px;
        font-size: 11px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .quote-card {
        width: 260px;
        height: 340px;
        padding: 20px 16px;
    }

    .quote-content {
        font-size: 1.1rem;
        margin-top: 50px;
    }

    .quote-author {
        font-size: 1rem;
    }

    .controls {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .wheel-container {
        flex-direction: column;
        padding: 0 var(--indent);
    }

    .wheel-section.controls {
        max-width: 100%;
    }

    .page-title h1 {
        font-size: 1.6rem;
    }

    .result-display {
        font-size: 26px;
    }

    .result-value {
        font-size: 26px;
    }

    .cards-grid {
        flex-direction: column;
        padding: 24px var(--indent);
    }

    .random-card {
        flex: 1 1 auto;
    }
}

@media (max-width: 560px) {
    :root {
        --indent: 14px;
    }

    .quote-card {
        width: 240px;
        height: 320px;
        padding: 16px 12px;
    }

    .quote-content {
        font-size: 1rem;
        margin-top: 40px;
    }

    .quote-author {
        font-size: 0.9rem;
    }

    .select-btn {
        padding: 7px 14px;
        font-size: 12px;
    }

    .page-title h1 {
        font-size: 1.4rem;
    }

    .result-display {
        font-size: 22px;
    }
}

@media (max-width: 400px) {
    .quote-card {
        width: 200px;
        height: 300px;
        padding: 14px 10px;
    }

    .quote-content {
        font-size: 0.9rem;
        margin-top: 35px;
    }

    .btn-primary {
        padding: 10px 20px;
        font-size: 12px;
    }
}


/* 世界时钟 */


.world-clocks-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
    overflow: hidden;
    margin-top: 60px;
}

.clock-container {
    position: absolute;
    width: 280px;
    background: linear-gradient(145deg, #1e1e2a, #14141c);
    border-radius: 20px;
    padding: 16px 12px 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
    cursor: grab;
    backdrop-filter: blur(2px);
}

.clock-container:active {
    cursor: grabbing;
}

.card-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 20;
}

.edit-btn, .color-btn, .close-btn {
    background: rgba(10,10,10,0.7);
    border: 1px solid var(--border);
    color: var(--muted);
    width: 28px;
    height: 28px;
    border-radius: 30px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    backdrop-filter: blur(4px);
}

.edit-btn:hover, .color-btn:hover {
    border-color: var(--fg);
    color: var(--fg);
    background: #1a1a1a;
}

.close-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

.clock-header {
    text-align: center;
    margin-bottom: 12px;
}

.clock-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--fg);
}

.timezone-info {
    font-size: 0.7rem;
    color: var(--muted);
    font-family: monospace;
}

.digital-time {
    font-family: 'Fira Code', monospace;
    font-size: 2rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 2px;
    margin: 12px 0;
    color: #bbf0ff;
    text-shadow: 0 0 2px #00aaff88;
}

.analog-clock {
    display: block;
    margin: 8px auto;
    width: 120px;
    height: 120px;
    background: #0a0a0a;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #2a2a2a;
}

.date-info {
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 10px;
    font-family: monospace;
}

.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal {
    background: #0f0f12;
    border: 1px solid var(--border);
    padding: 24px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 35px rgba(0,0,0,0.5);
}

.modal h2 {
    margin-top: 0;
    font-size: 1.4rem;
    color: var(--fg);
    text-align: center;
}

.controls-row {
    margin: 16px 0;
}

#tzFilter {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px 12px;
    color: var(--fg);
    font-family: inherit;
}

#timezoneSelect {
    width: 100%;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 8px;
    font-family: monospace;
}

.btn-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.color-dot {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: transform 0.1s;
    cursor: pointer;
}

.color-dot:hover {
    transform: scale(1.1);
    border-color: var(--fg);
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.custom-select-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    background: #060606;
    outline: none;
}

.custom-select-list::-webkit-scrollbar {
    width: 4px;
}
.custom-select-list::-webkit-scrollbar-track {
    background: transparent;
}
.custom-select-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

.custom-option {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--fg);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s, color 0.1s;
    user-select: none;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: #1a1a1a;
    color: var(--fg);
}

.custom-option.selected {
    background: var(--accent);
    color: #fff;
    border-left: 3px solid var(--link);
}


/* 卡片墙 */


.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}


.card-title-text {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    letter-spacing: 0.3px;
    flex: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}


.card-actions {
    display: flex;
    gap: 6px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.quote-card:hover .card-actions {
    opacity: 1;
}


.action-btn {
    width: 28px;
    height: 28px;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #c0d0e0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    backdrop-filter: blur(4px);
}

.action-btn:hover {
    background: rgba(30, 40, 60, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    transform: scale(1.05);
}

.action-btn:active {
    transform: scale(0.96);
}


.card-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin: 12px 0 12px 0;
    font-size: 0.9rem;
    line-height: 1.55;
    scrollbar-width: thin;
}


.card-content::-webkit-scrollbar {
    width: 4px;
}

.card-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.card-content::-webkit-scrollbar-thumb {
    background: rgba(200, 220, 255, 0.3);
    border-radius: 4px;
}

.card-content::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 220, 255, 0.5);
}


.card-content h1,
.card-content h2,
.card-content h3,
.card-content h4 {
    margin: 0.8em 0 0.4em;
    font-weight: 600;
    color: inherit;
}

.card-content h1 { font-size: 1.4rem; border-left: 3px solid currentColor; padding-left: 10px; }
.card-content h2 { font-size: 1.2rem; }
.card-content h3 { font-size: 1.05rem; }
.card-content p { margin: 0.5em 0; }
.card-content ul, 
.card-content ol { 
    margin: 0.4em 0;
    padding-left: 1.5em;
}
.card-content li { margin: 0.2em 0; }
.card-content code {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: "Fira Code", monospace;
    font-size: 0.85em;
}
.card-content pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.card-content blockquote {
    border-left: 3px solid currentColor;
    margin: 0.6em 0;
    padding-left: 1em;
    opacity: 0.85;
    font-style: italic;
}
.card-content a {
    color: #7abfff;
    text-decoration: none;
    border-bottom: 1px dotted rgba(122, 191, 255, 0.4);
}
.card-content a:hover {
    border-bottom-color: #7abfff;
}
.card-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 8px 0;
}
.card-content strong {
    font-weight: 700;
    color: inherit;
}
.card-content hr {
    margin: 12px 0;
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}


.card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
    margin-top: 8px;
    font-size: 0.7rem;
    font-family: monospace;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s;
}

.quote-card:hover .card-footer {
    opacity: 1;
}


.quote-card {
    transition: border-color 0.2s ease, transform 0.2s linear, box-shadow 0.2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.quote-card:hover {
    border-color: rgba(100, 150, 220, 0.6);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}


.quote-card.deleting {
    opacity: 0 !important;
    transform: scale(0.85) rotate(-2deg);
    transition: opacity 0.25s ease, transform 0.2s ease;
    pointer-events: none;
}


.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #aaa;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: #111115;
    border: 1px solid #2a2a30;
    padding: 10px 12px;
    color: #eef4ff;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.12s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3a6ea5;
    box-shadow: 0 0 0 1px rgba(58, 110, 165, 0.3);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}


.row-2col {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.row-2col .form-group {
    flex: 1;
    margin-bottom: 0;
}


.modal .btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 8px;
    border-top: 1px solid #2a2a30;
}

.btn-secondary {
    background: #1e1e24;
    border: 1px solid #3a3a44;
    color: #ccccdd;
    padding: 8px 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.12s;
}

.btn-secondary:hover {
    background: #2a2a34;
    border-color: #5a6a8a;
    color: #ffffff;
}

.btn-primary {
    background: #2a4c7a;
    border: 1px solid #3a6caa;
    color: white;
    padding: 8px 24px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.12s;
}

.btn-primary:hover {
    background: #3a5c8c;
    border-color: #5a8cbc;
    transform: scale(0.98);
}


.modal h3 {
    margin: 0 0 20px 0;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    color: #eef4ff;
    letter-spacing: 0.5px;
}


input[type="color"] {
    width: 48px;
    height: 38px;
    border: 1px solid #3a3a44;
    background: #0a0a0f;
    cursor: pointer;
    padding: 2px;
}


.inline-label {
    position: relative;
    display: inline-block;
}

.inline-label summary {
    cursor: pointer;
    padding: 2px 14px;
    background: #111115;
    border: 1px solid #2a2a30;
    font-size: 0.85rem;
    color: #bcc;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-label summary::-webkit-details-marker {
    display: none;
}

.inline-label[open] .in {
    position: absolute;
    top: 42px;
    left: 0;
    background: #15151c;
    border: 1px solid #2a2a35;
    padding: 14px;
    min-width: 220px;
    z-index: 200;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.inline-label .in input {
    width: 100%;
}


.limit {
    text-align: center;
    font-weight: 500;
}


.empty-state {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    padding: 32px 24px;
}


.toast {
    background: #1a2c3a;
    color: #d4f1ff;
    border: 1px solid #2f6080;
    font-family: monospace;
}


.card-footer {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-footer:hover {
    white-space: normal;
    word-break: break-word;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 4px 6px;
    margin-top: 4px;
}