/* ==========================================================================
   阿坝文化馆藏羌数字资源 - 平台样式
   复刻老站（Ant Design Vue 版）配色与布局：藏红 #7D1A15 / 顶条 #CB5520 /
   导航激活 #5D0100 / 背景 #ECECEC；按钮、链接、分页沿用老站 antd 主题主色 #9a2929（hover #ae5454）
   ========================================================================== */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'AlibabaPuHuiTi-3', -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #ECECEC;
}

a { text-decoration: none; color: inherit; }
img { border: none; }
h1, h2, h3, h4, p { margin: 0; }

.hidden-data { display: none; }
.text-muted { color: #999; font-size: 13px; }
.empty-tip { text-align: center; color: #999; padding: 60px 0; font-size: 14px; }

/* ==========================================================================
   顶栏（复刻 ClientLayout）
   ========================================================================== */

.resource-page { min-height: 100vh; }

.resource-header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 10;
    width: 100vw;
    height: 100px;
    padding: 0 24px;
    box-shadow: 0 1px 4px #00152914;
    /* bg_header.png 宽 1920 居中显示，超宽屏两侧用图片边缘同色深红兜底（避免露出白底） */
    background: #7d1a15 url('/static/platform/img/bg_header.png') no-repeat center;
}

.header-row {
    display: flex;
    align-items: center;
    height: 100px;
}

.header-col-logo { flex: 0 0 25%; max-width: 25%; }
.header-col-nav { flex: 0 0 41.6667%; max-width: 41.6667%; }
.header-col-search { flex: 0 0 16.6667%; max-width: 16.6667%; }
.header-col-user { flex: 1 1 auto; min-width: 0; }

.resource-logo {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-logo a { display: flex; align-items: center; }

/* inline 图片带 baseline 间隙会导致偏上，改块级彻底消除 */
.resource-logo img { display: block; }

.res-nav-box { display: flex; }

.res-nav-box a {
    display: block;
    text-decoration: none;
    color: #fff;
}

.res-nav-item {
    padding: 20px 40px;
    text-align: center;
}

.res-nav-item-txt {
    font-size: 16px;
    color: #ffffff;
}

.res-nav-item.active { background-color: #5D0100; }

.search-box { padding: 30px 0; }

.header-search-form { display: flex; }

.header-search-input {
    width: 150px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.header-search-input:focus { border-color: #9a2929; }

.header-search-btn {
    height: 40px;
    padding: 0 16px;
    background: #9a2929;
    border: 1px solid #9a2929;
    color: #fff;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 14px;
}

.header-search-btn:hover { background: #ae5454; border-color: #ae5454; }

.header-user {
    display: flex;
    padding: 20px;
    align-items: center;
    justify-content: flex-end;
}

.user-header {
    width: 48px;
    height: 48px;
}

.header-user-info {
    padding: 0 20px;
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    border-right: 1px solid #fff;
}

.header-user-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 12px;
}

.header-user-link {
    color: #fff;
    font-size: 13px;
    opacity: 0.85;
    white-space: nowrap;
}

.header-user-link:hover { opacity: 1; text-decoration: underline; }

.logout-box {
    color: #fff;
    font-size: 14px;
    text-align: center;
    margin-left: 20px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.logout-img {
    width: 16px;
    height: 16px;
    margin: 8px;
}

.logout-box:hover { opacity: 0.85; }

/* ==========================================================================
   提示条（notice / error）
   ========================================================================== */

.platform-toast {
    position: fixed;
    top: 116px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.4s;
}

.platform-toast-hide { opacity: 0; }

.platform-toast-notice { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.platform-toast-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }

/* ==========================================================================
   登录页（复刻 login.vue）
   ========================================================================== */

.login-page {
    width: 100vw;
    height: 100vh;
    position: relative;
    text-align: center;
    background: url('/static/platform/img/bg_login.jpg') no-repeat center;
    background-size: cover;
}

.login-page::before {
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    content: "";
}

.main-login {
    display: inline-block;
    vertical-align: middle;
    min-width: 260px;
    width: 400px;
    margin: -80px auto 0 auto;
    padding: 70px 60px;
    text-align: left;
    background-color: rgba(125, 26, 21, 0.6);
}

.login-header {
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
    color: #fff;
    line-height: 1.5;
}

.login-error {
    margin-bottom: 20px;
    padding: 8px 12px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffccc7;
    font-size: 14px;
}

.login-input-wrap { margin-bottom: 20px; }

.login-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    color: #fff;
    background: rgba(235, 237, 242, 0.4);
    outline: none;
}

.login-input::placeholder { color: rgba(255, 255, 255, 0.65); }
.login-input:focus { background: rgba(235, 237, 242, 0.55); }

.login-captcha-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.login-captcha-input {
    width: 150px;
    flex: 0 0 150px;
}

.login-captcha-img {
    width: 120px;
    height: 42px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}

.login-button {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 5px;
    background-color: #FFFFFF;
    color: #7D1A15;
    font-size: 16px;
    cursor: pointer;
}

.login-button:hover { background-color: #f0f0f0; }

/* ==========================================================================
   首页（复刻 Home.vue）
   ========================================================================== */

.home-body {
    padding-top: 100px;
    background-color: #ECECEC;
    min-height: 100vh;
}

.home-bg { width: 100%; display: block; }

.home-content-body {
    width: 80%;
    margin: 0 auto;
    background-color: #fff;
    padding: 50px;
    margin-top: -200px;
    position: relative;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.dept-grid { display: flex; flex-wrap: wrap; }

.dept-box {
    display: block;
    text-align: center;
    margin-bottom: 50px;
    width: 33.3333%;
    padding: 0 12px;
}

.dept-number {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border-radius: 50%;
    font-size: 18px;
    border: 1px solid #7D1A15;
    color: #7D1A15;
    font-weight: bold;
    margin-bottom: 10px;
}

.dept-name {
    color: #7D1A15;
    font-size: 16px;
}

.dept-box:hover .dept-number {
    background-color: #7D1A15;
    color: #fff;
}

/* ==========================================================================
   列表 / 详情 / 表单页版式（复刻 global.less + *.vue）
   ========================================================================== */

.page-body {
    padding-top: 120px;
    padding-bottom: 40px;
    background-color: #ECECEC;
    min-height: 100vh;
}

.page-content {
    width: 80%;
    margin: 0 10%;
    display: flex;
    align-items: flex-start;
}

.page-left-nav { width: 340px; flex: 0 0 340px; }

.nav-top {
    font-size: 24px;
    color: #fff;
    background-color: #CB5520;
    line-height: 70px;
    text-align: center;
}

.nav-deco { display: block; width: 100%; }

.nav-list-box {
    min-height: 600px;
    background: url('/static/platform/img/s_2.png') no-repeat center;
    background-size: cover;
    padding-top: 50px;
}

.nav-list-item {
    cursor: pointer;
    display: block;
    width: 220px;
    line-height: 56px;
    text-align: center;
    height: 56px;
    font-size: 18px;
    margin: 0 auto 10px auto;
    color: #333;
}

.nav-list-item.active {
    background: url('/static/platform/img/s_title.png') no-repeat center;
}

.page-right {
    flex: 1;
    margin-left: 20px;
    background-color: #ffffff;
    padding: 20px;
    min-width: 0;
}

.main-body { padding: 24px; }

.crumb-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.platform-breadcrumb { font-size: 14px; color: #666; }
.platform-breadcrumb a { color: #666; }
.platform-breadcrumb a:hover { color: #9a2929; }
.crumb-sep { margin: 0 8px; color: #ccc; }

.crumb-actions { display: flex; gap: 8px; }

.nav-line {
    width: 100%;
    height: 6px;
    background: url('/static/platform/img/s5.png') repeat-x;
    margin: 20px 0;
}

/* 年份按钮组 */
.year-box { display: flex; flex-wrap: wrap; }

.year-item {
    cursor: pointer;
    display: inline-block;
    width: 100px;
    margin-right: 10px;
    margin-bottom: 10px;
    height: 42px;
    line-height: 42px;
    text-align: center;
    background: url('/static/platform/img/year.png') no-repeat center;
    color: #333;
    font-size: 14px;
}

.year-item:hover {
    color: #fff;
    background: url('/static/platform/img/year_active.png') no-repeat center;
}

.year-item.active {
    color: #fff;
    background: url('/static/platform/img/year_active.png') no-repeat center;
}

.table-content { margin-top: 20px; }

/* 表格标题区（复刻 antd table 的 title 插槽：上传按钮在表格上方左缩进） */
.table-title { padding: 0 16px 16px; }

/* ==========================================================================
   表格（antd 风格）
   ========================================================================== */

.platform-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.88);
    background: #fff;
}

.platform-table th {
    background: #fafafa;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.platform-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    word-break: break-all;
}

.platform-table tbody tr:hover { background: #fafafa; }

.platform-table .table-empty {
    text-align: center;
    color: rgba(0, 0, 0, 0.25);
    padding: 48px 16px;
}

.table-actions { white-space: nowrap; }

/* ==========================================================================
   按钮 / 链接按钮（antd 风格）
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 15px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary { background: #9a2929; border-color: #9a2929; color: #fff; }
.btn-primary:hover { background: #ae5454; border-color: #ae5454; }

.btn-default { background: #fff; border-color: #d9d9d9; color: rgba(0, 0, 0, 0.88); }
.btn-default:hover { border-color: #ae5454; color: #ae5454; }

.link-btn {
    background: none;
    border: none;
    padding: 0;
    margin-right: 8px;
    color: #9a2929;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5714;
}

.link-btn:hover { color: #ae5454; }

.link-danger { color: #ff4d4f; }
.link-danger:hover { color: #ff7875; }

.inline-form { display: inline; }

/* ==========================================================================
   分页（antd 风格）
   ========================================================================== */

.platform-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.page-item {
    display: inline-block;
    min-width: 32px;
    height: 32px;
    line-height: 30px;
    padding: 0 6px;
    text-align: center;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: rgba(0, 0, 0, 0.88);
    font-size: 14px;
    text-decoration: none;
}

.page-item:hover { border-color: #ae5454; color: #ae5454; }

.page-item.active {
    border-color: #9a2929;
    color: #9a2929;
    font-weight: 500;
}

.page-item.disabled {
    color: rgba(0, 0, 0, 0.25);
    border-color: #d9d9d9;
    cursor: not-allowed;
}

.page-item.page-ellipsis { border: none; background: none; }

/* ==========================================================================
   详情页（复刻 Show.vue）
   ========================================================================== */

.info-title {
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    color: rgba(0, 0, 0, 0.88);
    line-height: 1.6;
}

.info-params {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 20px;
    border-top: 1px dashed #9a2929;
    border-bottom: 1px dashed #9a2929;
}

.param-item { font-size: 14px; color: #333; }

.video-item {
    margin-bottom: 20px;
    text-align: center;
}

.video-item video { max-width: 100%; }

.video-item .file-name { margin-bottom: 20px; }

.audio-item {
    margin-bottom: 20px;
    text-align: center;
}

.audio-item .file-name { margin-bottom: 20px; }

.carousel-box {
    max-width: calc(80vw - 380px);
    margin: 0 auto;
    text-align: center;
}

.carousel-main img {
    border: 5px solid #fff;
    display: block;
    margin: auto;
    max-width: 80%;
    max-height: 400px;
}

.carousel-thumbs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.carousel-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    filter: grayscale(100%);
    cursor: pointer;
}

.carousel-thumb.active { filter: grayscale(0%); }

.article-files {
    margin-bottom: 20px;
    max-width: 640px;
}

.article-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 4px;
    font-size: 14px;
}

.attachment-tip {
    margin: 16px 0 10px;
    font-size: 14px;
    color: #666;
}

.article-content {
    margin-top: 20px;
    line-height: 1.8;
    font-size: 14px;
    color: #333;
    word-break: break-word;
}

.article-content img { max-width: 100%; height: auto; }
.article-content p { margin: 10px 0; }

/* ==========================================================================
   表单（复刻 ComAdd / ComEdit）
   ========================================================================== */

.platform-form .form-row {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

.form-label {
    flex: 0 0 140px;
    width: 140px;
    text-align: right;
    padding-right: 16px;
    padding-top: 8px;
    font-size: 14px;
    color: #333;
}

.form-control {
    flex: 1;
    min-width: 0;
    font-size: 14px;
}

.form-input, .form-select {
    width: 100%;
    max-width: 480px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.88);
    background: #fff;
    outline: none;
    font-family: inherit;
}

.form-input:focus, .form-select:focus {
    border-color: #9a2929;
    box-shadow: 0 0 0 2px rgba(154, 41, 41, 0.1);
}

.form-hint { font-size: 12px; color: #999; margin-top: 6px; }

/* 表单校验错误提示（前端 JS 校验，规则与后端一致） */
.form-hint-error { color: #ff4d4f; }
.form-input-error, .form-input-error:focus { border-color: #ff4d4f; }
.form-input-error:focus { box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.1); }

.radio-group { padding-top: 8px; }

.radio-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 20px;
    font-size: 14px;
    cursor: pointer;
}

/* 上传区 */
.upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 400px;
    max-width: 100%;
    height: 40px;
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
    color: #333;
    font-size: 14px;
}

.upload-btn:hover { border-color: #9a2929; color: #9a2929; }

.upload-btn-plus { font-size: 16px; font-weight: bold; }

.upload-tip { font-size: 12px; color: #999; margin-top: 8px; }

.upload-disabled-tip {
    padding: 10px 12px;
    max-width: 480px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
    font-size: 13px;
    color: #ad6800;
}

.upload-list { margin-top: 10px; }

.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 480px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
}

.upload-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item-progress {
    flex: 0 0 110px;
    width: 110px;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.upload-item-progress-bar {
    height: 100%;
    width: 0;
    background: #9a2929;
    transition: width 0.2s;
}

.upload-item-status { flex: 0 0 auto; }
.upload-item-status.done { color: #52c41a; }
.upload-item-status.pending { color: #9a2929; }
.upload-item-status.error { color: #ff4d4f; }

.upload-item-remove {
    flex: 0 0 auto;
    background: none;
    border: none;
    padding: 0;
    color: #ff4d4f;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.upload-item-remove:hover { color: #ff7875; }

/* 富文本 */
.quill-wrap { max-width: 720px; background: #fff; }

.quill-wrap .ql-toolbar { border-radius: 6px 6px 0 0; }
.quill-wrap .ql-container { border-radius: 0 0 6px 6px; min-height: 260px; font-size: 14px; }

/* ==========================================================================
   搜索页（复刻 Search.vue）
   ========================================================================== */

.search-page-body {
    background-color: #ECECEC;
    min-height: 100vh;
}

.search-list {
    width: 1200px;
    max-width: 92vw;
    padding-top: 120px;
    padding-bottom: 40px;
    margin: 0 auto;
}

.search-result-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

/* ==========================================================================
   管理页（平台布局内）
   ========================================================================== */

.manage-container {
    width: 80%;
    margin: 0 auto;
    background: #fff;
    padding: 24px;
    border-radius: 4px;
}

.manage-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.manage-nav-item {
    padding: 6px 16px;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
}

.manage-nav-item:hover { color: #9a2929; }

.manage-nav-item.active {
    background: rgba(154, 41, 41, 0.1);
    color: #9a2929;
}

.manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.manage-title { font-size: 18px; font-weight: 600; color: #333; }
.manage-subtitle { font-size: 16px; font-weight: 600; color: #333; }

.manage-form { max-width: 720px; margin-top: 8px; }

.account-info {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 16px;
    margin-bottom: 24px;
    background: #fafafa;
    border-radius: 6px;
    font-size: 14px;
}

.account-info-label { color: #999; margin-right: 10px; }

.oss-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.oss-status-text { font-size: 13px; color: #666; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.badge-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-warning { background: #fffbe6; color: #ad6800; border: 1px solid #ffe58f; }

/* ==========================================================================
   下载弹窗（platform.js 动态创建）
   ========================================================================== */

.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 16px 16px 16px;
    overflow-y: auto;
}

.modal-dialog {
    background: #fff;
    border-radius: 8px;
    width: 800px;
    max-width: 96vw;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

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

.modal-title { font-size: 16px; font-weight: 600; color: rgba(0, 0, 0, 0.88); }

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px;
    font-family: inherit;
}

.modal-close:hover { color: #333; }

.modal-body {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 12px 24px;
    text-align: right;
    border-top: 1px solid #f0f0f0;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0;
    font-size: 14px;
}

.download-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.download-item-left img {
    width: 100px;
    border-radius: 4px;
    flex: 0 0 auto;
}

.download-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-empty {
    color: #999;
    text-align: center;
    padding: 20px 0;
}

/* ==========================================================================
   404 页
   ========================================================================== */

.error-page-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #ECECEC;
    margin: 0;
}

.error-page { text-align: center; }

.error-code {
    font-size: 96px;
    font-weight: 700;
    color: #7D1A15;
    line-height: 1;
}

.error-text {
    font-size: 16px;
    color: #666;
    margin: 16px 0 24px;
}
