/* 
 * MiAuth Admin Panel Stylesheet
 * Style: 极简白 Clean White
 */

/* 1. Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: #fafafa;
    color: #111111;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* 2. Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* 3. Navigation Bar */
.nav-bar {
    background-color: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 700;
    font-size: 18px;
    color: #111;
}

.nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-link {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    color: #111;
}

/* 4. Card */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.card-header .actions {
    display: flex;
    gap: 12px;
}

/* 5. Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
    background-color: #111;
    color: #fff;
}

.btn:hover {
    background-color: #333;
}

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

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background-color: #eeeeee;
}

.btn-danger {
    background-color: #FF3B30;
    color: #fff;
}

.btn-danger:hover {
    background-color: #e0352b;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #ddd;
    color: #333;
}

.btn-outline:hover {
    background-color: #f9f9f9;
    border-color: #ccc;
}

/* Button Ripple Animation */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0) translate(-50%, -50%);
        opacity: 0.5;
    }
    100% {
        transform: scale(40, 40) translate(-50%, -50%);
        opacity: 0;
    }
}

/* 6. Forms */
.form {
    max-width: 100%;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #111;
    transition: all 0.2s ease;
    outline: none;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: #111;
    box-shadow: 0 0 0 4px rgba(0,0,0,0.06);
}

.form-actions {
    margin-top: 32px;
    display: flex;
    gap: 12px;
}

.form-help {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 7. Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 24px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    padding: 12px 16px;
    background-color: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    color: #666;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table tr:hover {
    background-color: #fcfcfc;
}

/* Column Widths */
.table th:nth-child(1) { width: 20%; }
.table th:nth-child(2) { width: 18%; }
.table th:nth-child(3) { width: 27%; }
.table th:nth-child(4) { width: 15%; }
.table th:nth-child(5) { width: 20%; }

.remark-cell {
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.5;
    max-width: 300px;
    color: #666;
}

/* 8. Badges */
.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background-color: #e8f5e9; color: #2e7d32; }
.badge-warning { background-color: #fff3e0; color: #e65100; }
.badge-danger { background-color: #fce4ec; color: #c62828; }
.badge-secondary { background-color: #f5f5f5; color: #666; }
.badge-info { background-color: #e3f2fd; color: #1565c0; }

/* 9. Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-error {
    background-color: #fce4ec;
    color: #c62828;
    border: 1px solid #f8bbd0;
}

/* 10. Login Card */
.login-card {
    max-width: 400px;
    margin: 100px auto;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 32px;
    font-size: 24px;
}

.login-card .btn {
    width: 100%;
}

/* 11. Tabs */
.auth-tabs, .api-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 0px;
}

.auth-tab, .api-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-tab:hover, .api-tab:hover {
    color: #111;
}

.auth-tab.active, .api-tab.active {
    color: #111;
    border-bottom-color: #111;
}

.auth-content, .api-content {
    display: none;
}

.auth-content.active, .api-content.active {
    display: block;
}

/* 12. API Docs */
.api-docs {
    margin-top: 8px;
}

.api-section {
    margin-bottom: 32px;
}

.api-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111;
}

.api-url {
    display: block;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    margin: 12px 0;
    color: #111;
    border: 1px solid #eeeeee;
}

.code-block {
    background: #111;
    color: #eee;
    padding: 20px;
    border-radius: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    white-space: pre;
    overflow-x: auto;
    line-height: 1.5;
}

/* 13. Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.page-info {
    font-size: 13px;
    color: #999;
}

/* 14. Filter Bar */
.filter-bar {
    margin-bottom: 20px;
}

.filter-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 13px;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
}

.filter-select-wrap {
    position: relative;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 36px 8px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 180px;
    font-family: inherit;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:hover {
    border-color: #ccc;
}

.filter-select:focus {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.filter-select option {
    padding: 8px;
}

/* 15. Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 4px;
    display: block;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.stat-card .stat-icon {
    float: right;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-card.accent-green .stat-icon { background-color: #e8f5e9; color: #2e7d32; }
.stat-card.accent-blue .stat-icon { background-color: #e3f2fd; color: #1565c0; }
.stat-card.accent-orange .stat-icon { background-color: #fff3e0; color: #e65100; }
.stat-card.accent-red .stat-icon { background-color: #fce4ec; color: #c62828; }
.stat-card.accent-purple .stat-icon { background-color: #f3e5f5; color: #7b1fa2; }

/* 16. Dashboard Sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dash-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.dash-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.dash-section-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.expire-list {
    list-style: none;
}

.expire-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.expire-item:last-child {
    border-bottom: none;
}

.expire-item .name {
    font-weight: 500;
    color: #111;
}

.expire-item .date {
    color: #999;
}

/* 17. Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-bar {
        padding: 14px 16px;
        flex-direction: column;
        gap: 12px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .card-header .actions {
        width: 100%;
    }
    
    .card-header .actions .btn {
        flex: 1;
    }
}
