/*******************************************************************************/
/*********          Company:     上海井人科技有限公司(Froguy)            *********/
/*********          Product:     Froguy Project Management System      *********/
/*********          Created By:  Fan Xiaolei(Raymond)                  *********/
/*********          Created On:  2016-10-11                            *********/
/*********          Modified By: Fan Xiaolei(Raymond)                  *********/
/*********          Modified On:  2020-03-01                           *********/
/*******************************************************************************/
/* Instruction */
/* 通用样式 */
/*******************************************************************************/

/* ============================
   CSS变量定义
   ============================ */
:root {
    /* 主色调 */
    --primary-color: #400485;
    --primary-hover: #a01fb9;
    --primary-light: #e3f2fd;

    /* 辅助色 */
    --secondary-color: #56a965;
    --accent-color: #e3d839;
    --danger-color: #cf4c39;
    --success-color: #56a965;
    --warning-color: #e3d839;
    --error-color: #cf4c39;

    /* 中性色 */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-light: #ffffff;

    /* 背景色 */
    --background: #ffffff;
    --background-secondary: #f5f7fa;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-tertiary: #e8ecf1;
    --bg-dark: #2c3e50;

    /* 边框色 */
    --border-color: #e0e6ed;
    --border-light: #f0f3f7;
    --border-focus: #8946e0;

    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.15);

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* 布局 */
    --header-height: 64px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 64px;
    --footer-height: 48px;

    /* 过渡 */
    --transition: all 0.3s ease;
}

/* ============================
   全局重置和基础样式
   ============================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================
   动画效果
   ============================ */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ============================
   布局工具类
   ============================ */

/* Flexbox布局 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

/* Flex子元素 */
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ============================
   间距工具类
   ============================ */

/* Margin */
.m-0 { margin: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-1 { margin-top: 4px; }
.mt-6 { margin-top: 24px; }
.ml-2 { margin-left: 8px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 16px; }

/* Padding */
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.pt-12 { padding-top: 48px; }
.pb-12 { padding-bottom: 48px; }
.pl-10 { padding-left: 40px; }
.pr-4 { padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }

/* ============================
   文本工具类
   ============================ */

/* 文本颜色 */
.text-danger { color: #cf4c39; }
.text-muted { color: #999999; }
.text-primary { color: #3379a5; }
.text-secondary { color: #666666; }
.text-success { color: #56a965; }
.text-warning { color: #e3d839; }

/* 文本对齐 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ============================
   背景工具类
   ============================ */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gradient-to-b { background-image: linear-gradient(to bottom, var(--gradient-start), var(--gradient-end)); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--gradient-start), var(--gradient-end)); }

/* ============================
   边框和圆角工具类
   ============================ */

/* 边框 */
.border { border: 1px solid #e0e6ed; }

/* 圆角 */
.rounded { border-radius: 4px; }
.rounded-full { border-radius: 50%; }
.rounded-lg { border-radius: 12px; }
.rounded-md { border-radius: 8px; }

/* ============================
   阴影工具类
   ============================ */
.shadow { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.shadow-sm { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15); }

/* ============================
   位置工具类
   ============================ */

/* 定位 */
.fixed { position: fixed; }
.absolute { position: absolute; }
.sticky { position: sticky; }

/* 位置偏移 */
.top-0 { top: 0; }
.top-1\/2 { top: 50%; }
.left-0 { left: 0; }
.left-1\/2 { left: 50%; }
.right-0 { right: 0; }

/* 层级 */
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* ============================
   宽度和高度工具类
   ============================ */

/* 宽度 */
.w-full { width: 100%; }
.w-10 { width: 40px; }
.w-8 { width: 32px; }

/* 高度 */
.h-full { height: 100%; }
.h-10 { height: 40px; }
.h-8 { height: 32px; }

/* ============================
   溢出工具类
   ============================ */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }

/* ============================
   过渡工具类
   ============================ */
.transition { transition: all 0.3s ease; }
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease; }
.transition-opacity { transition: opacity 0.3s ease; }

/* ============================
   变换工具类
   ============================ */
.transform { transform: translateZ(0); }
.translate-y-1\/2 { transform: translateY(50%); }
.translate-x-1\/2 { transform: translateX(50%); }
.-translate-y-1\/2 { transform: translateY(-50%); }
.-translate-x-1\/2 { transform: translateX(-50%); }

/* ============================
   光标工具类
   ============================ */
.cursor-pointer { cursor: pointer; }

/* ============================
   指针事件工具类
   ============================ */
.pointer-events-none { pointer-events: none; }

/* ============================
   滚动条样式
   ============================ */
::-webkit-scrollbar {
    width: 8px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* ============================
   按钮样式
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: rgba(51, 121, 165, 0.1);
    border-color: var(--primary-hover);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* ============================
   头部样式
   ============================ */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    gap: 1rem;
}

.title-section {
    display: flex;
    align-items: center;
    padding-left: 10px; /*Raymond: right page header-icon position */
    gap: 1rem;
    flex: 1;
}

.page-icon {
    width: 37px;
    height: 37px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-icon .material-icons-round {
    font-size: 1.14rem;
    color: #667eea;
}

.page-title h1 {
    font-size: 1.06rem;
    font-weight: 600;
    margin: 20px 0px 2px 10px; /*Raymond: right page header: up right bottom left */
    line-height: 1.2;
}

.page-title .page-subtitle {
    font-size: 0.53rem;
    opacity: 0.9;
    margin-top: 0.15rem;
    font-weight: 400;
}

.action-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============================
   状态类
   ============================ */

.is-active {
    color: var(--primary-color, #3379a5);
    background-color: var(--primary-light, #e3f2fd);
}

.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================
   状态标签样式
   ============================ */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.status-draft {
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
}

.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-new {
    background: #dbeafe;
    color: #1e40af;
}

.status-progress {
    background: #fef3c7;
    color: #92400e;
}

.status-delay {
    background: #fee2e2;
    color: #991b1b;
}

.status-complete {
    background: #d1fae5;
    color: #065f46;
}

/* ============================
   权限徽章样式
   ============================ */
.permission-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.permission-badge .material-icons-round {
    font-size: 16px;
}

.permission-on {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.permission-off {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

/* ============================
   优先级样式
   ============================ */
.priority-high {
    background: #fee2e2;
    color: #991b1b;
}

.priority-medium {
    background: #fef3c7;
    color: #92400e;
}

.priority-low {
    background: #dbeafe;
    color: #1e40af;
}

/* ============================
   Toast 提示
   ============================ */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: #10b981;
}

.toast-error {
    background: #ef4444;
}

/* ============================
   分区样式
   ============================ */
.section {
    margin-bottom: 2.5rem;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon .material-icons {
    font-size: 18px;
    color: var(--primary-color);
}

.section-divider {
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

/* ============================
   图片样式
   ============================ */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* ============================
   链接样式
   ============================ */
a:link {
    color: default;
    text-decoration: none;
}

a:visited {
    color: #c0c0c0;
    text-decoration: none;
}

a:hover {
    color: #00bfff;
    text-decoration: none;
}

a:active {
    color: default;
    text-decoration: none;
}

/* ============================
   主容器样式
   ============================ */
.fbox {
    width: 100%;
    margin: 0px;
    padding: 0px;
    background: auto;
}

.fbox img {
    max-width: 100% !important;
    height: auto !important;
}

/* ============================
   额外动画效果
   ============================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================
   额外工具类
   ============================ */
.hidden {
    display: none;
}
