/**
 * xjd-openclaw.css
 * 小剪刀 OpenClaw 可复用组件样式
 * 
 * 使用方法：在任意页面引入即可
 * <link href="assets/css/xjd-openclaw.css" rel="stylesheet">
 */

/* ========== Modal 基础样式 ========== */
.xjd-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.xjd-modal-overlay.xjd-visible {
    display: flex;
    opacity: 1;
}

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

.xjd-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.xjd-modal-content {
    position: relative;
    width: 100%;
    margin: 0 1rem;
    background: #2a2a2a;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.xjd-modal-content.xjd-scale-100 {
    transform: scale(1);
}

/* ========== Login Modal ========== */
.xjd-login-modal .xjd-modal-content {
    max-width: 28rem;
    background: #111;
}

.xjd-login-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.xjd-login-close:hover {
    color: #fff;
}

.xjd-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.xjd-login-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.xjd-login-header p {
    color: #9ca3af;
    font-size: 0.875rem;
}

.xjd-login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.xjd-login-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 0.5rem;
    text-align: left;
}

.xjd-login-form input {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.xjd-login-form input::placeholder {
    color: #6b7280;
}

.xjd-login-form input:focus {
    border-color: #FBC5B1;
    box-shadow: 0 0 0 1px #FBC5B1;
}

.xjd-code-group {
    display: flex;
    gap: 0.75rem;
}

.xjd-code-group input {
    flex: 1;
}

.xjd-send-code-btn {
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
    width: 120px;
    flex-shrink: 0;
}

.xjd-send-code-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.xjd-send-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.xjd-login-submit {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: none;
    color: #000;
    font-weight: 700;
    font-size: 1.125rem;
    margin-top: 1rem;
    cursor: pointer;
    background: linear-gradient(90deg, #FBC5B1 0%, #FFA5E2 52%, #BAABFF 100%);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.xjd-login-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.xjd-login-submit:not(:disabled):hover {
    opacity: 0.9;
}

/* ========== Token Modal ========== */
.xjd-token-modal .xjd-modal-content {
    max-width: 600px;
}

.xjd-token-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.xjd-token-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
}

.xjd-token-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.xjd-token-close:hover {
    color: #fff;
}

.xjd-token-box {
    background: #1a1a1a;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.xjd-token-display {
    flex: 1;
    text-align: left;
    overflow: hidden;
    min-width: 0;
}

.xjd-token-display p {
    font-size: 0.875rem;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.05em;
    margin: 0 0.5rem;
}

.xjd-token-display p.xjd-token-active {
    color: #FBC5B1;
    font-family: monospace;
}

.xjd-token-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.xjd-btn-generate {
    background: #3a3a3a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    font-size: 0.8125rem;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.xjd-btn-generate:hover {
    background: #4a4a4a;
}

.xjd-btn-copy-token {
    background: linear-gradient(to right, #FF8853, #FF6B2C);
    border: none;
    color: #fff;
    font-size: 0.8125rem;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.2);
    white-space: nowrap;
}

.xjd-btn-copy-token:hover {
    opacity: 0.9;
}

.xjd-token-warning {
    background: #3b2a2a;
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.xjd-token-warning-icon {
    color: #f43f5e;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.xjd-token-warning p {
    font-size: 0.8125rem;
    color: #f43f5e;
    line-height: 1.6;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

/* ========== Dashboard View ========== */
.xjd-dashboard {
    display: none;
    min-height: 100vh;
    padding: 6rem 1rem 3rem;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
}

.xjd-dashboard.xjd-active {
    display: flex;
}

.xjd-dashboard-glow {
    position: absolute;
    top: 33%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60rem;
    height: 60rem;
    background: rgba(154, 52, 18, 0.1);
    filter: blur(8rem);
    border-radius: 50%;
    pointer-events: none;
}

.xjd-dashboard-inner {
    max-width: 48rem;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.xjd-dashboard-title {
    text-align: center;
    margin-bottom: 2rem;
}

.xjd-dashboard-title h2 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background-image: linear-gradient(90deg, #FBC5B1 0%, #FFA5E2 52%, #BAABFF 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline;
}

.xjd-dashboard-title .xjd-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    color: #FFB267;
    border: 1px solid rgba(255, 178, 103, 0.3);
    background: rgba(255, 178, 103, 0.1);
    margin-left: 0.5rem;
    box-shadow: 0 0 10px rgba(255, 178, 103, 0.2);
    vertical-align: middle;
}

.xjd-dashboard-subtitle {
    font-size: 1.25rem;
    color: #e5e7eb;
    margin-top: 1.5rem;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.xjd-dashboard-subtitle .xjd-star {
    color: #9ca3af;
}

/* Card */
.xjd-card {
    width: 100%;
    background: rgba(42, 42, 42, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem 2.5rem;
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.xjd-card-glow {
    position: absolute;
    top: -8rem;
    right: -8rem;
    width: 16rem;
    height: 16rem;
    background: rgba(255, 165, 226, 0.1);
    mix-blend-mode: screen;
    filter: blur(4rem);
    border-radius: 50%;
    pointer-events: none;
}

.xjd-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    margin-bottom: 1rem;
}

.xjd-card .xjd-card-desc {
    color: #d1d5db;
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.05em;
}

/* Code Box */
.xjd-code-box {
    background: #1e1e1e;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xjd-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(24, 24, 24, 0.5);
}

.xjd-code-header .xjd-code-label {
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-family: monospace;
}

.xjd-code-header .xjd-code-label .xjd-code-icon {
    color: #FFB267;
    font-weight: 700;
}

.xjd-code-copy-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: color 0.2s;
    padding: 0.25rem 0.5rem;
}

.xjd-code-copy-btn:hover {
    color: #fff;
}

.xjd-code-body {
    padding: 1rem 1.5rem;
}

.xjd-code-body code {
    font-size: 0.8125rem;
    color: #E6D581;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    text-align: left;
    display: block;
    line-height: 1.6;
}

/* Steps */
.xjd-steps {
    margin-bottom: 0.5rem;
}

.xjd-steps .xjd-steps-label {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 1.25rem;
}

.xjd-steps-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.xjd-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.xjd-step-num {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    margin-top: 0.125rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.xjd-step p {
    font-size: 0.9375rem;
    color: #d1d5db;
    line-height: 1.6;
}

/* Get Token Button */
.xjd-get-token-btn {
    background: linear-gradient(to right, #FF8853, #FF6B2C);
    border: none;
    color: #fff;
    padding: 0.625rem 2rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.2);
    transition: opacity 0.2s;
}

.xjd-get-token-btn:hover {
    opacity: 0.9;
}

.xjd-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* ========== Navbar Components ========== */
.xjd-nav-openclaw-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(45, 45, 45, 0.8);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background 0.2s;
}

.xjd-nav-openclaw-btn:hover {
    background: rgba(61, 61, 61, 0.9);
}

.xjd-nav-openclaw-btn .xjd-claw-emoji {
    font-size: 1rem;
    color: #f97316;
}

.xjd-nav-user-area {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

.xjd-nav-user-area.xjd-active {
    display: flex;
}

.xjd-nav-openclaw-logged {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(26, 26, 26, 0.8);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.xjd-nav-openclaw-logged:hover {
    background: rgba(42, 42, 42, 0.9);
}

.xjd-nav-bell {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    position: relative;
    padding: 0.25rem;
    transition: color 0.2s;
}

.xjd-nav-bell:hover {
    color: #fff;
}

.xjd-nav-bell .xjd-bell-dot {
    position: absolute;
    top: 0;
    right: 0.25rem;
    width: 0.375rem;
    height: 0.375rem;
    background: #ef4444;
    border-radius: 50%;
}

/* User Profile Dropdown */
.xjd-user-profile {
    position: relative;
}

.xjd-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.xjd-user-trigger:hover .xjd-user-phone {
    color: #fff;
}

.xjd-user-phone {
    font-size: 0.875rem;
    color: #d1d5db;
    transition: color 0.2s;
    font-weight: 500;
}

.xjd-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.xjd-user-avatar svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
}

.xjd-user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 9rem;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 50;
}

.xjd-user-dropdown.xjd-active {
    display: block;
}

.xjd-logout-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #d1d5db;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.xjd-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
    .xjd-token-box {
        flex-direction: column;
    }
    
    .xjd-token-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .xjd-card {
        padding: 1.5rem;
    }
    
    .xjd-dashboard-title h2 {
        font-size: 2rem;
    }
}
