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

:root {
    --primary-color: #0084ff;
    --primary-hover: #0066cc;
    --success-color: #10b981;
    --danger-color: #dc3545;
    --dark-bg: #1e293b;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.9);
}

header {
    background: var(--primary-color);
    color: white;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info span {
    font-size: 14px;
    opacity: 0.9;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.user-info button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.user-info button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-content {
    display: flex;
    min-height: calc(100vh - 70px);
    gap: 0;
}

.sidebar {
    width: 280px;
    background: var(--dark-bg);
    padding: 30px 20px;
    box-shadow: var(--shadow-md);
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 12px;
}

.sidebar a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    gap: 12px;
}

.sidebar a:before {
    content: '';
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(8px);
}

.sidebar a:hover:before {
    background: #fff;
}

.sidebar a.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.sidebar a.active:before {
    background: #fff;
}

.content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.dashboard h2 {
    margin-bottom: 30px;
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 700;
}

.dashboard > p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-top: 40px;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.dashboard-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid var(--border-color);
}

.dashboard-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.dashboard-card .card-icon {
    font-size: 48px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.dashboard-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.dashboard-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-add {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-add:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.projects-table {
    width: 100%;
    border-collapse: separate;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border-spacing: 0;
}

.projects-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
}

.projects-table th {
    padding: 18px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
}

.projects-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 16px;
}

.projects-table tr:last-child td {
    border-bottom: none;
}

.projects-table tbody tr {
    transition: all 0.3s ease;
}

.projects-table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    transform: scale(1.01);
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.projects-table th:nth-child(4),
.projects-table td:nth-child(4) {
    min-width: 140px;
}

.projects-table th:last-child,
.projects-table td:last-child {
    width: 260px;
    max-width: 260px;
}

.members-table th:nth-child(4),
.members-table td:nth-child(4) {
    min-width: 240px;
}

.members-table th:last-child,
.members-table td:last-child {
    width: 300px;
    max-width: 300px;
}

/* 项目状态样式 */
.status-0 {
    background: #6c757d;
    color: white;
}

.status-1 {
    background: var(--primary-color);
    color: white;
}

.status-2 {
    background: var(--success-color);
    color: white;
}

.status-3 {
    background: #28a745;
    color: white;
}

.status--1 {
    background: #ffc107;
    color: #333;
}

.status--2 {
    background: var(--danger-color);
    color: white;
}

/* 项目成员状态样式 */
.members-table .status-0 {
    background: #6c757d;
    color: white;
}

.members-table .status-1 {
    background: #fd7e14;
    color: white;
}

.members-table .status-2 {
    background: var(--success-color);
    color: white;
}

.members-table .status--1 {
    background: var(--danger-color);
    color: white;
}

/* 项目成员角色样式 */
.role-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.role-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.role-2 {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.role-10 {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: white;
}

/* 兼容旧的状态样式 */
.status-active {
    background: var(--success-color);
    color: white;
}

.status-inactive {
    background: var(--danger-color);
    color: white;
}

.status-pending {
    background: #6c757d;
    color: white;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-small {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.btn-edit {
    background: var(--primary-color);
}

.btn-delete {
    background: var(--danger-color);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-info {
    background: #17a2b8;
}

.btn-info:hover {
    background: #138496;
}

.btn-small:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.empty-state:before {
    content: '📁';
    display: block;
    font-size: 48px;
    margin-bottom: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex;
}

.project-modal-content {    
    background: var(--card-bg);
    padding: 28px;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.project-modal-content .modal-header {
    margin-bottom: 18px;
    padding-bottom: 12px;
}

.project-modal-content .form-columns {
    gap: 12px;
}

.project-modal-content .form-group {
    margin-bottom: 14px;
}

.project-modal-content .form-group label {
    margin-bottom: 6px;
}

.project-modal-content .form-group input:not([type="checkbox"]):not([type="radio"]),
.project-modal-content .form-group textarea,
.project-modal-content .form-group select {
    padding: 10px 12px;
}

.project-modal-content #project-description {
    min-height: 72px;
}

.project-modal-content #project-imgae-url {
    min-height: 56px;
}

.project-modal-content .cover-row {
    gap: 12px;
}

.project-modal-content .cover-right {
    padding: 8px;
}

.project-modal-content .form-actions {
    margin-top: 12px;
}

.project-modal-content .form-actions .btn-primary,
.project-modal-content .form-actions .btn-secondary {
    min-width: 104px;
    padding: 10px 22px;
    font-size: 14px;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 580px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.commodity-modal-content {
    padding: 24px;
    max-width: 640px;
}

.commodity-modal-content .modal-header {
    margin-bottom: 16px;
    padding-bottom: 10px;
}

.commodity-modal-content .form-group {
    margin-bottom: 12px;
}

.commodity-modal-content .form-group label {
    margin-bottom: 6px;
}

.commodity-modal-content .form-group input:not([type="checkbox"]):not([type="radio"]),
.commodity-modal-content .form-group textarea,
.commodity-modal-content .form-group select {
    padding: 10px 12px;
}

.commodity-modal-content #commodity-description {
    min-height: 72px;
}

.commodity-modal-content .form-actions {
    margin-top: 12px;
}

.invite-contract-modal-content {
    max-width: 580px;
}

.invite-contract-modal-content .form-group > label {
    font-size: 16px;
}

.invite-contract-modal-content.two-column {
    max-width: 1160px;
}

.modal-header.invite-contract-modal-header {
    position: relative;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.invite-contract-modal-header .modal-close {
    position: absolute;
    right: 0;
    top: 0;
}

.invite-contract-header-titles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: center;
    width: 100%;
    flex: 1;
    min-width: 0;
}

.invite-contract-header-col h3 {
    margin: 0;
}

.invite-contract-header-col-left {
    padding-bottom: 20px;
    position: relative;
    width: 100%;
}

.invite-contract-header-col-right {
    display: none;
    padding-bottom: 20px;
    position: relative;
    width: 100%;
}

.invite-contract-header-col-left::after,
.invite-contract-header-col-right::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    border-bottom: 2px solid var(--border-color);
}

.invite-contract-header-col-left::after {
    width: calc(100% - 12px);
}

.invite-contract-header-col-right::after {
    width: 100%;
}

.invite-contract-modal-content.two-column .invite-contract-header-titles {
    grid-template-columns: 1fr 1fr;
}

.invite-contract-modal-content.two-column .invite-contract-header-col-right {
    display: block;
}

.invite-contract-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

.invite-contract-modal-content.two-column .invite-contract-columns {
    grid-template-columns: 1fr 1fr;
}

.invite-contract-col-left {
    padding-right: 12px;
}

.invite-contract-col-right {
    display: none;
}

.invite-contract-modal-content.two-column .invite-contract-col-right {
    display: block;
}

.commodity-modal-content .form-actions .btn-primary,
.commodity-modal-content .form-actions .btn-secondary {
    min-width: 104px;
    padding: 10px 22px;
    font-size: 14px;
}

.modal-large {
    max-width: 1400px;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.members-info {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: var(--light-bg);
    border-radius: 10px;
}

.members-info span {
    font-size: 14px;
    color: var(--text-secondary);
}

.members-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.members-table {
    width: 100%;
    border-collapse: separate;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border-spacing: 0;
}

.members-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
}

.members-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
}

.members-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 16px;
    white-space: nowrap;
}

.members-table tr:last-child td {
    border-bottom: none;
}

.members-table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    gap: 15px;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: var(--light-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.input-with-button {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
    width: auto;
}

.input-with-button textarea {
    flex: 1;
    width: auto;
    resize: vertical;
    min-height: 72px;
}

.cover-left .input-with-button {
    align-items: flex-start;
}

.cover-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cover-upload-btn-row {
    display: flex;
    justify-content: center;
}

.cover-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.cover-left {
    flex: 1 1 auto;
    min-width: 0;
}

.cover-right {
    flex: 0 0 240px;
    height: 150px;
    padding: 12px;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
}

.form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;

}

.form-columns.form-columns-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-column-left,
.form-column-right {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.login-page {
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-page:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.required-mark {
    color: var(--danger-color);
    font-weight: 700;
    font-size: 16px;
    margin-left: 2px;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
}

.login-box > p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 14px;
}

.oauth-login-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.oauth-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    color: white;
    background: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.oauth-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.oauth-btn.yitopia {
    background: var(--gradient-primary);
}

.login-info {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 30px;
    font-size: 13px;
    line-height: 1.8;
}

.login-info p {
    margin: 8px 0;
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 搜索框样式 */
.search-container {
    position: relative;
}

#member-search {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: var(--light-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#member-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
}

.search-result-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
}

.search-result-item.no-results {
    color: var(--text-secondary);
    font-size: 14px;
    cursor: default;
}

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--light-bg);
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.search-result-mobile {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 选中用户样式 */
.selected-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-top: 10px;
}

.selected-user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--light-bg);
}

.selected-user-info {
    flex: 1;
    font-weight: 0;
    color: var(--text-primary);
    font-size: 14px;
}

.btn-clear {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--danger-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: rotate(90deg);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    align-items: flex-start;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    line-height: 1.2;
}

.radio-item input[type="radio"] {
    margin: 0;
    width: auto;
    padding: 0;
    border: none;
    transform: translateY(1px);
}

.radio-item span {
    white-space: nowrap;
}

.radio-option {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.witness-nested {
    margin-left: 0;
    padding-left: 26px;
    margin-top: 2px;
    width: 100%;
}

#invite-contract-right .witness-nested > label {
    font-size: 14px;
}

.witness-nested.is-disabled {
    opacity: 0.45;
    filter: grayscale(1);
    pointer-events: none;
}

#invite-contract-right .radio-group {
    align-items: stretch;
    margin-top: 10px;
}

#invite-contract-right .radio-item span {
    color: var(--primary-color);
}

.witness-unregistered-hint {
    color: var(--danger-color);
    font-size: 13px;
    line-height: 1.5;
    margin-top: 6px;
    padding-left: 26px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    width: auto;
    min-width: 120px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.form-actions .btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.2);
}

.form-actions .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.3);
}

.form-actions .btn-primary:active {
    transform: translateY(0);
}

.form-actions .btn-secondary {
    background: #f8fafc;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    box-shadow: none;
}

.form-actions .btn-secondary:hover {
    background: #f1f5f9;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.form-actions .btn-secondary:active {
    transform: translateY(0);
}

.switch-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 8px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: all 0.3s ease;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .slider {
    background-color: var(--primary-color);
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

.contract-detail-modal-content {
    max-width: 900px;
}

.contract-detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.contract-detail-table th,
.contract-detail-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
}

.contract-detail-table th {
    width: 220px;
    text-align: left;
    color: var(--text-secondary);
    background: var(--light-bg);
    font-weight: 600;
}

.contract-detail-table td {
    color: var(--text-primary);
    word-break: break-all;
}

.contract-detail-table tr:last-child th,
.contract-detail-table tr:last-child td {
    border-bottom: none;
}

.contract-template-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contract-status-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contract-content-modal-content {
    max-width: 1100px;
}

.contract-content-body {
    height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.contract-content-hint {
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.contract-content-iframe {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
}

.contract-content-open-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--light-bg);
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contract-content-open-link:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.commodity-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: #fff;
}

.stock-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.stock-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: white;
}

.stock-on {
    background: var(--success-color);
}

.stock-off {
    background: var(--danger-color);
}

.sale-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: white;
}

.sale-on {
    background: var(--success-color);
}

.sale-off {
    background: var(--danger-color);
}

.commodity-image-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.commodity-image-left {
    flex: 1 1 auto;
    min-width: 0;
}

.commodity-image-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.commodity-image-upload-btn-row {
    display: flex;
    justify-content: center;
}

.commodity-image-preview-box {
    flex: 0 0 120px;
    height: 120px;
    padding: 8px;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.commodity-image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    background: #fff;
}

.commodity-url-modal-content {
    max-width: 1100px;
}

.commodity-url-body {
    height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.commodity-url-hint {
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.commodity-url-iframe {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
}

.commodity-url-open-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--light-bg);
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.commodity-url-open-link:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.commodity-desc-modal-content {
    max-width: 800px;
}

.commodity-desc-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.6;
}

.project-description-modal-content {
    max-width: 900px;
}

.project-description-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.6;
}

.projects-list-table th:nth-child(3),
.projects-list-table td:nth-child(3) {
    width: 90px;
}

.projects-list-table th:nth-child(5),
.projects-list-table td:nth-child(5) {
    width: 140px;
    max-width: 140px;
    white-space: normal;
}

.projects-list-table th:nth-child(8),
.projects-list-table td:nth-child(8) {
    width: 110px;
}

.projects-list-table th:nth-child(9),
.projects-list-table td:nth-child(9) {
    min-width: 270px;
}

.shop-switch-cell {
    justify-content: center;
    margin-top: 0;
}

.pin-switch-cell {
    justify-content: center;
    margin-top: 0;
}

.dt-cell {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.dt-date,
.dt-time {
    white-space: nowrap;
}

.contract-video-modal-content {
    max-width: 900px;
}

.contract-video-body {
    height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.contract-video-player {
    width: 100%;
    height: 100%;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: #000;
}

.oauth-btn.loading .loading-spinner {
    display: inline-block;
}

.oauth-btn.loading .btn-text {
    display: none;
}

.error-message {
    color: var(--danger-color);
    text-align: center;
    margin-top: 20px;
    padding: 14px 20px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 10px;
    border-left: 4px solid var(--danger-color);
    display: none;
    font-weight: 500;
    font-size: 14px;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 24px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.projects-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.projects-header-left {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    min-width: 0;
}

.projects-header-left .shop-meta {
    margin-bottom: 0;
    margin-left: 20px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    position: relative;
    top: -4px;
}

.contracts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 24px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.contracts-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.recruitment-stats,
.member-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.recruitment-stats div,
.member-stats div {
    color: var(--text-secondary);
}

.recruitment-stats strong,
.member-stats strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.5);
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 20px;
    }
    
    .sidebar ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .sidebar li {
        margin-bottom: 0;
    }
    
    .content {
        padding: 20px;
    }
    
    .projects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .btn-add {
        width: 100%;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .user-info span {
        display: none;
    }
    
    .form-columns {
        grid-template-columns: 1fr;
    }
}
