/* ============================================================
   外贸 ERP+CRM 系统样式表
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.6;
}

a { color: #409eff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== 布局 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
}

.user-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 0;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.user-bar strong { color: #2c3e50; }

h1 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 16px;
    text-align: center;
}

/* ========== 标签导航 ========== */
.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e6e9ed;
    border-bottom: none;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #606266;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.tab-btn:hover { background: #ecf5ff; color: #409eff; }
.tab-btn.active { background: #409eff; color: #fff; }

.tab-content {
    display: none;
    background: #fff;
    padding: 20px;
    border: 1px solid #e6e9ed;
    border-radius: 0 0 8px 8px;
    min-height: 400px;
}

.tab-content.show { display: block; }

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

.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: #409eff; color: #fff; }
.btn-success { background: #67c23a; color: #fff; }
.btn-warning { background: #e6a23c; color: #fff; }
.btn-danger { background: #f56c6c; color: #fff; }
.btn-secondary { background: #909399; color: #fff; }
.btn-info { background: #909399; color: #fff; }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

.btn-link {
    background: none;
    color: #409eff;
    padding: 4px 8px;
}
.btn-link:hover { text-decoration: underline; background: none; }

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #606266;
    font-size: 13px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #409eff;
}

.form-group textarea { min-height: 80px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

/* ========== 表格 ========== */
.table-container {
    overflow-x: auto;
    margin: 12px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th {
    background: #f5f7fa;
    color: #606266;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #e6e9ed;
    white-space: nowrap;
}

table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ebeef5;
    color: #2c3e50;
}

table tr:hover { background: #f5f7fa; }

/* ========== 仪表盘卡片 ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.dashboard-card {
    background: #fff;
    border: 1px solid #e6e9ed;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.dashboard-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.card-label {
    font-size: 13px;
    color: #909399;
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

/* ========== 弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show { display: flex; }

.modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

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

.modal-header h3 {
    font-size: 16px;
    color: #2c3e50;
}

.modal-close {
    font-size: 24px;
    color: #909399;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: #f56c6c; }

.modal-body { padding: 20px; }
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #ebeef5;
    text-align: right;
}

/* ========== 任务进度 ========== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #ebeef5;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #409eff, #67c23a);
    transition: width 0.3s;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #ebeef5;
    gap: 10px;
}

.task-item:hover { background: #f5f7fa; }
.task-item.completed { opacity: 0.6; }
.task-item.completed .task-name { text-decoration: line-through; }

.task-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: #ecf5ff;
    color: #409eff;
    white-space: nowrap;
}

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

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

.login-box h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 24px;
}

.login-box .btn { width: 100%; margin-top: 8px; }

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 13px;
}

.captcha-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.captcha-box input { flex: 1; }
.captcha-box img {
    height: 38px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    cursor: pointer;
}

/* ========== 单证页面 ========== */
.document-container {
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.document-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 20px;
}

.document-header h1 {
    font-size: 28px;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.document-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.document-table th {
    background: #f5f7fa;
    border: 1px solid #333;
    padding: 8px;
    font-size: 12px;
}

.document-table td {
    border: 1px solid #333;
    padding: 8px;
    font-size: 12px;
}

.document-footer {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.signature-box {
    text-align: center;
    min-height: 80px;
}

.signature-box img {
    max-height: 60px;
}

/* ========== 工具类 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-danger { color: #f56c6c; }
.text-success { color: #67c23a; }
.text-warning { color: #e6a23c; }
.text-info { color: #909399; }
.text-primary { color: #409eff; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success { background: #f0f9eb; color: #67c23a; }
.badge-warning { background: #fdf6ec; color: #e6a23c; }
.badge-danger { background: #fef0f0; color: #f56c6c; }
.badge-info { background: #f4f4f5; color: #909399; }
.badge-primary { background: #ecf5ff; color: #409eff; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #909399;
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* 打印样式 */
@media print {
    .no-print { display: none !important; }
    .document-container { box-shadow: none; margin: 0; padding: 20px; }
    body { background: #fff; }
}
