* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Nunito Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #edf2f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.container {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.05);
    padding: 32px 24px 24px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

h1 {
    color: #343a40;
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 24px;
}

/* Logo 区域 */
.logo-section {
    margin-bottom: 24px;
}

.logo-img {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    display: block;
    border-radius: 20px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}

.logo-fallback {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    background: #343a40;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.logo-desc {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

.slider-verify {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-title {
    color: #343a40;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.verify-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    width: 100%;
    max-width: 360px;
}

.verify-title {
    color: #343a40;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.verify-tip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 360px;
    margin-bottom: 12px;
}

.verify-tip-text {
    color: #6c757d;
    font-size: 14px;
    font-weight: 400;
}

.refresh-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.refresh-btn:hover {
    color: #343a40;
    background: rgba(0, 0, 0, 0.05);
}

.refresh-btn svg {
    width: 16px;
    height: 16px;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 360px;
    height: 160px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 0 auto 16px auto;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.canvas-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.slider-track {
    position: relative;
    width: 100%;
    max-width: 360px;
    height: 44px;
    background: #f8f9fa;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e9ecef;
    margin: 0 auto;
}

.slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #e9ecef;
    border-radius: 0.5rem;
    width: 0;
    transition: width 0.1s ease;
}

.slider-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 14px;
    user-select: none;
    pointer-events: none;
}

.slider-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 38px;
    height: 38px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s, transform 0.15s;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.slider-btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-color: #ced4da;
}

.slider-btn:active {
    transform: scale(0.97);
}

.slider-btn svg {
    width: 18px;
    height: 18px;
    color: #6c757d;
}

.slider-track.success .slider-fill {
    background: #d4edda;
}

.slider-track.success .slider-btn {
    border-color: #28a745;
    background: #28a745;
}

.slider-track.success .slider-btn svg {
    color: #fff;
}

.slider-track.success .slider-text {
    color: #28a745;
    font-weight: 600;
}

.slider-track.error .slider-fill {
    background: #f8d7da;
}

.slider-track.error .slider-btn {
    border-color: #dc3545;
    background: #dc3545;
}

.slider-track.error .slider-btn svg {
    color: #fff;
}

.message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 0.375rem;
    font-size: 14px;
    display: none;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
    border: 1px solid #f5c6cb;
}

.message.success {
    background: #d4edda;
    color: #155724;
    display: block;
    border: 1px solid #c3e6cb;
}

.footer {
    margin-top: 30px;
    color: #adb5bd;
    font-size: 12px;
}

/* 收藏提示 */
.bookmark-tip {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: #856404;
    text-align: left;
}

.bookmark-tip .tip-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.bookmark-tip .tip-text {
    flex: 1;
    line-height: 1.5;
}

.bookmark-btn {
    flex-shrink: 0;
    padding: 7px 16px;
    background: #343a40;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.bookmark-btn:hover {
    background: #23272b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 收藏提示浮层 */
.bookmark-tooltip {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #fff;
    border-radius: 0.75rem;
    padding: 28px 24px;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
    z-index: 10000;
    width: 88%;
    max-width: 380px;
    text-align: center;
    animation: tipPopIn 0.3s ease-out;
}

.bookmark-tooltip.active {
    display: block;
    transform: translate(-50%, -50%) scale(1);
}

.bookmark-tooltip-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
}

.bookmark-tooltip-mask.active {
    display: block;
}

@keyframes tipPopIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.bookmark-tooltip-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: #343a40;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.bookmark-tooltip h3 {
    font-size: 18px;
    color: #343a40;
    margin-bottom: 8px;
    font-weight: 700;
}

.bookmark-tooltip-desc {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.6;
}

.shortcut-card {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.shortcut-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 10px;
}

.shortcut-keys {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.key-box {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 13px;
    color: #495057;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    min-width: 28px;
    text-align: center;
}

.key-plus {
    color: #adb5bd;
    font-weight: bold;
}

.bookmark-tip-close {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    color: #495057;
    border: none;
    border-radius: 0.375rem;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.bookmark-tip-close:hover {
    background: #e9ecef;
    color: #343a40;
}

.mobile-tip {
    font-size: 13px;
    line-height: 1.6;
    padding: 14px;
    background: #e2e6ea;
    border-radius: 0.375rem;
    margin-bottom: 16px;
    text-align: left;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.mobile-tip strong {
    color: #343a40;
    display: block;
    margin-bottom: 6px;
}

/* 弹层样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeInOverlay 0.25s ease-out;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-wrapper {
    position: relative;
    width: 92%;
    max-width: 480px;
    max-height: 88vh;
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
    animation: popInModal 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

@keyframes popInModal {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #343a40;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #dc3545;
    color: #fff;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* 弹层内 Logo 区域 */
.modal-logo-section {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-logo-img {
    /*width: 200px;*/
    height: 80px;
    display: block;
    margin: 0 auto 12px;
    border-radius: 20px;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

.modal-logo-fallback {
    width: 200px;
    height: 80px;
    margin: 0 auto 12px;
    background: #343a40;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.modal-logo-desc {
    color: #6c757d;
    font-size: 13px;
    line-height: 1.5;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.modal-tip {
    font-size: 12px;
    color: #6c757d;
    flex: 1;
    line-height: 1.5;
}

.modal-tip strong {
    color: #343a40;
}

.refresh-btn-modal {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: #343a40;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.refresh-btn-modal:hover {
    background: #23272b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.refresh-btn-modal:active {
    transform: translateY(0);
}

.refresh-btn-modal.refreshing svg {
    animation: spin 0.8s linear infinite;
}

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

.refresh-btn-modal svg {
    width: 14px;
    height: 14px;
}

/* 站点列表 - 表格样式 */
.site-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-item {
    display: grid;
    grid-template-columns: 50px 80px 1fr 90px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.site-item.ready {
    background: #fff;
    border-color: #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.site-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-check {
    width: 28px;
    height: 28px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    animation: popIn 0.4s ease-out;
}

.status-loading {
    width: 24px;
    height: 24px;
    border: 2.5px solid #e9ecef;
    border-top-color: #343a40;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.status-fail {
    width: 28px;
    height: 28px;
    background: #f8d7da;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
    font-size: 14px;
    font-weight: bold;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.site-speed {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    text-align: center;
}

.site-speed.fast {
    color: #28a745;
    font-weight: 600;
}

.site-speed.slow {
    color: #ffc107;
}

.site-speed.fail {
    color: #dc3545;
}

.site-name {
    font-size: 14px;
    font-weight: 600;
    color: #343a40;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enter-btn {
    padding: 7px 12px;
    border: none;
    border-radius: 0.375rem;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #e9ecef;
    color: #adb5bd;
    justify-self: end;
}

.enter-btn.ready {
    background: #343a40;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.enter-btn.ready:hover {
    background: #23272b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.enter-btn:disabled {
    cursor: not-allowed;
}

/* 移动端适配 */
@media screen and (max-width: 420px) {
    .container {
        padding: 24px 16px;
        width: 95%;
        border-radius: 0.75rem;
    }

    .logo {
        width: 64px;
        height: 64px;
        font-size: 28px;
        margin-bottom: 16px;
    }

    .logo-img {
        width: 64px;
        height: 64px;
    }

    .logo-fallback {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }

    .logo-desc {
        font-size: 13px;
    }

    h1 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .slider-track {
        height: 40px;
    }

    .slider-btn {
        width: 36px;
        height: 36px;
    }

    .slider-btn svg {
        width: 16px;
        height: 16px;
    }

    .slider-text {
        font-size: 13px;
    }

    .verify-tip {
        font-size: 13px;
    }

    .refresh-btn {
        font-size: 12px;
        padding: 3px 6px;
    }

    .refresh-btn svg {
        width: 14px;
        height: 14px;
    }

    /* 弹层移动端适配 */
    .modal-wrapper {
        width: 96%;
        max-height: 90vh;
        border-radius: 0.75rem;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-body {
        padding: 14px 16px;
    }

    .site-item {
        grid-template-columns: 40px 70px 1fr 75px;
        padding: 10px;
        gap: 6px;
    }

    .site-name {
        font-size: 13px;
    }

    .site-speed {
        font-size: 13px;
    }

    .enter-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .status-check {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .status-loading {
        width: 20px;
        height: 20px;
    }
}
