/* frontend/common/css/base.css
   基础样式：按钮、卡片、表单、提示条、弹窗 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #eab308;
    --danger:  #dc2626;
    --gray-1:  #f8f9fa;
    --gray-2:  #e9ecef;
    --gray-3:  #ced4da;
    --gray-4:  #6c757d;
    --text:    #212529;
    --radius:  8px;
    --shadow:  0 1px 4px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--gray-1);
    font-size: 14px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--gray-2);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    transition: all .15s;
}
.btn:hover:not(:disabled) { filter: brightness(0.95); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-outline { background: transparent; border-color: var(--gray-3); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-disabled-look {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    cursor: not-allowed !important;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    margin-bottom: 12px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--text);
}

/* 未开放卡片（灰色） */
.card-disabled {
    opacity: 0.55;
    cursor: not-allowed !important;
    position: relative;
}
.card-disabled::after {
    content: "未开放";
    position: absolute;
    top: 8px;
    right: 8px;
    background: #6b7280;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* 表单 */
.form-label {
    display: block;
    font-size: 12px;
    color: var(--gray-4);
    margin-bottom: 4px;
}
.form-control, .form-select {
    display: block;
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid var(--gray-3);
    border-radius: 6px;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.form-control:focus, .form-select:focus { border-color: var(--primary); }

.form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.form-row > .field    { flex: 0 0 auto; width: 150px; }
.form-row > .field-sm { width: 100px; }
.form-row > .field-lg { width: 220px; }

/* 提示条 */
.alert {
    padding: 9px 13px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 10px;
}
.alert-success { background:#dcfce7; color:#166534; }
.alert-warning { background:#fef9c3; color:#854d0e; }
.alert-error   { background:#fee2e2; color:#991b1b; }

/* 弹窗 */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
}
.modal-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 22px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.modal-body  { font-size: 14px; color: #374151; line-height: 1.6; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 18px;
}

/* 工具类 */
.text-muted  { color: var(--gray-4); }
.mt-2 { margin-top:8px; } .mt-3 { margin-top:14px; }
.mb-2 { margin-bottom:8px; }
.d-flex { display:flex; }
.justify-between { justify-content: space-between; }
.align-center    { align-items: center; }
.gap-3 { gap:14px; }