:root {
    --bg-color: #F7F7F7;
    --card-bg: #ffffff;
    --primary-color: #2669FF;
    --text-primary: #1a1a1a;
    --text-secondary: #5f6b7a;
    --text-tertiary: #8f98a8;
    --border-color: #e5e7eb;
    --shadow: 0 2px 8px rgba(0,0,0,0.02);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.04);
    --radius-card: 12px;
    --radius-btn: 8px;
    --radius-tag: 4px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.text-secondary {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.text-tertiary {
    font-size: 12px;
    line-height: 1.3;
    color: var(--text-tertiary);
}

.title-large {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 500;
}

.title {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 500;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    padding: 24px;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-btn);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1a5ae6;
}

.btn-secondary {
    background: #f5f5f5;
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: #ebebeb;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

.btn-danger:hover:not(:disabled) {
    background: #fecaca;
}

.btn-loading {
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-btn);
    font-size: 14px;
    font-family: var(--font-family);
    transition: border-color 0.2s ease;
    outline: none;
    background: var(--card-bg);
}

.input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(38, 105, 255, 0.1);
}

.input::placeholder {
    color: var(--text-tertiary);
}

.input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-tag);
    font-size: 12px;
    font-weight: 500;
}

.tag-primary {
    background: #e6f0ff;
    color: var(--primary-color);
}

.tag-success {
    background: #dcfce7;
    color: #16a34a;
}

.tag-warning {
    background: #fef3c7;
    color: #d97706;
}

.tag-danger {
    background: #fee2e2;
    color: #dc2626;
}

.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    font-size: 14px;
    color: var(--text-primary);
}

.table tr:hover {
    background: #fafafa;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #16a34a;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge-info {
    background: #e6f0ff;
    color: var(--primary-color);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-btn);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-success {
    background: #dcfce7;
    color: #16a34a;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-btn);
    color: var(--text-secondary);
}

.modal-close:hover {
    background: #f5f5f5;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.api-key-display {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: var(--radius-btn);
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    margin: 16px 0;
    border: 1px dashed var(--border-color);
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-btn);
    font-size: 13px;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-gap-8 {
    gap: 8px;
}

.flex-gap-16 {
    gap: 16px;
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 16px;
    }

    .nav {
        gap: 16px;
    }
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.geetest-container {
    margin: 16px 0;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-danger {
    color: #dc2626;
}

.ajax-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.ajax-loading-spinner {
    position: relative;
    width: 48px;
    height: 48px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinnerRotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    animation-delay: -0.3s;
    border-top-color: #4a8aff;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    animation-delay: -0.15s;
    border-top-color: #7ab5ff;
}

@keyframes spinnerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ajax-loading-text {
    font-size: 14px;
    color: var(--text-secondary);
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-btn);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 360px;
}

.toast.toast-show {
    transform: translateX(0);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
}

.toast-success .toast-icon {
    color: #16a34a;
}

.toast-error .toast-icon {
    color: #dc2626;
}

.toast-warning .toast-icon {
    color: #d97706;
}

.toast-info .toast-icon {
    color: var(--primary-color);
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.2s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

.slide-fade-enter-active {
    transition: all 0.3s ease-out;
}

.slide-fade-leave-active {
    transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
}

.slide-fade-enter-from,
.slide-fade-leave-to {
    transform: translateY(-10px);
    opacity: 0;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.card-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-btn);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.table-skeleton {
    height: 48px;
    margin-bottom: 8px;
}

.table-skeleton:last-child {
    margin-bottom: 0;
}

[v-cloak] {
    display: none !important;
}

.app-content {
    min-height: calc(100vh - 65px);
    padding: 24px 0;
}

.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.page-loading .spinner-ring {
    width: 40px;
    height: 40px;
}
