/* 表单管理系统 - 响应式样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

/* 登录页 */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px 32px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #444;
    font-size: 22px;
}

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

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 { 
    font-size: 22px; 
    color: #333; 
    font-weight: 600;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #4b5563; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-info { background: #0ea5e9; color: #fff; }
.btn-info:hover { background: #0284c7; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 12px; font-size: 16px; }

/* 表单元素 */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* 卡片 */
.form-card {
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.form-card h3 {
    margin-bottom: 16px;
    color: #374151;
    font-size: 16px;
}

/* 字段行 */
.field-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
}

.field-row input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.field-row select {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    min-width: 100px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.data-table tr:hover { background: #f9fafb; }
.data-table .actions { white-space: nowrap; }

.table-wrapper { overflow-x: auto; }

/* 提示 */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.hint {
    color: #9ca3af;
    font-size: 13px;
    margin-top: 8px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-submit { background: #dbeafe; color: #1e40af; }
.badge-view { background: #dcfce7; color: #166534; }

/* 密钥显示 */
.key-display {
    display: inline-block;
    background: #1f2937;
    color: #10b981;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    margin-top: 8px;
    word-break: break-all;
    line-height: 1.5;
}

code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
}

hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .login-box { padding: 30px 20px; }
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: 8px; }
    .actions .btn { margin-bottom: 4px; }
    .field-row { gap: 8px; }
    .field-row input[type="text"] { min-width: 100%; margin-bottom: 4px; }
    .field-row select { flex: 1; }
}
