/**
 * web.css
 * 统一管理前端样式
 */

/* ==========================================================================
   基础样式
   ========================================================================== */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

/* ==========================================================================
   导航栏样式
   ========================================================================== */
.navbar {
    background-color: #967842;
    padding: 15px 0;
}

.navbar-brand img {
    height: 40px;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 8px 16px;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
}

/* 消息通知样式 */
.web-message-container {
    position: relative;
    margin-right: 1rem !important;
}

.web-message-link {
    padding: 0;
    display: inline-flex;
    align-items: center;
    position: relative;
}

.web-message-icon {
    font-size: 1.6rem !important;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
    position: relative;
    z-index: 1;
}

.web-message-badge {
    position: absolute;
    top: 3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #dc3545;
    border: 1.5px solid #967842;
    border-radius: 8px;
    color: #fff;
    z-index: 2;
    transform: scale(1);
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.web-message-badge.hidden {
    transform: scale(0.5);
    opacity: 0;
    visibility: hidden;
}

/* 用户头像样式 */
.web-avatar-circle {
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.web-avatar-text {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* 下拉菜单样式 */
.dropdown-menu {
    margin-top: 8px;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.web-dropdown-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
}

.web-dropdown-item i {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.5rem;
}

.web-dropdown-toggle::after {
    margin-left: 0.5rem;
}

.web-text-truncate {
    display: inline-block;
    vertical-align: middle;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card {
    border: none;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 1.25rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.btn-primary {
    background-color: #967842;
    border-color: #967842;
}

.btn-primary:hover {
    background-color: #876b3a;
    border-color: #876b3a;
}

.btn-outline-primary {
    color: #967842;
    border-color: #967842;
}

.btn-outline-primary:hover {
    background-color: #967842;
    border-color: #967842;
}

/* ==========================================================================
   主要内容区域
   ========================================================================== */
main {
    flex: 1;
    padding: 2rem 0;
}

/* 内容区域最小宽度设置 */
@media (min-width: 860px) {  /* PC端断点 */
    .container {
        min-width: 860px;
    }
}

/* 卡片样式 */
.web-card {
    border: none;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.web-card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 1.25rem;
    font-size: 1.1rem;
    font-weight: 500;
}

/* ==========================================================================
   页脚样式
   ========================================================================== */
.footer {
    background-color: #967842;
    color: #fff;
    padding: 15px 0;
    margin-top: auto;
}

/* ==========================================================================
   工具类
   ========================================================================== */
.web-text-primary {
    color: #967842 !important;
}

.web-bg-primary {
    background-color: #967842 !important;
}

.web-border-primary {
    border-color: #967842 !important;
}


/* ==========================================================================
   Toast样式
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    min-width: 320px;
    max-width: 480px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform-origin: right;
    padding: 2px;
}

.toast.success {
    background: linear-gradient(to right, #967842, #967842) padding-box,
                linear-gradient(to right, rgba(150, 120, 66, 0.5), rgba(150, 120, 66, 0.1)) border-box;
    border: 2px solid transparent;
}

.toast.error {
    background: linear-gradient(to right, #dc3545, #dc3545) padding-box,
                linear-gradient(to right, rgba(220, 53, 69, 0.5), rgba(220, 53, 69, 0.1)) border-box;
    border: 2px solid transparent;
}

.toast.info {
    background: linear-gradient(to right, #0dcaf0, #0dcaf0) padding-box,
                linear-gradient(to right, rgba(13, 202, 240, 0.5), rgba(13, 202, 240, 0.1)) border-box;
    border: 2px solid transparent;
}

.toast-body {
    background: #fff;
    margin: 0;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.toast.success .toast-icon {
    background: rgba(150, 120, 66, 0.15);
    color: #967842;
}

.toast.error .toast-icon {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.toast.info .toast-icon {
    background: rgba(13, 202, 240, 0.15);
    color: #0dcaf0;
}

.toast.success .toast-body {
    color: #967842;
}

.toast.error .toast-body {
    color: #dc3545;
}

.toast.info .toast-body {
    color: #0dcaf0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
}

.toast.show {
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.hide {
    animation: slideOut 0.4s cubic-bezier(0.7, 0, 0.84, 0);
}

/* 日期选择器样式 */
.datepicker {
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border: none;
    font-family: inherit;
    width: 280px;
}

/* 日期选择器头部样式 */
.datepicker .datepicker-days .table-condensed thead tr:first-child th,
.datepicker .datepicker-months .table-condensed thead tr:first-child th,
.datepicker .datepicker-years .table-condensed thead tr:first-child th,
.datepicker .datepicker-decades .table-condensed thead tr:first-child th,
.datepicker .datepicker-centuries .table-condensed thead tr:first-child th {
    background-color: #967842;
    color: #fff;
    border-radius: 8px 8px 0 0;
    padding: 12px 8px;
    text-align: center;
    font-weight: 500;
}

/* 星期行样式 */
.datepicker .datepicker-days .table-condensed thead tr:nth-child(2) th {
    padding: 12px 8px;
    font-weight: 500;
    color: #666;
    background-color: #f8f9fa;
}

/* 日期表格样式 */
.datepicker table {
    width: 100%;
    margin: 0;
}

.datepicker table tr td,
.datepicker table tr th {
    border-radius: 0;
    padding: 8px;
    font-size: 0.9rem;
    text-align: center;
    width: 40px;
    height: 40px;
    line-height: 24px;
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.disabled,
.datepicker table tr td.active.disabled:hover {
    background: #967842 !important;
    border-color: #967842 !important;
    color: #fff !important;
    border-radius: 4px;
}

.datepicker table tr td.today,
.datepicker table tr td.today:hover,
.datepicker table tr td.today.disabled,
.datepicker table tr td.today.disabled:hover {
    background-color: rgba(150, 120, 66, 0.15);
    border-color: transparent;
    color: #967842;
    border-radius: 4px;
}

.datepicker table tr td.day:hover,
.datepicker table tr td.focused {
    background: rgba(150, 120, 66, 0.1);
    border-radius: 4px;
}

/* 月份和年份选择器样式 */
.datepicker .datepicker-months .table-condensed tbody td span.month,
.datepicker .datepicker-years .table-condensed tbody td span.year {
    width: 60px;
    height: 60px;
    line-height: 60px;
    margin: 2px;
    border-radius: 4px;
}

.datepicker .datepicker-months .table-condensed tbody td span.month:hover,
.datepicker .datepicker-years .table-condensed tbody td span.year:hover {
    background: rgba(150, 120, 66, 0.1);
}

.datepicker .datepicker-months .table-condensed tbody td span.month.active,
.datepicker .datepicker-years .table-condensed tbody td span.year.active {
    background: #967842 !important;
    color: #fff !important;
}

/* 禁用日期样式 */
.datepicker table tr td.disabled,
.datepicker table tr td.disabled:hover {
    color: #ccc;
    cursor: not-allowed;
}

/* 输入框样式 */
.input-group .input-group-text {
    background-color: #fff;
    border-color: #ced4da;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
}

.input-group .form-control {
    border-color: #ced4da;
    cursor: pointer;
    height: auto;
    padding: 0.5rem 0.75rem;
}

.input-group .form-control:focus,
.input-group .form-control:focus + .input-group-text {
    border-color: #967842;
    box-shadow: none;
}
