:root {
    --brand: #1677ff;
    --brand-dark: #0f5fd1;
    --dark: #1f2937;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 按钮样式 */
.btn-copy,
.copy-username-btn,
.copy-password-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
}

.btn-copy:hover,
 .btn-copy-account:hover,
.btn-copy-password:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6) !important;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

.swal2-styled.swal2-confirm {
    background: var(--brand) !important;
    border-radius: 10px !important;
}

.swal2-styled.swal2-confirm:hover {
    background: var(--brand-dark) !important;
}

.btn-dark {
    background: var(--dark) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 10px !important;
}

/* 左侧竖排悬浮刷新按钮样式 */
.btn-refresh-floating {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: auto;
    border-radius: 0 6px 6px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 2px 4px 15px rgba(102, 126, 234, 0.4) !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    opacity: 0.7 !important;
    transition: all 0.3s ease !important;
    z-index: 40;
    padding: 8px 2px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
}

.btn-refresh-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.btn-refresh-text span {
    display: block;
    width: 1em;
    text-align: center;
    word-break: break-all;
}

.btn-refresh-floating:hover {
    opacity: 1 !important;
    box-shadow: 4px 8px 25px rgba(102, 126, 234, 0.6) !important;
}

.btn-refresh-floating:active {
    transform: translateY(-50%) scaleX(0.95) !important;
}

.btn-refresh-floating.loading {
    opacity: 0.8 !important;
}

.btn-refresh-icon {
    width: 14px !important;
    height: 14px !important;
    display: inline-block !important;
    writing-mode: horizontal-tb !important;
}

.btn-refresh-floating.loading .btn-refresh-icon {
    animation: spin 1s linear infinite !important;
}

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

/* 复制提示 */
.copy-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 1rem 2rem;
    border-radius: 9999px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000;
}

.copy-popup.show {
    opacity: 1;
}

/* 模糊样式 */
.blurred-content {
    filter: blur(8px);
    pointer-events: none;
    transition: filter 0.3s ease-in-out;
}

/* 账号卡片样式 */
.account-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--brand);
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.account-card:active {
    transform: scale(0.98);
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.account-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    word-break: break-all;
    flex: 1;
}

.account-card-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-available {
    background: #d1fae5;
    color: #065f46;
}

.status-unavailable {
    background: #fee2e2;
    color: #991b1b;
}

.status-unknown {
    background: #fef3c7;
    color: #92400e;
}

.account-card-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.account-card-buttons button {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-copy-account,
.btn-copy-password {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-copy-account:active,
.btn-copy-password:active {
    transform: scale(0.95);
}

/* 密码字段样式 */
.password-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.password-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    text-align: right;
}

.account-card-details {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #6b7280;
}

.detail-label {
    font-weight: 600;
    color: #374151;
    min-width: 80px;
}

.detail-value {
    text-align: right;
    flex: 1;
    word-break: break-all;
    margin-left: 12px;
    font-family: 'Courier New', monospace;
}

/* 表格样式 (桌面端) */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

table th {
    padding: 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
}

table tbody tr {
    animation: slideIn 0.3s ease-out;
}

table tbody tr:hover {
    background: linear-gradient(to right, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    box-shadow: inset 0 0 8px rgba(102, 126, 234, 0.1);
}

table tbody tr:hover td {
    color: #1f2937;
}

/* 操作列样式 */
table td:last-child {
    text-align: center;
    padding: 12px 8px;
}

table th:last-child {
    text-align: center;
}

/* 处理中动画 */
.processing-animation {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.processing-dot {
    width: 4px;
    height: 4px;
    background-color: currentColor;
    border-radius: 50%;
    margin: 0 2px;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.processing-dot:nth-child(2) { animation-delay: 0.2s; }
.processing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.5); opacity: 1; }
}

/* 骨架屏样式 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.skeleton-title { height: 24px; width: 60%; margin-bottom: 16px; }
.skeleton-line { height: 16px; width: 100%; margin-bottom: 8px; }
.skeleton-btn { height: 36px; border-radius: 8px; }

/* 响应式调整 */
.table-view { display: none; }
.card-view { display: block; }

@media (max-width: 640px) {
    .btn-refresh-floating {
        width: 20px;
        font-size: 9px;
        padding: 6px 1px !important;
    }

    .btn-refresh-icon {
        width: 12px !important;
        height: 12px !important;
    }
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1c2c 0%, #4a192c 100%);
    }
    #pageWrapper {
        background: rgba(31, 41, 55, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    .account-card {
        background: #374151;
        border-left-color: #3b82f6;
    }
    .account-card-title {
        color: #f3f4f6;
    }
    .detail-label {
        color: #9ca3af;
    }
    .detail-value {
        color: #e5e7eb;
    }
    .detail-row {
        border-top-color: #4b5563;
    }
    table td {
        color: #d1d5db;
        border-bottom-color: #4b5563;
    }
    table tbody tr:hover {
        background: linear-gradient(to right, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
        box-shadow: inset 0 0 8px rgba(59, 130, 246, 0.15);
    }
    .bg-gradient-to-r.from-blue-50.to-purple-50 {
        background: linear-gradient(to right, #1e293b, #334155);
        border-color: #475569;
    }
    h2 {
        color: #f3f4f6 !important;
    }
    .text-gray-600 {
        color: #9ca3af !important;
    }
    .swal2-popup {
        background: #1f2937 !important;
        color: #f3f4f6 !important;
    }
}

@media (min-width: 769px) {
    body {
        padding: 32px;
    }

    #pageWrapper {
        padding: 48px;
        border-radius: 32px;
    }

    .table-view {
        display: block;
    }

    .card-view {
        display: none;
    }
}
