/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* 通用类 */
.container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 15px;
    min-height: 100vh;
}

.page-container {
    padding: 15px;
    background-color: #f7f8fa;
    min-height: 100vh;
    box-sizing: border-box; /* 确保 padding 不会增加总高度 */
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* 为底部导航栏预留空间 */
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.text-center {
    text-align: center;
}

/* 加载中遮罩 */
.ui-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.loading-content {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10000;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 30px;
    margin-bottom: 10px;
}

.loading-spinner > div {
    width: 10px;
    height: 10px;
    margin: 0 3px;
    background-color: #fff;
    border-radius: 100%;
    display: inline-block;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.loading-spinner .bounce1 {
    animation-delay: -0.32s;
}

.loading-spinner .bounce2 {
    animation-delay: -0.16s;
}

.loading-text {
    color: #fff;
    font-size: 14px;
}

@keyframes sk-bouncedelay {
    0%, 80%, 100% { 
        transform: scale(0);
    }
    40% { 
        transform: scale(1.0);
    }
}

/* 提示框 */
.toast-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 9999;
    max-width: 80%;
}

.toast-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toast-text {
    color: #fff;
    font-size: 14px;
    text-align: center;
}

.toast-success-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #07c160;
    position: relative;
    margin-bottom: 8px;
}

.toast-success-icon:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translate(-50%, -60%) rotate(-45deg);
}

.toast-error-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ee0a24;
    position: relative;
    margin-bottom: 8px;
}

.toast-error-icon:before, .toast-error-icon:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background-color: #fff;
}

.toast-error-icon:before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.toast-error-icon:after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* 颜色变量 */
:root {
    --primary-color: #1989fa;
    --success-color: #07c160;
    --warning-color: #ff976a;
    --danger-color: #ee0a24;
    --text-color: #333333;
    --text-color-light: #666666;
    --text-color-lighter: #999999;
    --border-color: #ebedf0;
    --background-color: #f5f5f5;
}

/* Icon styles for menu items, e.g., in my.html */
/* 仅用于my.html页面，不用于index.html */
.my-page .function-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    margin-right: 15px;
}

/* 确保不会影响index.html中的icon-text */
.my-page .icon-text {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

/* 颜色背景 - 低优先级，可被function-icon.css覆盖 */
.primary-bg { background-color: #1989fa; } /* Blue */
.highlight-bg { background-color: #ff976a; } /* Orange */
.success-bg { background-color: #07c160; } /* Green */
.warning-bg { background-color: #ffc107; } /* Yellow */

/* 通用头部 */
.page-header {
    background-color: #3B8AFF;
    color: #fff;
    padding: 15px;
    text-align: center;
    position: relative;
}

.page-title {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #3B8AFF;
    border-color: #3B8AFF;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* 卡片样式 */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* 通用间距 */
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

/* 文本对齐 */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

/* 文本颜色 */
.text-primary { color: #3B8AFF !important; }
.text-secondary { color: #6c757d !important; }
.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.text-warning { color: #ffc107 !important; }
.text-info { color: #17a2b8 !important; }
.text-light { color: #f8f9fa !important; }
.text-dark { color: #343a40 !important; }
.text-muted { color: #6c757d !important; }

/* 响应式工具 */
@media (max-width: 576px) {
    .d-sm-none { display: none !important; }
}

@media (max-width: 768px) {
    .d-md-none { display: none !important; }
}

/* 图片样式 */
.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    max-width: 100%;
    height: auto;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* 通用背景色 */
.bg-primary { background-color: #3B8AFF !important; }
.bg-secondary { background-color: #6c757d !important; }
.bg-success { background-color: #28a745 !important; }
.bg-danger { background-color: #dc3545 !important; }
.bg-warning { background-color: #ffc107 !important; }
.bg-info { background-color: #17a2b8 !important; }
.bg-light { background-color: #f8f9fa !important; }
.bg-dark { background-color: #343a40 !important; }
.bg-white { background-color: #fff !important; }

