/* ============================================================
   OSL 全局样式 - 苹果精简风格
   纯白背景 #FFFFFF、次级背景 #F5F5F7、主色调 #007AFF
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    background-color: #F5F5F7;
    color: #1D1D1F;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: #1D1D1F;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { color: #86868B; }

a {
    color: #007AFF;
    text-decoration: none;
    transition: opacity 0.2s;
}
a:hover { opacity: 0.7; }

/* ---------- Layout ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Card ---------- */
.card {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 24px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F5F5F7;
}

/* ---------- Form ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1D1D1F;
    margin-bottom: 6px;
}

.form-label .required {
    color: #FF3B30;
    margin-left: 2px;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #D2D2D7;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: #1D1D1F;
    background: #FFFFFF;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

.form-input.error {
    border-color: #FF3B30;
    box-shadow: 0 0 0 3px rgba(255,59,48,0.15);
}

.form-input:disabled {
    background: #F5F5F7;
    color: #86868B;
    cursor: not-allowed;
}

.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #D2D2D7;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: #1D1D1F;
    resize: vertical;
    min-height: 100px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-textarea:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

.form-error {
    font-size: 0.8rem;
    color: #FF3B30;
    margin-top: 4px;
}

.form-hint {
    font-size: 0.8rem;
    color: #86868B;
    margin-top: 4px;
}

/* ---------- Button ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: #007AFF;
    color: #FFFFFF;
}
.btn-primary:hover {
    background: #0062D9;
}
.btn-primary:active {
    background: #0050B3;
}
.btn-primary:disabled {
    background: #A8C7FA;
    cursor: not-allowed;
}

.btn-secondary {
    background: #F5F5F7;
    color: #1D1D1F;
}
.btn-secondary:hover { background: #E5E5EA; }

.btn-outline {
    background: transparent;
    color: #007AFF;
    border: 1.5px solid #007AFF;
}
.btn-outline:hover {
    background: rgba(0,122,255,0.06);
}

.btn-danger {
    background: #FF3B30;
    color: #FFFFFF;
}
.btn-danger:hover { background: #D63028; }

.btn-text {
    background: transparent;
    color: #007AFF;
    height: auto;
    padding: 0;
}
.btn-text:hover { opacity: 0.7; }

.btn-block {
    width: 100%;
}

.btn-sm {
    height: 36px;
    padding: 0 14px;
    font-size: 0.875rem;
}

.btn-lg {
    height: 50px;
    padding: 0 28px;
    font-size: 1.1rem;
}

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-blue { background: rgba(0,122,255,0.12); color: #007AFF; }
.badge-green { background: rgba(52,199,89,0.12); color: #34C759; }
.badge-red { background: rgba(255,59,48,0.12); color: #FF3B30; }
.badge-orange { background: rgba(255,149,0,0.12); color: #FF9500; }
.badge-gray { background: #F5F5F7; color: #86868B; }

/* ---------- Avatar ---------- */
.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #F5F5F7;
    border: 2px solid #F5F5F7;
}
.avatar-sm { width: 40px; height: 40px; }
.avatar-lg { width: 96px; height: 96px; }
.avatar-xl { width: 120px; height: 120px; }

/* ---------- Divider ---------- */
.divider {
    height: 1px;
    background: #F5F5F7;
    margin: 20px 0;
}

/* ---------- Alert / Toast ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: rgba(52,199,89,0.1); color: #34C759; border: 1px solid rgba(52,199,89,0.2); }
.alert-error { background: rgba(255,59,48,0.1); color: #FF3B30; border: 1px solid rgba(255,59,48,0.2); }
.alert-warning { background: rgba(255,149,0,0.1); color: #FF9500; border: 1px solid rgba(255,149,0,0.2); }
.alert-info { background: rgba(0,122,255,0.1); color: #007AFF; border: 1px solid rgba(0,122,255,0.2); }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: #FFFFFF;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F5F5F7;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868B;
    font-size: 1.2rem;
    transition: background 0.2s;
}
.modal-close:hover { background: #E5E5EA; }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #F5F5F7;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ---------- Table ---------- */
.table-wrapper {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #F5F5F7;
}
.table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: #86868B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #FAFAFA;
}
.table tbody tr:hover { background: #FAFAFA; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-primary { color: #007AFF; }
.text-success { color: #34C759; }
.text-danger { color: #FF3B30; }
.text-warning { color: #FF9500; }
.text-muted { color: #86868B; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 600; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.hidden { display: none; }

/* ---------- Spinner ---------- */
.spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid #F5F5F7;
    border-top-color: #007AFF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* ---------- Language Selector ---------- */
.lang-selector {
    position: relative;
}
.lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #D2D2D7;
    background: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    cursor: pointer;
    color: #1D1D1F;
    transition: background 0.2s;
}
.lang-btn:hover { background: #F5F5F7; }
.lang-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid #F5F5F7;
    overflow: hidden;
    z-index: 100;
    min-width: 150px;
    display: none;
}
.lang-dropdown.show { display: block; }
.lang-option {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.15s;
}
.lang-option:hover { background: #F5F5F7; }
.lang-option.active { color: #007AFF; font-weight: 500; }

/* ---------- Skeleton Loading ---------- */
.skeleton {
    background: linear-gradient(90deg, #F5F5F7 25%, #E5E5EA 50%, #F5F5F7 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Password Strength ---------- */
.pwd-strength {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.pwd-strength-bar {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: #D2D2D7;
    transition: background 0.3s;
}
.pwd-strength-bar.weak { background: #FF3B30; }
.pwd-strength-bar.medium { background: #FF9500; }
.pwd-strength-bar.strong { background: #34C759; }

/* ---------- Page Transitions ---------- */
.page-enter { animation: pageFadeIn 0.3s ease; }
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .card { padding: 16px; border-radius: 10px; }
    h1 { font-size: 1.5rem; }
    .btn-lg { height: 46px; font-size: 1rem; }
}
