:root {
    --bg-main: #0b1220;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-strong: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-sub: #cbd5e1;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.22), transparent 30%),
        radial-gradient(circle at 85% 25%, rgba(14, 165, 233, 0.15), transparent 28%),
        radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.14), transparent 30%),
        linear-gradient(135deg, #020617, #0b1220 40%, #111827);
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.container {
    width: 100%;
    max-width: 580px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.header {
    padding: 28px 28px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.24);
    color: #bfdbfe;
    font-size: 13px;
    margin-bottom: 16px;
}

.title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.subtitle {
    margin: 10px 0 0;
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.75;
}

.content {
    padding: 24px 28px 28px;
}

.panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.label {
    display: block;
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 10px;
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 0 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
    border-color: rgba(59, 130, 246, 0.85);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.input-icon {
    font-size: 18px;
    opacity: 0.9;
}

.input {
    width: 100%;
    height: 54px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 16px;
}

.input::placeholder {
    color: var(--text-muted);
}

.action-row {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.btn {
    border: none;
    outline: none;
    cursor: pointer;
    transition: 0.2s ease;
    font-family: inherit;
    user-select: none;
}

.btn-primary {
    flex: 1;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary-hover), #1e40af);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.copy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    min-width: 110px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 700;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.tip {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.message-area {
    margin-top: 16px;
    min-height: 24px;
}

.message {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.message.show {
    display: flex;
}

.message.loading {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: #dbeafe;
}

.message.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.message.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-area {
    display: none;
    margin-top: 22px;
    gap: 18px;
    flex-direction: column;
}

.result-area.show {
    display: flex;
}

.code-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(6, 182, 212, 0.08)),
        rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.code-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.08);
    color: #dbeafe;
    font-size: 12px;
}

.copy-btn {
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
    font-weight: 700;
}

.copy-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.14);
}

.code-title {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.code-value {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 8px;
    line-height: 1.2;
    color: white;
    word-break: break-all;
    text-shadow: 0 8px 24px rgba(59, 130, 246, 0.22);
}

.code-empty {
    font-size: 20px;
    letter-spacing: 0;
    color: #fca5a5;
}

.code-desc {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.7;
}

.text-panel {
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.text-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.text-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
}

.toggle-btn {
    padding: 8px 12px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-sub);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    font-weight: 700;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.05);
}

.text-body {
    padding: 18px;
    background: rgba(2, 6, 23, 0.24);
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow: auto;
}

.text-body::-webkit-scrollbar {
    width: 8px;
}

.text-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.footer-note {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
}

.kbd {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-sub);
    font-size: 12px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 180px;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 14px;
    color: #fff;
    background: rgba(15, 23, 42, 0.95);
    border-left: 4px solid var(--success);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    word-break: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {
    body {
        padding: 14px;
    }

    .header,
    .content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .title {
        font-size: 24px;
    }

    .action-row {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
    }

    .code-value {
        font-size: 34px;
        letter-spacing: 5px;
    }

    .code-top,
    .text-header {
        flex-direction: column;
        align-items: flex-start;
    }
}:root {
    --bg-main: #0b1220;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-strong: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-sub: #cbd5e1;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.22), transparent 30%),
        radial-gradient(circle at 85% 25%, rgba(14, 165, 233, 0.15), transparent 28%),
        radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.14), transparent 30%),
        linear-gradient(135deg, #020617, #0b1220 40%, #111827);
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.container {
    width: 100%;
    max-width: 580px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.header {
    padding: 28px 28px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.24);
    color: #bfdbfe;
    font-size: 13px;
    margin-bottom: 16px;
}

.title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.subtitle {
    margin: 10px 0 0;
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.75;
}

.content {
    padding: 24px 28px 28px;
}

.panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.label {
    display: block;
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 10px;
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 0 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
    border-color: rgba(59, 130, 246, 0.85);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.input-icon {
    font-size: 18px;
    opacity: 0.9;
}

.input {
    width: 100%;
    height: 54px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 16px;
}

.input::placeholder {
    color: var(--text-muted);
}

.action-row {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.btn {
    border: none;
    outline: none;
    cursor: pointer;
    transition: 0.2s ease;
    font-family: inherit;
    user-select: none;
}

.btn-primary {
    flex: 1;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary-hover), #1e40af);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.copy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    min-width: 110px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 700;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.tip {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.message-area {
    margin-top: 16px;
    min-height: 24px;
}

.message {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.message.show {
    display: flex;
}

.message.loading {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: #dbeafe;
}

.message.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.message.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-area {
    display: none;
    margin-top: 22px;
    gap: 18px;
    flex-direction: column;
}

.result-area.show {
    display: flex;
}

.code-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(6, 182, 212, 0.08)),
        rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.code-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.08);
    color: #dbeafe;
    font-size: 12px;
}

.copy-btn {
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
    font-weight: 700;
}

.copy-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.14);
}

.code-title {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.code-value {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 8px;
    line-height: 1.2;
    color: white;
    word-break: break-all;
    text-shadow: 0 8px 24px rgba(59, 130, 246, 0.22);
}

.code-empty {
    font-size: 20px;
    letter-spacing: 0;
    color: #fca5a5;
}

.code-desc {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.7;
}

.text-panel {
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.text-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.text-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
}

.toggle-btn {
    padding: 8px 12px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-sub);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    font-weight: 700;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.05);
}

.text-body {
    padding: 18px;
    background: rgba(2, 6, 23, 0.24);
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow: auto;
}

.text-body::-webkit-scrollbar {
    width: 8px;
}

.text-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.footer-note {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
}

.kbd {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-sub);
    font-size: 12px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 180px;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 14px;
    color: #fff;
    background: rgba(15, 23, 42, 0.95);
    border-left: 4px solid var(--success);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    word-break: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {
    body {
        padding: 14px;
    }

    .header,
    .content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .title {
        font-size: 24px;
    }

    .action-row {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
    }

    .code-value {
        font-size: 34px;
        letter-spacing: 5px;
    }

    .code-top,
    .text-header {
        flex-direction: column;
        align-items: flex-start;
    }
}:root {
    --bg-main: #0b1220;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-strong: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-sub: #cbd5e1;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.22), transparent 30%),
        radial-gradient(circle at 85% 25%, rgba(14, 165, 233, 0.15), transparent 28%),
        radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.14), transparent 30%),
        linear-gradient(135deg, #020617, #0b1220 40%, #111827);
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.container {
    width: 100%;
    max-width: 580px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.header {
    padding: 28px 28px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.24);
    color: #bfdbfe;
    font-size: 13px;
    margin-bottom: 16px;
}

.title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.subtitle {
    margin: 10px 0 0;
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.75;
}

.content {
    padding: 24px 28px 28px;
}

.panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.label {
    display: block;
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 10px;
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 0 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
    border-color: rgba(59, 130, 246, 0.85);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.input-icon {
    font-size: 18px;
    opacity: 0.9;
}

.input {
    width: 100%;
    height: 54px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 16px;
}

.input::placeholder {
    color: var(--text-muted);
}

.action-row {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.btn {
    border: none;
    outline: none;
    cursor: pointer;
    transition: 0.2s ease;
    font-family: inherit;
    user-select: none;
}

.btn-primary {
    flex: 1;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--primary-hover), #1e40af);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.copy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    min-width: 110px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 700;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.tip {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.message-area {
    margin-top: 16px;
    min-height: 24px;
}

.message {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.message.show {
    display: flex;
}

.message.loading {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: #dbeafe;
}

.message.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.message.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-area {
    display: none;
    margin-top: 22px;
    gap: 18px;
    flex-direction: column;
}

.result-area.show {
    display: flex;
}

.code-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(6, 182, 212, 0.08)),
        rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.code-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.08);
    color: #dbeafe;
    font-size: 12px;
}

.copy-btn {
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
    font-weight: 700;
}

.copy-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.14);
}

.code-title {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.code-value {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 8px;
    line-height: 1.2;
    color: white;
    word-break: break-all;
    text-shadow: 0 8px 24px rgba(59, 130, 246, 0.22);
}

.code-empty {
    font-size: 20px;
    letter-spacing: 0;
    color: #fca5a5;
}

.code-desc {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.7;
}

.text-panel {
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.text-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.text-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
}

.toggle-btn {
    padding: 8px 12px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-sub);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    font-weight: 700;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.05);
}

.text-body {
    padding: 18px;
    background: rgba(2, 6, 23, 0.24);
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow: auto;
}

.text-body::-webkit-scrollbar {
    width: 8px;
}

.text-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.footer-note {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
}

.kbd {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-sub);
    font-size: 12px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 180px;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 14px;
    color: #fff;
    background: rgba(15, 23, 42, 0.95);
    border-left: 4px solid var(--success);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    word-break: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {
    body {
        padding: 14px;
    }

    .header,
    .content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .title {
        font-size: 24px;
    }

    .action-row {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
    }

    .code-value {
        font-size: 34px;
        letter-spacing: 5px;
    }

    .code-top,
    .text-header {
        flex-direction: column;
        align-items: flex-start;
    }
}