/**
 * 多用户证书管理系统 - 全局样式
 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
}

a {
    color: #1890ff;
    text-decoration: none;
}

a:hover {
    color: #40a9ff;
}

/* 登录页面 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 8px;
    font-size: 24px;
}

.login-box .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #999;
    font-size: 12px;
}

.login-footer p {
    margin: 4px 0;
}

/* 布局容器 */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.header {
    background: #001529;
    color: white;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav a {
    color: rgba(255,255,255,0.65);
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav a:hover,
.nav a.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.user-info span {
    color: rgba(255,255,255,0.85);
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 88px 24px 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.main-content h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

/* 页脚 */
.footer {
    background: #001529;
    color: rgba(255,255,255,0.45);
    text-align: center;
    padding: 16px;
    font-size: 12px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    color: white;
    background: #1890ff;
    border-color: #1890ff;
}

.btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: white;
}

.btn-secondary {
    color: #666;
    background: white;
    border-color: #d9d9d9;
}

.btn-secondary:hover {
    color: #40a9ff;
    border-color: #40a9ff;
}

.btn-success {
    color: white;
    background: #52c41a;
    border-color: #52c41a;
}

.btn-success:hover {
    background: #73d13d;
    border-color: #73d13d;
    color: white;
}

.btn-danger {
    color: white;
    background: #ff4d4f;
    border-color: #ff4d4f;
}

.btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
    color: white;
}

.btn-warning {
    color: white;
    background: #faad14;
    border-color: #faad14;
}

.btn-warning:hover {
    background: #ffc53d;
    border-color: #ffc53d;
    color: white;
}

.btn-info {
    color: white;
    background: #13c2c2;
    border-color: #13c2c2;
}

.btn-info:hover {
    background: #36cfc9;
    border-color: #36cfc9;
    color: white;
}

.btn-outline {
    color: rgba(255,255,255,0.85);
    background: transparent;
    border-color: rgba(255,255,255,0.3);
}

.btn-outline:hover {
    color: white;
    border-color: white;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 800px;
}

.form-card h3 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* 表格样式 */
.data-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-collapse: collapse;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
}

.data-table tbody tr:hover {
    background: #f5f5f5;
}

.data-table .text-center {
    text-align: center;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 36px;
}

.stat-info h3 {
    font-size: 28px;
    color: #1890ff;
    margin: 0;
}

.stat-info p {
    color: #666;
    margin: 4px 0 0;
}

/* 快捷操作 */
.quick-actions {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.quick-actions h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* 最近记录 */
.recent-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.recent-section h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

/* 两列布局 */
.two-column {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
}

.column-left,
.column-right {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 筛选栏 */
.filter-bar {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form .form-control {
    width: auto;
    min-width: 150px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
}

.badge-primary {
    background: #e6f7ff;
    color: #1890ff;
}

.badge-info {
    background: #e6fffb;
    color: #13c2c2;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
}

.badge-danger {
    background: #fff1f0;
    color: #ff4d4f;
}

.badge-secondary {
    background: #f5f5f5;
    color: #666;
}

/* 提示消息 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-danger {
    background: #fff1f0;
    border: 1px solid #ffa39e;
    color: #ff4d4f;
}

/* 代码样式 */
code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #333;
}

/* 证书详情页 */
.cert-detail-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.cert-header {
    padding: 20px 24px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cert-header h3 {
    margin: 0;
    font-size: 18px;
}

.cert-status {
    padding: 4px 12px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 4px;
    font-size: 12px;
}

.cert-body {
    padding: 24px;
}

.cert-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.info-value {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.cert-number-highlight {
    font-family: monospace;
    font-size: 18px;
    color: #1890ff;
    background: #e6f7ff;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
}

.cert-photo-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.cert-photo-section label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.photo-container {
    display: inline-block;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 4px;
}

.photo-container img {
    max-width: 200px;
    max-height: 260px;
    display: block;
}

.cert-footer {
    padding: 16px 24px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
}

/* 证书编号显示 */
.cert-number-display {
    margin-bottom: 20px;
    padding: 16px;
    background: #e6f7ff;
    border-radius: 4px;
    border-left: 4px solid #1890ff;
}

.cert-number-display label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    display: block;
}

.cert-number-display .cert-number {
    font-family: monospace;
    font-size: 20px;
    color: #1890ff;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        height: auto;
        padding: 12px;
    }
    
    .nav {
        margin: 12px 0;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-content {
        padding-top: 140px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .two-column {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-form .form-control {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* 打印样式 */
@media print {
    .header,
    .footer,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    body {
        background: white;
    }
    
    #watermark {
        opacity: 0.05 !important;
    }
}
