/* Modern SSL Certificate Management System - Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.header-logo:hover {
    text-decoration: none;
}

.logo-icon {
    padding: 0.5rem;
    background-color: #2563eb;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions a {
    text-decoration: none;
}

.header-actions a:hover {
    text-decoration: none;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    background-color: transparent;
    border-radius: 2px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background-color: #f3f4f6;
    text-decoration: none;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-success {
    background-color: #16a34a;
    color: white;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-secondary {
    border: 1px solid #d1d5db;
    color: #374151;
    background-color: white;
}

.btn-secondary:hover {
    background-color: #f9fafb;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-icon {
    padding: 0.5rem;
    position: relative;
}

/* Main Content */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    width: 100%;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
    border-radius: 2px;
}

.stat-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.stat-info p {
    font-size: 1.875rem;
    font-weight: 600;
}

.stat-icon {
    padding: 0.75rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.stat-blue {
    background-color: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.stat-green {
    background-color: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.stat-orange {
    background-color: #fff7ed;
    color: #ea580c;
    border-color: #fed7aa;
}

.stat-red {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Toolbar */
.toolbar {
    background-color: white;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 2px;
}

.toolbar-content {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.5rem 0.5rem 2.5rem;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    border-radius: 2px;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

.select-input {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 2px;
}

.select-input:focus {
    outline: none;
    border-color: #2563eb;
}

/* Table */
.table-container {
    background-color: white;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
    border-radius: 2px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
}

td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
}

tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f9fafb;
}

.domain-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 2px;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-expiring {
    background-color: #ffedd5;
    color: #9a3412;
}

.status-expired {
    background-color: #fee2e2;
    color: #991b1b;
}

.date-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.action-buttons a {
    text-decoration: none;
    white-space: nowrap;
}

.action-buttons a:hover {
    text-decoration: none;
}

/* Cards */
.card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 2px;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 1.125rem;
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input, .form-control {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    border-radius: 2px;
}

.form-input:focus, .form-control:focus {
    outline: none;
    border-color: #2563eb;
}

textarea.form-input, textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-actions button {
    flex: 1;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 2px;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-success {
    background-color: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background-color: #ffedd5;
    border-color: #fed7aa;
    color: #9a3412;
}

.alert-info {
    background-color: #dbeafe;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Footer */
.footer {
    background-color: white;
    border-top: 1px solid #e5e7eb;
    padding: 2rem 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.8;
}

.footer-content a {
    color: #2563eb;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* Loading */
.loading {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Icons */
svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Empty State */
.empty-state {
    background-color: white;
    border: 1px solid #e5e7eb;
    padding: 3rem;
    text-align: center;
    display: none;
    border-radius: 2px;
}

.empty-state.active {
    display: block;
}

.empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #9ca3af;
}

.empty-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.empty-description {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .header-container {
        padding: 0 0.75rem;
        height: auto;
        min-height: 3.5rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .header-title {
        font-size: 1rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        padding: 0.375rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .main-content {
        padding: 1rem 0.75rem;
    }

    .toolbar {
        padding: 0.75rem;
    }

    .toolbar-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-box {
        width: 100%;
        min-width: auto;
    }

    .toolbar-actions {
        width: 100%;
        flex-direction: column;
    }

    .select-input {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-info h3 {
        font-size: 0.75rem;
    }

    .stat-info p {
        font-size: 1.5rem;
    }

    .table-container {
        font-size: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.75rem;
        min-width: 600px;
    }

    th {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    td {
        padding: 0.75rem 0.5rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    .btn-small {
        padding: 0.25rem 0.375rem;
        font-size: 0.6875rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }

    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-header {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .footer {
        padding: 1.5rem 0.75rem;
    }

    .footer-content {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem;
    }

    .header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .stats-grid {
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .stat-info p {
        font-size: 1.25rem;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    table {
        min-width: 500px;
    }

    th, td {
        padding: 0.5rem 0.375rem;
    }
}

/* 全局链接样式 */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}
