﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* 去除所有元素的焦点蓝色背景 */
*:focus {
    outline: none !important;
}

button:focus,
select:focus,
input:focus,
textarea:focus,
a:focus {
    outline: none !important;
}

/* 去除点击时的高亮效果 */
button,
select,
input,
textarea,
a {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 允许输入框选择文本 */
input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* ── Material Icons 回退样式，防止加载时闪烁 */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
    /* 防止图标加载前的布局偏移 */
    min-width: 1em;
    min-height: 1em;
}

:root {
    --bg:       #0a0a0a;
    --surface:  #111111;
    --border:   #1a1a1a;
    --border2:  #252525;
    --text:     #ffffff;
    --muted:    #888888;
    --blue:     #D97554;
    --blue-dim: #C66543;
    --green:    #10b981;
    --green-bg: rgba(16,185,129,.12);
    --primary:  #f59e0b;
    --yellow:   #f59e0b;
    --red:      #ef4444;
    --red-bg:   rgba(239,68,68,.1);
    --radius:   12px;
    --mono:     'JetBrains Mono', monospace;
    --sans:     'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 24px 60px;
    line-height: 1.6;
    /* 防止字体加载时的闪烁 */
    opacity: 0;
    animation: fadeInBody 0.3s ease 0.1s forwards;
    /* 网格极客风格背景 */
    position: relative;
    overflow-x: hidden;
}

/* 桌面端增加 padding */
@media (min-width: 768px) {
    body {
        padding: 24px 16px 60px;
    }
}

/* 网格背景层 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(217, 117, 84, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(217, 117, 84, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* 渐变光晕效果 */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(217, 117, 84, 0.08) 0%,
        transparent 50%
    );
    pointer-events: none;
    z-index: 0;
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10%, -10%); }
}

/* 确保内容在背景之上 */
.header, .card, .enter-form, .result-card, #toast, .modal-overlay, #app {
    position: relative;
    z-index: 1;
}

/* actions 需要更高的 z-index 以便下拉框显示在其他元素上方 */
.actions {
    position: relative;
    z-index: 10 !important;
}

/* ── App 容器 */
#app {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

@keyframes fadeInBody {
    to { opacity: 1; }
}

/* ── Header */
.header {
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    position: relative;
}
.logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0;
}
.logo span { 
    background: linear-gradient(135deg, #D97554 0%, #E89A7E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-left: 5px;
}
.header-hint {
    font-size: 11px;
    color: var(--muted);
    text-align: right;
    line-height: 1.4;
}
.header-switch-btn {
    position: absolute;
    top: -8px;
    right: 0;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--sans);
}
.header-switch-btn:hover {
    background: var(--bg);
    border-color: var(--blue);
    color: var(--blue);
    transform: translateY(-1px);
}
.header-switch-btn .material-icons {
    font-size: 18px;
}

@media (max-width: 480px) {
    .header {
        flex-wrap: wrap;
        gap: 12px;
    }
    .header-hint {
        font-size: 10px;
        order: 3;
        width: 100%;
        text-align: left;
    }
    .header-switch-btn {
        position: static;
        order: 2;
    }
    
    /* 移动端倒计时徽章调整 - 保持右上角，调整内容布局 */
    .status-area {
        min-height: 80px;
        padding-right: 0;
    }
    
    .countdown-badge {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 100px;
        text-align: center;
        line-height: 1.3;
    }
    
    .status-waiting {
        padding-right: 110px !important;
        min-height: 50px;
        align-items: flex-start;
    }
    
    .status-waiting #waitText {
        text-align: left;
        line-height: 1.5;
    }
}

/* ── Card */
.card {
    width: 100%;
    max-width: 560px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: border-color .2s ease;
}
.card:hover { border-color: var(--border2); }
.card-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

/* ── Phone display */
.phone-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.phone-flag { font-size: 22px; line-height: 1; flex-shrink: 0; }
.phone-number {
    flex: 1;
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text);
    word-break: break-all;
}
.phone-skeleton {
    height: 16px;
    background: var(--border);
    border-radius: 4px;
    width: 180px;
    animation: pulse 1.4s ease infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}
.copy-btn {
    background: var(--border2);
    border: none;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    min-width: 40px; /* 固定最小宽度 */
    min-height: 32px; /* 固定最小高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}
.copy-btn:hover { background: var(--blue-dim); color: #fff; }
.copy-btn.copied { background: var(--green-bg); color: var(--green); }

/* ── Status area */
.status-area { min-height: 80px; position: relative; }
.countdown-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(217, 117, 84, 0.2) 0%, rgba(232, 154, 126, 0.15) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(217, 117, 84, 0.4);
    color: #fff;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
    box-shadow: 
        0 0 30px rgba(217, 117, 84, 0.5),
        0 0 60px rgba(217, 117, 84, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: none;
    animation: glowPulse 3s ease-in-out infinite;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    max-width: 150px;
    text-align: center;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
}
.countdown-badge.show { 
    display: flex;
    align-items: center;
    gap: 6px;
}

.countdown-badge .material-icons {
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 
            0 0 30px rgba(217, 117, 84, 0.5),
            0 0 60px rgba(217, 117, 84, 0.3),
            0 8px 24px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
        transform: translateY(0);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(217, 117, 84, 0.7),
            0 0 80px rgba(217, 117, 84, 0.4),
            0 12px 32px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
    }
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.countdown-badge:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 0 40px rgba(217, 117, 84, 0.7),
        0 0 80px rgba(217, 117, 84, 0.4),
        0 12px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.status-waiting {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 14px;
    padding-right: 160px;
}

.status-waiting #waitText {
    line-height: 1.5;
    word-break: break-word;
}
.spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--border2);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar {
    width: 100%;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 14px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 2px;
    transition: width .5s linear;
}

.status-success {
    border: 1px solid var(--primary);
    background: rgba(217, 117, 84, .12);
    border-radius: var(--radius);
    padding: 16px;
}
.status-success .label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 10px;
}
.sms-full-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    word-break: break-word;
    margin-bottom: 14px;
    background: var(--bg);
    border-radius: 4px;
    padding: 10px 12px;
    font-family: var(--mono);
}

/* 多条短信卡片容器 */
.sms-cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

/* 单条短信卡片 */
.sms-card {
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 16px;
    transition: all .2s ease;
}

.sms-card:hover {
    border-color: var(--blue-dim);
    box-shadow: 0 2px 8px rgba(217, 117, 84, .1);
}

.sms-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.sms-card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sms-card-badge {
    font-size: 11px;
    color: var(--green);
    background: var(--green-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sms-card .sms-full-text {
    margin-bottom: 12px;
}

.sms-card .code-highlight {
    display: block;
    text-align: center;
    margin-bottom: 12px;
}

.sms-card .btn-row {
    justify-content: center;
}

.code-highlight {
    display: inline-block;
    color: var(--primary);
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 3px;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
}
.btn-tips{
    font-size: 14px;
    color: #afafaf;
    text-align: center;
    margin-top: 10px;
}
.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
    white-space: nowrap;
    min-height: 42px; /* 固定最小高度，防止图标加载时跳动 */
}
.btn .material-icons {
    font-size: 18px;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary   { 
    background: var(--blue); 
    color: #fff; 
    border-color: var(--blue-dim);
    box-shadow: 0 4px 12px rgba(217, 117, 84, .2);
}
.btn-primary:hover:not(:disabled) { 
    background: var(--blue-dim);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(217, 117, 84, .3);
}
.btn-danger    { background: var(--red-bg); color: var(--red); border-color: rgba(239,68,68,.3); }
.btn-danger:hover:not(:disabled)  { background: rgba(239,68,68,.2); }
.btn-default   { background: var(--border2); color: var(--text); border-color: var(--border2); }
.btn-default:hover:not(:disabled) { background: #3a3f47; }
.btn-green     { background: rgb(0, 206, 117); color: var(--text); border-color: rgba(217, 117, 84, .3); }
.btn-green:hover:not(:disabled)   { background: rgba(0, 206, 117, 0.3); }

/* 按钮尺寸变体 */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
}
.btn-sm .material-icons {
    font-size: 16px;
}

/* ── Large primary button */
.btn-large {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    justify-content: center;
    min-height: 52px; /* 大按钮的固定最小高度 */
}
.btn-large .material-icons {
    font-size: 22px;
}

/* ── Warning button (for refund) */
.btn-warning {
    background: rgba(245, 158, 11, .15);
    color: var(--yellow);
    border-color: rgba(245, 158, 11, .3);
}
.btn-warning:hover:not(:disabled) {
    background: rgba(245, 158, 11, .25);
}

/* 桌面端按钮样式 */
@media (min-width: 768px) {
    .btn-large {
        width: 100%;
        min-width: auto;
    }
}

/* ── Actions row */
.actions {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
    z-index: 1000;
}
.action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Tutorial button container */
.tutorial-btn-container {
    position: relative;
    z-index: 1;
}

/* ── Custom country selector */
.country-selector {
    position: relative;
    flex: 1;
    z-index: 100;
}
.country-select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border2);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .2s ease;
}
.country-select-btn:hover {
    border-color: var(--blue);
    background: var(--bg);
}
.country-select-btn.open {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(217, 117, 84, .1);
}
.country-select-current {
    display: flex;
    align-items: center;
    gap: 10px;
}
.country-flag {
    font-size: 20px;
    line-height: 1;
}
.country-name {
    font-weight: 500;
}
.country-select-arrow {
    font-size: 20px;
    color: var(--muted);
    transition: transform .2s ease;
}
.country-select-btn.open .country-select-arrow {
    transform: rotate(180deg);
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: dropdownSlide .2s ease;
}
.country-dropdown.show {
    display: block;
}
@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.country-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background .15s ease;
    border-bottom: 1px solid var(--border);
}
.country-option:last-child {
    border-bottom: none;
}
.country-option:hover {
    background: var(--bg);
}
.country-option.selected {
    background: rgba(217, 117, 84, .1);
    color: var(--blue);
}
.country-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--surface);
}
.country-option.disabled:hover {
    background: var(--surface);
}
.country-option .country-flag {
    font-size: 20px;
}
.country-option .country-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}
.country-option .country-unavailable {
    font-size: 11px;
    color: var(--red);
    background: var(--red-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}
.country-option .material-icons {
    font-size: 20px;
    color: var(--blue);
    opacity: 0;
}
.country-option.selected .material-icons {
    opacity: 1;
}
.country-option.disabled .material-icons {
    display: none;
}

/* 隐藏原生 select */
.country-select {
    display: none;
}

.timer-text { font-size: 12px; color: var(--muted); margin-left: auto; font-family: var(--mono); }

/* ── Enter code form */
.enter-form { width: 100%; max-width: 560px; text-align: center; margin-top: 60px; }
.enter-form h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.enter-form p  { font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.code-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    text-transform: uppercase;
    transition: border-color .15s;
}
.code-input:focus { outline: none; border-color: var(--blue); }
.code-input::placeholder { color: var(--border2); letter-spacing: 0; font-weight: 400; }

/* ── Error / Used page */
.result-card {
    width: 100%;
    max-width: 560px;
    margin-top: 60px;
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    overflow: hidden;
    background: #000000;
}
.result-header {
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.result-header.error  { background: #000000; border-bottom: 1px solid rgba(239,68,68,.3); color: var(--red); }
.result-header.used   { background: #000000; border-bottom: 1px solid rgba(217, 117, 84, .3); color: var(--primary); }
.result-body { padding: 20px; background: #000000; }
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    gap: 12px;
}
.result-row:last-child { border-bottom: none; }
.result-row .k { color: var(--muted); font-size: 12px; }
.result-row .v { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--blue);
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ── Notification toast */
#toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--border2);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
    z-index: 999;
    white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Copy Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn .2s ease;
}
.modal-overlay.show { display: flex; }
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 560px;
    width: 90%;
    animation: slideUp .3s ease;
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-title .material-icons {
    color: var(--yellow);
}
.modal-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}
.modal-message {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 20px;
}
.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.modal-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
}
.modal-hint {
    font-size: 12px;
    margin-top: 4px;
    padding-left: 4px;
}
.btn-blue {
    background: rgba(217, 117, 84, .1);
    color: var(--blue);
    border-color: rgba(217, 117, 84, .3);
}

/* 卡密输入框样式 */
.code-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all .2s;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.code-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.code-input::placeholder {
    color: var(--muted);
    text-transform: none;
    letter-spacing: normal;
}

.input-error {
    font-size: 13px;
    color: var(--red);
    margin-top: 8px;
    min-height: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-error:empty {
    display: none;
}

/* 卡密过期卡片样式优化 */
.expiry-card {
    padding: 12px 16px !important;
    margin-bottom: 16px;
}

/* Toast 弹窗样式 */
.toast-modal {
    max-width: 400px;
    text-align: center;
}

.toast-modal .modal-message {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 24px;
    white-space: pre-wrap;
}

/* 过期卡片中的切换卡密按钮 */
.expiry-switch-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--sans);
    white-space: nowrap;
    flex-shrink: 0;
}

.expiry-switch-btn:hover {
    background: var(--bg);
    border-color: var(--blue);
    color: var(--blue);
    transform: translateY(-1px);
}

.expiry-switch-btn .material-icons {
    font-size: 18px;
}

@media (max-width: 480px) {
    .expiry-switch-btn span:last-child {
        display: none;
    }
    .expiry-switch-btn {
        padding: 8px 10px;
    }
}

/* 复制按钮带文字样式 */
.copy-btn-with-text {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    min-width: auto;
}

.copy-btn-with-text .material-icons {
    font-size: 16px;
}

.copy-btn-text {
    font-size: 13px;
    font-weight: 500;
}

/* 图片预览弹窗样式 */
.image-preview-modal {
    z-index: 10001 !important; /* 高于教程弹窗 */
}

.image-preview-box {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: slideUp .3s ease;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}

.image-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255,255,255,.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    z-index: 1001;
}

.image-close-btn:hover {
    background: white;
    transform: scale(1.1);
}

.image-close-btn .material-icons {
    font-size: 24px;
    color: #333;
}

/* 教程卡片样式 */
.tutorial-card {
    margin-top: 24px;
    padding: 12px;
}

.tutorial-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 140px;
    float: left;
    margin-right: 20px;
}

.tutorial-tab {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    text-align: left;
}

.tutorial-tab:hover {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border2);
}

.tutorial-tab.active {
    color: var(--primary);
    background: rgba(217, 117, 84, .1);
    border-color: var(--primary);
}

.tutorial-tab .material-icons {
    font-size: 16px;
}

.tutorial-content {
    margin-left: 160px;
    min-height: 300px;
}

.tutorial-panel {
    display: none;
    animation: fadeIn .3s ease;
}

.tutorial-panel.active {
    display: block;
}

/* 教程步骤样式 */
.tutorial-step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.tutorial-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 16px;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text);
}

.step-content p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
}

.step-content p strong {
    color: var(--yellow);
    font-weight: 600;
}

.step-content a {
    color: var(--primary);
    text-decoration: none;
}

.step-content a:hover {
    text-decoration: underline;
}

.step-image {
    margin-top: 12px;
    padding: 0;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    overflow: hidden;
    cursor: pointer;
    transition: all .2s;
}

.step-image:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 117, 84, .2);
}

.step-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 常见问题样式 */
.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text);
}

.faq-item p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--red);
    margin: 0;
}

/* 清除浮动 */
.tutorial-card::after {
    content: "";
    display: table;
    clear: both;
}

/* 响应式优化 */
@media (max-width: 640px) {
    .tutorial-tabs {
        float: none;
        width: 100%;
        flex-direction: row;
        gap: 8px;
        margin-right: 0;
        margin-bottom: 20px;
        overflow-x: auto;
    }
    
    .tutorial-tab {
        flex: 1;
        min-width: 100px;
        justify-content: center;
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .tutorial-tab .material-icons {
        font-size: 18px;
    }
    
    .tutorial-content {
        margin-left: 0;
    }
    
    .tutorial-step {
        flex-direction: column;
        gap: 12px;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

/* ── 引导高亮效果 */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.guide-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.guide-highlight {
    position: relative;
    z-index: 9999 !important;
    box-shadow: 0 0 0 4px rgba(217, 117, 84, 0.6),
                0 0 0 8px rgba(217, 117, 84, 0.3),
                0 0 40px rgba(217, 117, 84, 0.5);
    animation: guideGlow 2s ease-in-out infinite;
    pointer-events: auto;
    background: var(--surface) !important;
}

/* 确保高亮元素的父容器也有足够的 z-index */
.guide-highlight-parent {
    position: relative;
    z-index: 9999 !important;
}

@keyframes guideGlow {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(217, 117, 84, 0.6),
                    0 0 0 8px rgba(217, 117, 84, 0.3),
                    0 0 40px rgba(217, 117, 84, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(217, 117, 84, 0.8),
                    0 0 0 12px rgba(217, 117, 84, 0.4),
                    0 0 60px rgba(217, 117, 84, 0.7);
    }
}

.guide-tooltip {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--blue);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 250px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.guide-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.guide-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--blue);
}

.guide-tooltip-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-tooltip-text .material-icons {
    font-size: 20px;
    color: var(--blue);
}

/* ── 教程弹窗样式 */
.tutorial-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.tutorial-modal-overlay.show {
    display: flex;
}

.tutorial-modal-box {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.tutorial-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tutorial-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.tutorial-close-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.tutorial-close-btn:hover {
    background: var(--border);
    color: var(--text);
}

.tutorial-close-btn .material-icons {
    font-size: 24px;
}

.tutorial-modal-body {
    padding: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: row;
}

/* 教程选项卡 - 弹窗内左侧垂直布局 */
.tutorial-modal-body .tutorial-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border-right: 2px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
    width: 200px;
}

.tutorial-modal-body .tutorial-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tutorial-modal-body .tutorial-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
}

.tutorial-modal-body .tutorial-tab.active {
    color: var(--primary);
    background: rgba(217, 117, 84, 0.1);
    border-color: var(--primary);
}

.tutorial-modal-body .tutorial-tab .material-icons {
    font-size: 20px;
}

/* 教程内容 */
.tutorial-modal-body .tutorial-content {
    margin: 0;
    overflow-y: auto;
    flex: 1;
    padding: 24px;
}

.tutorial-modal-body .tutorial-panel {
    display: none;
}

.tutorial-modal-body .tutorial-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .tutorial-modal-overlay {
        padding: 0;
    }
    
    .tutorial-modal-box {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .tutorial-modal-header {
        padding: 16px 20px;
    }
    
    .tutorial-modal-body {
        padding: 0;
        flex-direction: column;
    }
    
    .tutorial-modal-body .tutorial-tabs {
        flex-direction: row;
        width: 100%;
        padding: 0 16px;
        border-right: none;
        border-bottom: 2px solid var(--border);
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .tutorial-modal-body .tutorial-content {
        padding: 20px 16px;
    }
    
    .tutorial-modal-body .tutorial-tab {
        padding: 10px 12px;
        font-size: 13px;
        gap: 6px;
        border: none;
        border-bottom: 3px solid transparent;
        border-radius: 0;
        margin-bottom: -2px;
    }
    
    .tutorial-modal-body .tutorial-tab:hover {
        background: rgba(255, 255, 255, 0.03);
        border-bottom-color: var(--border);
    }
    
    .tutorial-modal-body .tutorial-tab.active {
        background: transparent;
        border-bottom-color: var(--primary) !important;
    }
    
    .tutorial-modal-body .tutorial-tab.active:hover {
        border-bottom-color: var(--primary) !important;
    }
    
    .tutorial-modal-body .tutorial-tab .material-icons {
        font-size: 18px;
    }
}

/* 滚动条样式 */
.tutorial-modal-body .tutorial-content::-webkit-scrollbar {
    width: 8px;
}

.tutorial-modal-body .tutorial-content::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.tutorial-modal-body .tutorial-content::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 4px;
}

.tutorial-modal-body .tutorial-content::-webkit-scrollbar-thumb:hover {
    background: var(--blue);
}

/* ── 公告弹窗样式 */
.announcement-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.announcement-modal-overlay.show {
    display: flex;
}

.announcement-modal-box {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.announcement-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.announcement-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.announcement-close-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.announcement-close-btn:hover {
    background: var(--border);
    color: var(--text);
}

.announcement-close-btn .material-icons {
    font-size: 24px;
}

.announcement-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
}

.announcement-modal-body h3 {
    font-size: 18px;
    margin: 0 0 12px 0;
    color: var(--text);
}

.announcement-modal-body p {
    margin: 0 0 12px 0;
    color: var(--text);
}

.announcement-modal-body strong {
    color: var(--primary);
    font-weight: 600;
}

.announcement-modal-body ul {
    margin: 12px 0;
    padding-left: 24px;
}

.announcement-modal-body li {
    margin: 8px 0;
    color: var(--text);
}

.announcement-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.announcement-modal-footer .btn {
    min-width: 120px;
    justify-content: center;
}

/* 响应式 */
@media (max-width: 768px) {
    .announcement-modal-box {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--radius);
    }
    
    .announcement-modal-header {
        padding: 16px 20px;
    }
    
    .announcement-modal-body {
        padding: 20px 16px;
    }
    
    .announcement-modal-footer {
        padding: 12px 16px;
    }
}

/* 滚动条样式 */
.announcement-modal-body::-webkit-scrollbar {
    width: 8px;
}

.announcement-modal-body::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.announcement-modal-body::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 4px;
}

.announcement-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--blue);
}
